Skip to content

Commit

Permalink
optimize zeta deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Jan 11, 2024
1 parent d30b7b9 commit 6642132
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
5 changes: 0 additions & 5 deletions cmd/zetae2e/local/bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 0 additions & 5 deletions cmd/zetae2e/local/erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 0 additions & 6 deletions cmd/zetae2e/local/ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions contrib/localnet/scripts/genesis-stateful.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion contrib/localnet/scripts/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6642132

Please sign in to comment.