From 6642132b9eced4e636ce3f13164910781550fa9c Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 10 Jan 2024 21:48:43 -0800 Subject: [PATCH] optimize zeta deposit --- cmd/zetae2e/local/bitcoin.go | 5 ----- cmd/zetae2e/local/erc20.go | 5 ----- cmd/zetae2e/local/ethereum.go | 6 ------ contrib/localnet/scripts/genesis-stateful.sh | 8 ++++++++ contrib/localnet/scripts/genesis.sh | 11 ++++++++++- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/cmd/zetae2e/local/bitcoin.go b/cmd/zetae2e/local/bitcoin.go index 7f15061522..49f0b245fb 100644 --- a/cmd/zetae2e/local/bitcoin.go +++ b/cmd/zetae2e/local/bitcoin.go @@ -47,19 +47,14 @@ func bitcoinTestRoutine( startTime := time.Now() // funding the account - txZetaSend := deployerRunner.SendZetaOnEvm(UserBitcoinAddress, 1000) txUSDTSend := deployerRunner.SendUSDTOnEvm(UserBitcoinAddress, 1000) - - bitcoinRunner.WaitForTxReceiptOnEvm(txZetaSend) bitcoinRunner.WaitForTxReceiptOnEvm(txUSDTSend) // depositing the necessary tokens on ZetaChain - txZetaDeposit := bitcoinRunner.DepositZeta() txEtherDeposit := bitcoinRunner.DepositEther(false) txERC20Deposit := bitcoinRunner.DepositERC20() bitcoinRunner.SetupBitcoinAccount() bitcoinRunner.DepositBTC(false) - bitcoinRunner.WaitForMinedCCTX(txZetaDeposit) bitcoinRunner.WaitForMinedCCTX(txEtherDeposit) bitcoinRunner.WaitForMinedCCTX(txERC20Deposit) diff --git a/cmd/zetae2e/local/erc20.go b/cmd/zetae2e/local/erc20.go index c745077547..8e5a286fa8 100644 --- a/cmd/zetae2e/local/erc20.go +++ b/cmd/zetae2e/local/erc20.go @@ -47,17 +47,12 @@ func erc20TestRoutine( startTime := time.Now() // funding the account - txZetaSend := deployerRunner.SendZetaOnEvm(UserERC20Address, 1000) txUSDTSend := deployerRunner.SendUSDTOnEvm(UserERC20Address, 10) - - erc20Runner.WaitForTxReceiptOnEvm(txZetaSend) erc20Runner.WaitForTxReceiptOnEvm(txUSDTSend) // depositing the necessary tokens on ZetaChain - txZetaDeposit := erc20Runner.DepositZeta() txEtherDeposit := erc20Runner.DepositEther(false) txERC20Deposit := erc20Runner.DepositERC20() - erc20Runner.WaitForMinedCCTX(txZetaDeposit) erc20Runner.WaitForMinedCCTX(txEtherDeposit) erc20Runner.WaitForMinedCCTX(txERC20Deposit) diff --git a/cmd/zetae2e/local/ethereum.go b/cmd/zetae2e/local/ethereum.go index d87ed213ca..74a57a6470 100644 --- a/cmd/zetae2e/local/ethereum.go +++ b/cmd/zetae2e/local/ethereum.go @@ -46,14 +46,8 @@ func ethereumTestRoutine( ethereumRunner.Logger.Print("🏃 starting Ethereum tests") startTime := time.Now() - // funding the account - txZetaSend := deployerRunner.SendZetaOnEvm(UserEtherAddress, 1000) - ethereumRunner.WaitForTxReceiptOnEvm(txZetaSend) - // depositing the necessary tokens on ZetaChain - txZetaDeposit := ethereumRunner.DepositZeta() txEtherDeposit := ethereumRunner.DepositEther(false) - ethereumRunner.WaitForMinedCCTX(txZetaDeposit) ethereumRunner.WaitForMinedCCTX(txEtherDeposit) // run ethereum test diff --git a/contrib/localnet/scripts/genesis-stateful.sh b/contrib/localnet/scripts/genesis-stateful.sh index 8829a46db8..d9d377f42f 100755 --- a/contrib/localnet/scripts/genesis-stateful.sh +++ b/contrib/localnet/scripts/genesis-stateful.sh @@ -108,6 +108,14 @@ then # give balance to deployer account to deploy contracts directly on zEVM zetacored add-genesis-account zeta1uhznv7uzyjq84s3q056suc8pkme85lkvhrz3dd 100000000000000000000000000azeta +# erc20 tester + zetacored add-genesis-account zeta1datate7xmwm4uk032f9rmcu0cwy7ch7kg6y6zv 100000000000000000000000000azeta +# zeta tester + zetacored add-genesis-account zeta1tnp0hvsq4y5mxuhrq9h3jfwulxywpq0ads0rer 100000000000000000000000000azeta +# bitcoin tester + zetacored add-genesis-account zeta19q7czqysah6qg0n4y3l2a08gfzqxydla492v80 100000000000000000000000000azeta +# ethers tester + zetacored add-genesis-account zeta134rakuus43xn63yucgxhn88ywj8ewcv6ezn2ga 100000000000000000000000000azeta # 3. Copy the genesis.json to all the nodes .And use it to create a gentx for every node zetacored gentx operator 1000000000000000000000azeta --chain-id=$CHAINID --keyring-backend=$KEYRING diff --git a/contrib/localnet/scripts/genesis.sh b/contrib/localnet/scripts/genesis.sh index 685d52fe3c..93c8833541 100755 --- a/contrib/localnet/scripts/genesis.sh +++ b/contrib/localnet/scripts/genesis.sh @@ -97,8 +97,17 @@ then cat $HOME/.zetacored/config/genesis.json | jq '.app_state["observer"]["params"]["admin_policy"][0]["address"]="zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json cat $HOME/.zetacored/config/genesis.json | jq '.app_state["observer"]["params"]["admin_policy"][1]["address"]="zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json -# give balance to deployer account to deploy contracts directly on zEVM +# give balance to runner accounts to deploy contracts directly on zEVM +# deployer zetacored add-genesis-account zeta1uhznv7uzyjq84s3q056suc8pkme85lkvhrz3dd 100000000000000000000000000azeta +# erc20 tester + zetacored add-genesis-account zeta1datate7xmwm4uk032f9rmcu0cwy7ch7kg6y6zv 100000000000000000000000000azeta +# zeta tester + zetacored add-genesis-account zeta1tnp0hvsq4y5mxuhrq9h3jfwulxywpq0ads0rer 100000000000000000000000000azeta +# bitcoin tester + zetacored add-genesis-account zeta19q7czqysah6qg0n4y3l2a08gfzqxydla492v80 100000000000000000000000000azeta +# ethers tester + zetacored add-genesis-account zeta134rakuus43xn63yucgxhn88ywj8ewcv6ezn2ga 100000000000000000000000000azeta # 3. Copy the genesis.json to all the nodes .And use it to create a gentx for every node zetacored gentx operator 1000000000000000000000azeta --chain-id=$CHAINID --keyring-backend=$KEYRING --gas-prices 20000000000azeta