diff --git a/modules/apps/29-fee/ibc_module_test.go b/modules/apps/29-fee/ibc_module_test.go index 1f2ee00a935..b556f057d7e 100644 --- a/modules/apps/29-fee/ibc_module_test.go +++ b/modules/apps/29-fee/ibc_module_test.go @@ -300,14 +300,14 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { { "success", func(suite *FeeTestSuite) { - packetId := channeltypes.NewPacketId( + packetID := channeltypes.NewPacketId( suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, 1, ) refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) + identifiedFee := types.NewIdentifiedPacketFee(packetID, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedFee) suite.Require().NoError(err) }, false, @@ -315,14 +315,14 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { { "module account balance insufficient", func(suite *FeeTestSuite) { - packetId := channeltypes.PacketId{ + packetID := channeltypes.PacketId{ PortId: suite.path.EndpointA.ChannelConfig.PortID, ChannelId: suite.path.EndpointA.ChannelID, Sequence: 1, } refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) + identifiedFee := types.NewIdentifiedPacketFee(packetID, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedFee) suite.Require().NoError(err) suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, refundAcc, validCoins3) @@ -378,14 +378,14 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { { "success", func(suite *FeeTestSuite) { - packetId := channeltypes.PacketId{ + packetID := channeltypes.PacketId{ PortId: suite.path.EndpointA.ChannelConfig.PortID, ChannelId: suite.path.EndpointA.ChannelID, Sequence: 1, } refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) + identifiedFee := types.NewIdentifiedPacketFee(packetID, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedFee) suite.Require().NoError(err) }, false, @@ -393,14 +393,14 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { { "module account balance insufficient", func(suite *FeeTestSuite) { - packetId := channeltypes.PacketId{ + packetID := channeltypes.PacketId{ PortId: suite.path.EndpointA.ChannelConfig.PortID, ChannelId: suite.path.EndpointA.ChannelID, Sequence: 1, } refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) + identifiedFee := types.NewIdentifiedPacketFee(packetID, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedFee) suite.Require().NoError(err) suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, refundAcc, validCoins3) @@ -552,8 +552,8 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { { "no op success without a packet fee", func() { - packetId := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, suite.chainA.SenderAccount.GetSequence()) - suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetId) + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, suite.chainA.SenderAccount.GetSequence()) + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetID) ack = types.IncentivizedAcknowledgement{ Result: ibcmock.MockAcknowledgement.Acknowledgement(), @@ -616,9 +616,9 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { suite.Require().True(ok) // escrow the packet fee - packetId := channeltypes.NewPacketId(packet.GetSourceChannel(), packet.GetSourcePort(), packet.GetSequence()) + packetID := channeltypes.NewPacketId(packet.GetSourceChannel(), packet.GetSourcePort(), packet.GetSequence()) identifiedFee = types.NewIdentifiedPacketFee( - packetId, + packetID, types.Fee{ RecvFee: validCoins, AckFee: validCoins2, @@ -627,7 +627,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { suite.chainA.SenderAccount.GetAddress().String(), []string{}, ) - err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) + err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedFee) suite.Require().NoError(err) relayerAddr := suite.chainB.SenderAccount.GetAddress() @@ -701,8 +701,8 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { "no op if identified packet fee doesn't exist", func() { // delete packet fee - packetId := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, suite.chainA.SenderAccount.GetSequence()) - suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetId) + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, suite.chainA.SenderAccount.GetSequence()) + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetID) expectedBalance = originalBalance }, @@ -735,13 +735,13 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) suite.Require().True(ok) - packetId := channeltypes.NewPacketId(packet.GetSourceChannel(), packet.GetSourcePort(), packet.GetSequence()) + packetID := channeltypes.NewPacketId(packet.GetSourceChannel(), packet.GetSourcePort(), packet.GetSequence()) // must be explicitly changed relayerAddr = suite.chainB.SenderAccount.GetAddress() identifiedFee = types.NewIdentifiedPacketFee( - packetId, + packetID, types.Fee{ RecvFee: validCoins, AckFee: validCoins2, @@ -751,7 +751,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { []string{}, ) - err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) + err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedFee) suite.Require().NoError(err) // log original sender balance @@ -777,7 +777,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { relayerBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), relayerAddr, ibctesting.TestCoin.Denom)) if tc.expFeeDistributed { // there should no longer be a fee in escrow for this packet - found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetId) + found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) suite.Require().False(found) suite.Require().Equal(identifiedFee.Fee.TimeoutFee, relayerBalance) diff --git a/modules/apps/29-fee/keeper/escrow.go b/modules/apps/29-fee/keeper/escrow.go index 1d0aa60c74f..ec62156855b 100644 --- a/modules/apps/29-fee/keeper/escrow.go +++ b/modules/apps/29-fee/keeper/escrow.go @@ -7,11 +7,12 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" ) // EscrowPacketFee sends the packet fee to the 29-fee module account to hold in escrow -func (k Keeper) EscrowPacketFee(ctx sdk.Context, identifiedFee types.IdentifiedPacketFee) error { - if !k.IsFeeEnabled(ctx, identifiedFee.PacketId.PortId, identifiedFee.PacketId.ChannelId) { +func (k Keeper) EscrowPacketFee(ctx sdk.Context, packetID channeltypes.PacketId, identifiedFee types.IdentifiedPacketFee) error { + if !k.IsFeeEnabled(ctx, packetID.PortId, packetID.ChannelId) { // users may not escrow fees on this channel. Must send packets without a fee message return sdkerrors.Wrap(types.ErrFeeNotEnabled, "cannot escrow fee for packet") } @@ -32,12 +33,12 @@ func (k Keeper) EscrowPacketFee(ctx sdk.Context, identifiedFee types.IdentifiedP } packetFees := []types.IdentifiedPacketFee{identifiedFee} - if feesInEscrow, found := k.GetFeesInEscrow(ctx, identifiedFee.PacketId); found { + if feesInEscrow, found := k.GetFeesInEscrow(ctx, packetID); found { packetFees = append(packetFees, feesInEscrow.PacketFees...) } identifiedFees := types.NewIdentifiedPacketFees(packetFees) - k.SetFeesInEscrow(ctx, identifiedFee.PacketId, identifiedFees) + k.SetFeesInEscrow(ctx, packetID, identifiedFees) EmitIncentivizedPacket(ctx, identifiedFee) diff --git a/modules/apps/29-fee/keeper/escrow_test.go b/modules/apps/29-fee/keeper/escrow_test.go index dcb2bdbfbd3..fe582aa4335 100644 --- a/modules/apps/29-fee/keeper/escrow_test.go +++ b/modules/apps/29-fee/keeper/escrow_test.go @@ -16,7 +16,7 @@ func (suite *KeeperTestSuite) TestEscrowPacketFee() { ackFee sdk.Coins receiveFee sdk.Coins timeoutFee sdk.Coins - packetId channeltypes.PacketId + packetID channeltypes.PacketId ) testCases := []struct { @@ -35,18 +35,18 @@ func (suite *KeeperTestSuite) TestEscrowPacketFee() { TimeoutFee: timeoutFee, } - identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) + identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) feesInEscrow := types.IdentifiedPacketFees{ PacketFees: []types.IdentifiedPacketFee{identifiedPacketFee}, } - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetId, feesInEscrow) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, feesInEscrow) }, true, }, { "fee not enabled on this channel", func() { - packetId.ChannelId = "disabled_channel" + packetID.ChannelId = "disabled_channel" }, false, }, { @@ -84,7 +84,7 @@ func (suite *KeeperTestSuite) TestEscrowPacketFee() { receiveFee = defaultReceiveFee ackFee = defaultAckFee timeoutFee = defaultTimeoutFee - packetId = channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, uint64(1)) + packetID = channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, uint64(1)) tc.malleate() fee := types.Fee{ @@ -92,16 +92,16 @@ func (suite *KeeperTestSuite) TestEscrowPacketFee() { AckFee: ackFee, TimeoutFee: timeoutFee, } - identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) + identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) // refundAcc balance before escrow originalBal := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) // escrow the packet fee - err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) if tc.expPass { - feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetId) + feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetID) suite.Require().True(found) // check if the escrowed fee is set in state suite.Require().True(feesInEscrow.PacketFees[0].Fee.AckFee.IsEqual(fee.AckFee)) @@ -158,7 +158,7 @@ func (suite *KeeperTestSuite) TestDistributeFee() { reverseRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) forwardRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() - packetId := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, validSeq) + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, validSeq) fee := types.Fee{ RecvFee: defaultReceiveFee, AckFee: defaultAckFee, @@ -166,12 +166,12 @@ func (suite *KeeperTestSuite) TestDistributeFee() { } // escrow the packet fee & store the fee in state - identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) + identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) suite.Require().NoError(err) // escrow a second packet fee to test with multiple fees distributed - err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) suite.Require().NoError(err) tc.malleate() @@ -183,7 +183,7 @@ func (suite *KeeperTestSuite) TestDistributeFee() { if tc.expPass { // there should no longer be a fee in escrow for this packet - found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeeInEscrow(suite.chainA.GetContext(), packetId) + found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeeInEscrow(suite.chainA.GetContext(), packetID) suite.Require().False(found) // check if the reverse relayer is paid @@ -221,7 +221,7 @@ func (suite *KeeperTestSuite) TestDistributeTimeoutFee() { refundAcc := suite.chainA.SenderAccount.GetAddress() timeoutRelayer := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - packetId := channeltypes.NewPacketId( + packetID := channeltypes.NewPacketId( suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, 1, @@ -235,16 +235,16 @@ func (suite *KeeperTestSuite) TestDistributeTimeoutFee() { // escrow the packet fee & store the fee in state identifiedPacketFee := types.NewIdentifiedPacketFee( - packetId, + packetID, fee, refundAcc.String(), []string{}, ) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) suite.Require().NoError(err) // escrow a second packet fee to test with multiple fees distributed - err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) suite.Require().NoError(err) // refundAcc balance after escrow @@ -277,30 +277,30 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { prevBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), refundAcc) for i := 0; i < 5; i++ { - packetId := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, uint64(i)) + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, uint64(i)) fee := types.Fee{ RecvFee: defaultReceiveFee, AckFee: defaultAckFee, TimeoutFee: defaultTimeoutFee, } - identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) + identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) suite.Require().NoError(err) } // send a packet over a different channel to ensure this fee is not refunded - packetId := channeltypes.NewPacketId("channel-1", ibctesting.MockFeePort, 1) + packetID := channeltypes.NewPacketId("channel-1", ibctesting.MockFeePort, 1) fee := types.Fee{ RecvFee: defaultReceiveFee, AckFee: defaultAckFee, TimeoutFee: defaultTimeoutFee, } - identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) + identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, "channel-1") - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) suite.Require().NoError(err) // check that refunding all fees on channel-0 refunds all fees except for fee on channel-1 @@ -312,10 +312,10 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { suite.Require().Equal(prevBal, afterBal.Add(fee.RecvFee...).Add(fee.AckFee...).Add(fee.TimeoutFee...), "refund account not back to original balance after refunding all tokens") // create escrow and then change module account balance to cause error on refund - packetId = channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, uint64(6)) + packetID = channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, uint64(6)) - identifiedPacketFee = types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) - err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) + identifiedPacketFee = types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) + err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, identifiedPacketFee) suite.Require().NoError(err) suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, refundAcc, fee.TimeoutFee) diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index 3ef24d2c443..a87962c518b 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -37,14 +37,14 @@ func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) return nil, channeltypes.ErrSequenceSendNotFound } - packetId := channeltypes.NewPacketId( + packetID := channeltypes.NewPacketId( msg.SourceChannelId, msg.SourcePortId, sequence, ) - identifiedPacket := types.NewIdentifiedPacketFee(packetId, msg.Fee, msg.Signer, msg.Relayers) - if err := k.EscrowPacketFee(ctx, identifiedPacket); err != nil { + identifiedPacket := types.NewIdentifiedPacketFee(packetID, msg.Fee, msg.Signer, msg.Relayers) + if err := k.EscrowPacketFee(ctx, packetID, identifiedPacket); err != nil { return nil, err } @@ -57,7 +57,7 @@ func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) func (k Keeper) PayPacketFeeAsync(goCtx context.Context, msg *types.MsgPayPacketFeeAsync) (*types.MsgPayPacketFeeAsyncResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.EscrowPacketFee(ctx, msg.IdentifiedPacketFee); err != nil { + if err := k.EscrowPacketFee(ctx, msg.IdentifiedPacketFee.PacketId, msg.IdentifiedPacketFee); err != nil { return nil, err }