From 6bed57a057c0e31ffed3ad2e1d3346e0c47eb680 Mon Sep 17 00:00:00 2001 From: Charlie Chen Date: Fri, 22 Nov 2024 13:05:22 -0600 Subject: [PATCH 1/2] move btc revert address test to advanced group to avoid upgrade test failure --- cmd/zetae2e/local/local.go | 2 +- e2e/e2etests/test_bitcoin_deposit_and_call_revert.go | 5 ++--- e2e/e2etests/test_bitcoin_std_deposit_and_call_revert.go | 5 ++--- ..._bitcoin_std_deposit_and_call_revert_other_address.go | 9 ++++----- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index 4c3a1f0717..b65d104df6 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -333,12 +333,12 @@ func localE2ETest(cmd *cobra.Command, _ []string) { e2etests.TestBitcoinStdMemoDepositName, e2etests.TestBitcoinStdMemoDepositAndCallName, e2etests.TestBitcoinStdMemoDepositAndCallRevertName, - e2etests.TestBitcoinStdMemoDepositAndCallRevertOtherAddressName, e2etests.TestBitcoinStdMemoInscribedDepositAndCallName, e2etests.TestCrosschainSwapName, } bitcoinDepositTestsAdvanced := []string{ e2etests.TestBitcoinDepositAndCallRevertWithDustName, + e2etests.TestBitcoinStdMemoDepositAndCallRevertOtherAddressName, } bitcoinWithdrawTests := []string{ e2etests.TestBitcoinWithdrawSegWitName, diff --git a/e2e/e2etests/test_bitcoin_deposit_and_call_revert.go b/e2e/e2etests/test_bitcoin_deposit_and_call_revert.go index 0c0e45c77f..78b7b8d280 100644 --- a/e2e/e2etests/test_bitcoin_deposit_and_call_revert.go +++ b/e2e/e2etests/test_bitcoin_deposit_and_call_revert.go @@ -1,7 +1,6 @@ package e2etests import ( - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/zeta-chain/node/e2e/runner" @@ -40,8 +39,8 @@ func TestBitcoinDepositAndCallRevert(r *runner.E2ERunner, args []string) { // Check revert tx receiver address and amount receiver, value := r.QueryOutboundReceiverAndAmount(cctx.OutboundParams[1].Hash) - assert.Equal(r, r.BTCDeployerAddress.EncodeAddress(), receiver) - assert.Positive(r, value) + require.Equal(r, r.BTCDeployerAddress.EncodeAddress(), receiver) + require.True(r, value > 0) r.Logger.Info("Sent %f BTC to TSS with invalid memo, got refund of %d satoshis", amount, value) } diff --git a/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert.go b/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert.go index 96b4186d8f..3a2ca1ade6 100644 --- a/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert.go +++ b/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert.go @@ -1,7 +1,6 @@ package e2etests import ( - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/zeta-chain/node/e2e/runner" @@ -42,8 +41,8 @@ func TestBitcoinStdMemoDepositAndCallRevert(r *runner.E2ERunner, args []string) // Check revert tx receiver address and amount receiver, value := r.QueryOutboundReceiverAndAmount(cctx.OutboundParams[1].Hash) - assert.Equal(r, r.BTCDeployerAddress.EncodeAddress(), receiver) - assert.Positive(r, value) + require.Equal(r, r.BTCDeployerAddress.EncodeAddress(), receiver) + require.True(r, value > 0) r.Logger.Info("Sent %f BTC to TSS to call non-existing contract, got refund of %d satoshis", amount, value) } diff --git a/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert_other_address.go b/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert_other_address.go index 19e9893b95..09c8335328 100644 --- a/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert_other_address.go +++ b/e2e/e2etests/test_bitcoin_std_deposit_and_call_revert_other_address.go @@ -1,7 +1,6 @@ package e2etests import ( - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/zeta-chain/node/e2e/runner" @@ -46,13 +45,13 @@ func TestBitcoinStdMemoDepositAndCallRevertOtherAddress(r *runner.E2ERunner, arg cctx := utils.WaitCctxRevertedByInboundHash(r.Ctx, r, txHash.String(), r.CctxClient) // Make sure inbound sender and revert address are correct - assert.Equal(r, cctx.InboundParams.Sender, r.BTCDeployerAddress.EncodeAddress()) - assert.Equal(r, cctx.GetCurrentOutboundParam().Receiver, revertAddress) + require.Equal(r, cctx.InboundParams.Sender, r.BTCDeployerAddress.EncodeAddress()) + require.Equal(r, cctx.GetCurrentOutboundParam().Receiver, revertAddress) // Check revert tx receiver address and amount receiver, value := r.QueryOutboundReceiverAndAmount(cctx.OutboundParams[1].Hash) - assert.Equal(r, revertAddress, receiver) - assert.Positive(r, value) + require.Equal(r, revertAddress, receiver) + require.True(r, value > 0) r.Logger.Info( "Sent %f BTC to TSS to call non-existing contract, got refund of %d satoshis to other address", From a88b3d30a1fdf0ea7723084bdf531bdba7f83a11 Mon Sep 17 00:00:00 2001 From: Charlie Chen Date: Fri, 22 Nov 2024 13:13:04 -0600 Subject: [PATCH 2/2] add changelog entry --- changelog.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/changelog.md b/changelog.md index 01b6f7bd66..e66f9f6393 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,17 @@ # CHANGELOG +## Unreleased + +### Features + +### Tests + +* [3204](https://github.com/zeta-chain/node/issues/3204) - move Bitcoin revert address test to advanced group to avoid upgrade test failure + +### Refactor + +### Fixes + ## v23.0.0 ### Features