Skip to content

Commit

Permalink
test(e2e): add chain header tests back and fix admin tests (#1577)
Browse files Browse the repository at this point in the history
* add header test back

* fix admin tests

* update changelogs
  • Loading branch information
lumtis authored Jan 20, 2024
1 parent d7cd5f8 commit da6f9e3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
9 changes: 6 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Unreleased

### Chores
### Tests

* [1585](https://github.com/zeta-chain/node/pull/1585) - Updated release instructions
* [1577](https://github.com/zeta-chain/node/pull/1577) - add chain header tests in E2E tests and fix admin tests

### Features

Expand All @@ -13,8 +13,11 @@
* [1535](https://github.com/zeta-chain/node/issues/1535) - Avoid voting on wrong ballots due to false blockNumber in EVM tx receipt
* [1588](https://github.com/zeta-chain/node/pull/1588) - fix chain params comparison logic

## Version: v12.0.0
### Chores

* [1585](https://github.com/zeta-chain/node/pull/1585) - Updated release instructions

## Version: v12.0.0

### Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion cmd/zetae2e/local/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func adminTestRoutine(
smoketests.TestUpdateBytecodeName,
smoketests.TestDepositEtherLiquidityCapName,
); err != nil {
return fmt.Errorf("admim tests failed: %v", err)
return fmt.Errorf("admin tests failed: %v", err)
}

adminRunner.Logger.Print("🍾 admin tests completed in %s", time.Since(startTime).String())
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetae2e/local/bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func bitcoinTestRoutine(
bitcoinRunner.WaitForMinedCCTX(txERC20Deposit)

bitcoinRunner.SetupBitcoinAccount(initBitcoinNetwork)
bitcoinRunner.DepositBTC(false)
bitcoinRunner.DepositBTC(true)

// run bitcoin test
// Note: due to the extensive block generation in Bitcoin localnet, block header test is run first
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetae2e/local/ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ethereumTestRoutine(
startTime := time.Now()

// depositing the necessary tokens on ZetaChain
txEtherDeposit := ethereumRunner.DepositEther(false)
txEtherDeposit := ethereumRunner.DepositEther(true)
ethereumRunner.WaitForMinedCCTX(txEtherDeposit)

// run ethereum test
Expand Down
6 changes: 5 additions & 1 deletion cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
}

testStartTime := time.Now()
logger.Print("starting tests")
logger.Print("starting E2E tests")

if testAdmin {
logger.Print("⚠️ admin tests enabled")
}

// start timer
go func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestPauseZRC20(sm *runner.SmokeTestRunner) {
if receipt.Status == 0 {
panic("Vault approval should succeed")
}
tx, err = sm.BTCZRC20.Approve(sm.ZevmAuth, vaultAddr, big.NewInt(1e18))
tx, err = sm.USDTZRC20.Approve(sm.ZevmAuth, vaultAddr, big.NewInt(1e18))
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -93,23 +93,23 @@ func TestPauseZRC20(sm *runner.SmokeTestRunner) {
}
sm.Logger.Info("Operations all failed")

// Check we can still interact with BTC ZRC20
// Check we can still interact with USDT ZRC20
sm.Logger.Info("Check other ZRC20 can still be operated")
tx, err = sm.BTCZRC20.Transfer(sm.ZevmAuth, sample.EthAddress(), big.NewInt(1e3))
tx, err = sm.USDTZRC20.Transfer(sm.ZevmAuth, sample.EthAddress(), big.NewInt(1e3))
if err != nil {
panic(err)
}
receipt = utils.MustWaitForTxReceipt(sm.Ctx, sm.ZevmClient, tx, sm.Logger, sm.ReceiptTimeout)
if receipt.Status == 0 {
panic("BTC transfer should succeed")
panic("USDT transfer should succeed")
}
tx, err = vaultContract.Deposit(sm.ZevmAuth, sm.BTCZRC20Addr, big.NewInt(1e3))
tx, err = vaultContract.Deposit(sm.ZevmAuth, sm.USDTZRC20Addr, big.NewInt(1e3))
if err != nil {
panic(err)
}
receipt = utils.MustWaitForTxReceipt(sm.Ctx, sm.ZevmClient, tx, sm.Logger, sm.ReceiptTimeout)
if receipt.Status == 0 {
panic("BTC vault deposit should succeed")
panic("USDT vault deposit should succeed")
}

// Check deposit revert when paused
Expand Down

0 comments on commit da6f9e3

Please sign in to comment.