Skip to content

Commit

Permalink
- fix ictest
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Oct 21, 2024
1 parent 6fcd6e5 commit 6e3bb23
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/interchaintest/ibc_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@ func TestTerraGaiaIBCTranfer(t *testing.T) {
terraTokenDenom := transfertypes.GetPrefixedDenom(terraChannels[0].Counterparty.PortID, terraChannels[0].Counterparty.ChannelID, terra.Config().Denom)
terraIBCDenom := transfertypes.ParseDenomTrace(terraTokenDenom).IBCDenom()

// the transfer is using 200000 gas, gas price is 28.325uluna
gasFee := math.LegacyNewDec(200000).Mul(math.LegacyNewDecWithPrec(28325, 3))

// Assert that the funds are no longer present in user acc on Terra Classic and are in the user acc on Gaia
terraUserUpdateBal, err := terra.GetBalance(ctx, terraUserAddr, terra.Config().Denom)
require.NoError(t, err)
require.True(t, terraUserUpdateBal.Equal(terraUserInitialBal.Sub(transferAmount)))
require.Equal(t, terraUserUpdateBal, terraUserInitialBal.Sub(transferAmount).Sub(gasFee.RoundInt()))

gaiaUserUpdateBal, err := gaia.GetBalance(ctx, gaiaUserAddr, terraIBCDenom)
require.NoError(t, err)
Expand All @@ -169,10 +172,10 @@ func TestTerraGaiaIBCTranfer(t *testing.T) {
_, err = testutil.PollForAck(ctx, gaia, gaiaHeight, gaiaHeight+10, transferTx.Packet)
require.NoError(t, err)

// Assert that the funds are now back on Terra Classic and not on Gaia
// Assert that the funds are now back on Terra Classic and not on Gaia (except gas fees paid of course)
terraUserUpdateBal, err = terra.GetBalance(ctx, terraUserAddr, terra.Config().Denom)
require.NoError(t, err)
require.Equal(t, terraUserInitialBal, terraUserUpdateBal)
require.Equal(t, terraUserInitialBal.Sub(gasFee.RoundInt()), terraUserUpdateBal)

gaiaUserUpdateBal, err = gaia.GetBalance(ctx, gaiaUserAddr, terraIBCDenom)
require.NoError(t, err)
Expand Down

0 comments on commit 6e3bb23

Please sign in to comment.