Skip to content

Commit

Permalink
chore: renamed wallet to less verbose name
Browse files Browse the repository at this point in the history
  • Loading branch information
chatton committed Jul 11, 2022
1 parent 49e65c5 commit 4b9fe9b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions e2e/fee_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ func (s *FeeMiddlewareTestSuite) TestMsgPayPacketFeeAsyncSingleSender() {
s.Require().Equal(chainARelayerWallet.Address, address)
})

chainAWalletToChainBWalletAmount := ibc.WalletAmount{
walletAmount := ibc.WalletAmount{
Address: chainAWallet.Bech32Address(chainB.Config().Bech32Prefix), // destination address
Denom: chainADenom,
Amount: testvalues.IBCTransferAmount,
}

t.Run("send IBC transfer", func(t *testing.T) {
chainATx, err = chainA.SendIBCTransfer(ctx, channelA.ChannelID, chainAWallet.KeyName, chainAWalletToChainBWalletAmount, nil)
chainATx, err = chainA.SendIBCTransfer(ctx, channelA.ChannelID, chainAWallet.KeyName, walletAmount, nil)
s.Require().NoError(err)
s.Require().NoError(chainATx.Validate(), "chain-a ibc transfer tx is invalid")
})
Expand All @@ -124,7 +124,7 @@ func (s *FeeMiddlewareTestSuite) TestMsgPayPacketFeeAsyncSingleSender() {
actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet)
s.Require().NoError(err)

expected := testvalues.StartingTokenAmount - chainAWalletToChainBWalletAmount.Amount - chainA.GetGasFeesInNativeDenom(chainATx.GasSpent)
expected := testvalues.StartingTokenAmount - walletAmount.Amount - chainA.GetGasFeesInNativeDenom(chainATx.GasSpent)
s.Require().Equal(expected, actualBalance)
})

Expand Down Expand Up @@ -167,7 +167,7 @@ func (s *FeeMiddlewareTestSuite) TestMsgPayPacketFeeAsyncSingleSender() {
s.Require().NoError(err)

gasFees := chainA.GetGasFeesInNativeDenom(chainATx.GasSpent) + chainA.GetGasFeesInNativeDenom(payPacketFeeTxResp.GasWanted)
expected := testvalues.StartingTokenAmount - chainAWalletToChainBWalletAmount.Amount - gasFees - testFee.Total().AmountOf(chainADenom).Int64()
expected := testvalues.StartingTokenAmount - walletAmount.Amount - gasFees - testFee.Total().AmountOf(chainADenom).Int64()
s.Require().Equal(expected, actualBalance)
})

Expand All @@ -177,8 +177,6 @@ func (s *FeeMiddlewareTestSuite) TestMsgPayPacketFeeAsyncSingleSender() {
s.StartRelayer(relayer)
})

// wait for packets.

t.Run("packets are relayed", func(t *testing.T) {
packets, err := s.QueryIncentivizedPacketsForChannel(ctx, chainA, channelA.PortID, channelA.ChannelID)
s.Require().NoError(err)
Expand All @@ -191,7 +189,7 @@ func (s *FeeMiddlewareTestSuite) TestMsgPayPacketFeeAsyncSingleSender() {

gasFees := chainA.GetGasFeesInNativeDenom(chainATx.GasSpent) + chainA.GetGasFeesInNativeDenom(payPacketFeeTxResp.GasWanted)
// once the relayer has relayed the packets, the timeout fee should be refunded.
expected := testvalues.StartingTokenAmount - chainAWalletToChainBWalletAmount.Amount - gasFees - testFee.AckFee.AmountOf(chainADenom).Int64() - testFee.RecvFee.AmountOf(chainADenom).Int64()
expected := testvalues.StartingTokenAmount - walletAmount.Amount - gasFees - testFee.AckFee.AmountOf(chainADenom).Int64() - testFee.RecvFee.AmountOf(chainADenom).Int64()
s.Require().Equal(expected, actualBalance)
})
}
Expand Down

0 comments on commit 4b9fe9b

Please sign in to comment.