Skip to content

Commit

Permalink
e2e: entire balance compatibility for v7.7.x, v8.4.x (#6956)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
crodriguezvega authored Jul 26, 2024
1 parent 68a75cd commit 6ad9731
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo"
"TestMsgTransfer_WithMemo",
"TestMsgTransfer_EntireBalance"
],
"relayer-type": [
"hermes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo"
"TestMsgTransfer_WithMemo",
"TestMsgTransfer_EntireBalance"
],
"relayer-type": [
"hermes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo"
"TestMsgTransfer_WithMemo",
"TestMsgTransfer_EntireBalance"
],
"relayer-type": [
"hermes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
],
"test": [
"TestMsgTransfer_Succeeds_Nonincentivized_MultiDenom",
"TestMsgTransfer_EntireBalance",
"TestMsgTransfer_Fails_InvalidAddress_MultiDenom"
],
"relayer-type": [
Expand Down
13 changes: 8 additions & 5 deletions e2e/tests/transfer/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
})
}

0 comments on commit 6ad9731

Please sign in to comment.