From 6ad9731068443d1965e64e69f3eb450154bd3e4e Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Fri, 26 Jul 2024 13:53:59 +0200 Subject: [PATCH] e2e: entire balance compatibility for v7.7.x, v8.4.x (#6956) * e2e: entire balance compatibility for v7.7.x, v8.4.x * put test on b, because the entire balance is sent from chain b * add if statement for v2 channels * update comments --- .../release-v7.7.x/transfer-chain-b.json | 3 ++- .../release-v8.4.x/transfer-chain-b.json | 3 ++- .../release-v9.0.x/transfer-chain-b.json | 3 ++- .../transfer-v2-multidenom-chain-a.json | 1 - e2e/tests/transfer/base_test.go | 13 ++++++++----- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/compatibility-test-matrices/release-v7.7.x/transfer-chain-b.json b/.github/compatibility-test-matrices/release-v7.7.x/transfer-chain-b.json index dc70af2ed74..add43b0c727 100644 --- a/.github/compatibility-test-matrices/release-v7.7.x/transfer-chain-b.json +++ b/.github/compatibility-test-matrices/release-v7.7.x/transfer-chain-b.json @@ -22,7 +22,8 @@ "TestMsgTransfer_Succeeds_Nonincentivized", "TestMsgTransfer_Fails_InvalidAddress", "TestMsgTransfer_Timeout_Nonincentivized", - "TestMsgTransfer_WithMemo" + "TestMsgTransfer_WithMemo", + "TestMsgTransfer_EntireBalance" ], "relayer-type": [ "hermes" diff --git a/.github/compatibility-test-matrices/release-v8.4.x/transfer-chain-b.json b/.github/compatibility-test-matrices/release-v8.4.x/transfer-chain-b.json index ebaddf363c8..9fe1f87a992 100644 --- a/.github/compatibility-test-matrices/release-v8.4.x/transfer-chain-b.json +++ b/.github/compatibility-test-matrices/release-v8.4.x/transfer-chain-b.json @@ -22,7 +22,8 @@ "TestMsgTransfer_Succeeds_Nonincentivized", "TestMsgTransfer_Fails_InvalidAddress", "TestMsgTransfer_Timeout_Nonincentivized", - "TestMsgTransfer_WithMemo" + "TestMsgTransfer_WithMemo", + "TestMsgTransfer_EntireBalance" ], "relayer-type": [ "hermes" diff --git a/.github/compatibility-test-matrices/release-v9.0.x/transfer-chain-b.json b/.github/compatibility-test-matrices/release-v9.0.x/transfer-chain-b.json index 8d1e5d947f8..f76ad22bb23 100644 --- a/.github/compatibility-test-matrices/release-v9.0.x/transfer-chain-b.json +++ b/.github/compatibility-test-matrices/release-v9.0.x/transfer-chain-b.json @@ -22,7 +22,8 @@ "TestMsgTransfer_Succeeds_Nonincentivized", "TestMsgTransfer_Fails_InvalidAddress", "TestMsgTransfer_Timeout_Nonincentivized", - "TestMsgTransfer_WithMemo" + "TestMsgTransfer_WithMemo", + "TestMsgTransfer_EntireBalance" ], "relayer-type": [ "hermes" diff --git a/.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json b/.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json index e75a7b6c73e..60de14c5609 100644 --- a/.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json +++ b/.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json @@ -10,7 +10,6 @@ ], "test": [ "TestMsgTransfer_Succeeds_Nonincentivized_MultiDenom", - "TestMsgTransfer_EntireBalance", "TestMsgTransfer_Fails_InvalidAddress_MultiDenom" ], "relayer-type": [ diff --git a/e2e/tests/transfer/base_test.go b/e2e/tests/transfer/base_test.go index 622c2c45afc..63cc7a51757 100644 --- a/e2e/tests/transfer/base_test.go +++ b/e2e/tests/transfer/base_test.go @@ -629,22 +629,25 @@ func (s *TransferTestSuite) TestMsgTransfer_EntireBalance() { s.Require().Equal(testvalues.StartingTokenAmount, actualBalance.Int64()) if channelA.Version == transfertypes.V2 { - // test that chainA has the entirety of chainB's token IBC denom. + // test that chainA has the entirety of chainB's IBC token denom. actualBalance, err = query.Balance(ctx, chainA, chainAAddress, chainAIBCToken.IBCDenom()) s.Require().NoError(err) s.Require().Equal(testvalues.StartingTokenAmount, actualBalance.Int64()) } - // Tests that chainB has a zero balance for both. + // test that chainB has a zero balance of chainA's IBC token denom. actualBalance, err = query.Balance(ctx, chainB, chainBAddress, chainBIBCToken.IBCDenom()) s.Require().NoError(err) s.Require().Zero(actualBalance.Int64()) - actualBalance, err = query.Balance(ctx, chainB, chainBAddress, chainB.Config().Denom) + if channelA.Version == transfertypes.V2 { + // test that chainB has a zero balance of its native token. + actualBalance, err = query.Balance(ctx, chainB, chainBAddress, chainB.Config().Denom) - s.Require().NoError(err) - s.Require().Zero(actualBalance.Int64()) + s.Require().NoError(err) + s.Require().Zero(actualBalance.Int64()) + } }) }