diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index ddeba3e5cb6..0fe35525dc0 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1041,7 +1041,8 @@ This Msg can be used to pay for a packet at a specified sequence (instead of the | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `identified_packet_fee` | [IdentifiedPacketFee](#ibc.applications.fee.v1.IdentifiedPacketFee) | | identified packet to pay fee for identified fee must contain the refund address which is also signer of this message | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | unique packet identifier | +| `packet_fee` | [PacketFee](#ibc.applications.fee.v1.PacketFee) | | packet fee for incentivization | diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go index a9f66a71007..d14c8313dca 100644 --- a/modules/apps/29-fee/client/cli/tx.go +++ b/modules/apps/29-fee/client/cli/tx.go @@ -83,9 +83,9 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { TimeoutFee: timeoutFee, } - identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, sender, relayers) + packetFee := types.NewPacketFee(fee, sender, relayers) + msg := types.NewMsgPayPacketFeeAsync(packetID, packetFee) - msg := types.NewMsgPayPacketFeeAsync(identifiedPacketFee) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index 2f0004be150..fdac1d27874 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -57,9 +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) - // TODO: Update MsgPayPacketFeeAsync to include PacketFee in favour of IdentifiedPacketFee - packetFee := types.NewPacketFee(msg.IdentifiedPacketFee.Fee, msg.IdentifiedPacketFee.RefundAddress, msg.IdentifiedPacketFee.Relayers) - if err := k.EscrowPacketFee(ctx, msg.IdentifiedPacketFee.PacketId, packetFee); err != nil { + if err := k.EscrowPacketFee(ctx, msg.PacketId, msg.PacketFee); err != nil { return nil, err } diff --git a/modules/apps/29-fee/keeper/msg_server_test.go b/modules/apps/29-fee/keeper/msg_server_test.go index 0a8ad4b7d06..c6dc2f90856 100644 --- a/modules/apps/29-fee/keeper/msg_server_test.go +++ b/modules/apps/29-fee/keeper/msg_server_test.go @@ -119,12 +119,12 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { seq, _ := suite.chainA.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceSend(ctxA, suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) // build fee - packetId := channeltypes.NewPacketId(channelID, suite.path.EndpointA.ChannelConfig.PortID, seq) - identifiedPacketFee := types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} + packetID := channeltypes.NewPacketId(channelID, suite.path.EndpointA.ChannelConfig.PortID, seq) + packetFee := types.NewPacketFee(fee, refundAcc.String(), nil) tc.malleate() - msg := types.NewMsgPayPacketFeeAsync(identifiedPacketFee) + msg := types.NewMsgPayPacketFeeAsync(packetID, packetFee) _, err := suite.chainA.SendMsgs(msg) if tc.expPass { diff --git a/modules/apps/29-fee/types/msgs.go b/modules/apps/29-fee/types/msgs.go index 50e6584e26b..2c0d8a52e32 100644 --- a/modules/apps/29-fee/types/msgs.go +++ b/modules/apps/29-fee/types/msgs.go @@ -118,22 +118,21 @@ func (msg MsgPayPacketFee) GetSignBytes() []byte { } // NewMsgPayPacketAsync creates a new instance of MsgPayPacketFee -func NewMsgPayPacketFeeAsync(identifiedPacketFee IdentifiedPacketFee) *MsgPayPacketFeeAsync { +func NewMsgPayPacketFeeAsync(packetID channeltypes.PacketId, packetFee PacketFee) *MsgPayPacketFeeAsync { return &MsgPayPacketFeeAsync{ - IdentifiedPacketFee: identifiedPacketFee, + PacketId: packetID, + PacketFee: packetFee, } } // ValidateBasic performs a basic check of the MsgPayPacketFeeAsync fields func (msg MsgPayPacketFeeAsync) ValidateBasic() error { - // signer check - _, err := sdk.AccAddressFromBech32(msg.IdentifiedPacketFee.RefundAddress) - if err != nil { - return sdkerrors.Wrap(err, "failed to convert msg.Signer into sdk.AccAddress") + if err := msg.PacketId.Validate(); err != nil { + return err } - if err = msg.IdentifiedPacketFee.Validate(); err != nil { - return sdkerrors.Wrap(err, "Invalid IdentifiedPacketFee") + if err := msg.PacketFee.Validate(); err != nil { + return err } return nil @@ -142,7 +141,7 @@ func (msg MsgPayPacketFeeAsync) ValidateBasic() error { // GetSigners implements sdk.Msg // The signer of the fee message must be the refund address func (msg MsgPayPacketFeeAsync) GetSigners() []sdk.AccAddress { - signer, err := sdk.AccAddressFromBech32(msg.IdentifiedPacketFee.RefundAddress) + signer, err := sdk.AccAddressFromBech32(msg.PacketFee.RefundAddress) if err != nil { panic(err) } diff --git a/modules/apps/29-fee/types/msgs_test.go b/modules/apps/29-fee/types/msgs_test.go index c4ee1a477f1..6ded61d407f 100644 --- a/modules/apps/29-fee/types/msgs_test.go +++ b/modules/apps/29-fee/types/msgs_test.go @@ -319,9 +319,10 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { tc.malleate() fee = Fee{receiveFee, ackFee, timeoutFee} - packetId := channeltypes.NewPacketId(channelID, portID, seq) - identifiedPacketFee := IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: signer, Relayers: relayers} - msg := NewMsgPayPacketFeeAsync(identifiedPacketFee) + packetID := channeltypes.NewPacketId(channelID, portID, seq) + packetFee := NewPacketFee(fee, signer, relayers) + + msg := NewMsgPayPacketFeeAsync(packetID, packetFee) err := msg.ValidateBasic() @@ -335,20 +336,15 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { // TestRegisterCounterpartyAddressGetSigners tests GetSigners func TestPayPacketFeeAsyncGetSigners(t *testing.T) { - addr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - // build message - channelID := validChannelID - portID := validPortID - fee := Fee{validCoins, validCoins, validCoins} - seq := uint64(1) - packetId := channeltypes.NewPacketId(channelID, portID, seq) - identifiedPacketFee := IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: addr.String(), Relayers: nil} - msg := NewMsgPayPacketFeeAsync(identifiedPacketFee) + refundAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + fee := NewFee(validCoins, validCoins, validCoins) - // GetSigners - res := msg.GetSigners() + packetID := channeltypes.NewPacketId(validChannelID, validPortID, 1) + packetFee := NewPacketFee(fee, refundAddr.String(), nil) - require.Equal(t, []sdk.AccAddress{addr}, res) + msg := NewMsgPayPacketFeeAsync(packetID, packetFee) + + require.Equal(t, []sdk.AccAddress{refundAddr}, msg.GetSigners()) } // TestMsgPayPacketFeeAsyncRoute tests Route for MsgPayPacketFeeAsync @@ -360,9 +356,10 @@ func TestMsgPayPacketFeeAsyncRoute(t *testing.T) { portID := validPortID fee := Fee{validCoins, validCoins, validCoins} seq := uint64(1) - packetId := channeltypes.NewPacketId(channelID, portID, seq) - identifiedPacketFee := IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: addr.String(), Relayers: nil} - msg := NewMsgPayPacketFeeAsync(identifiedPacketFee) + packetID := channeltypes.NewPacketId(channelID, portID, seq) + packetFee := NewPacketFee(fee, addr.String(), nil) + + msg := NewMsgPayPacketFeeAsync(packetID, packetFee) require.Equal(t, RouterKey, msg.Route()) } @@ -376,9 +373,10 @@ func TestMsgPayPacketFeeAsyncType(t *testing.T) { portID := validPortID fee := Fee{validCoins, validCoins, validCoins} seq := uint64(1) - packetId := channeltypes.NewPacketId(channelID, portID, seq) - identifiedPacketFee := IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: addr.String(), Relayers: nil} - msg := NewMsgPayPacketFeeAsync(identifiedPacketFee) + packetID := channeltypes.NewPacketId(channelID, portID, seq) + packetFee := NewPacketFee(fee, addr.String(), nil) + + msg := NewMsgPayPacketFeeAsync(packetID, packetFee) require.Equal(t, "payPacketFeeAsync", msg.Type()) } @@ -392,9 +390,10 @@ func TestMsgPayPacketFeeAsyncGetSignBytes(t *testing.T) { portID := validPortID fee := Fee{validCoins, validCoins, validCoins} seq := uint64(1) - packetId := channeltypes.NewPacketId(channelID, portID, seq) - identifiedPacketFee := IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: addr.String(), Relayers: nil} - msg := NewMsgPayPacketFeeAsync(identifiedPacketFee) + packetID := channeltypes.NewPacketId(channelID, portID, seq) + packetFee := NewPacketFee(fee, addr.String(), nil) + + msg := NewMsgPayPacketFeeAsync(packetID, packetFee) require.NotPanics(t, func() { _ = msg.GetSignBytes() diff --git a/modules/apps/29-fee/types/tx.pb.go b/modules/apps/29-fee/types/tx.pb.go index a7f8e1d3bee..c30331992dd 100644 --- a/modules/apps/29-fee/types/tx.pb.go +++ b/modules/apps/29-fee/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -194,9 +195,10 @@ var xxx_messageInfo_MsgPayPacketFeeResponse proto.InternalMessageInfo // MsgPayPacketFeeAsync defines the request type PayPacketFeeAsync RPC // This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) type MsgPayPacketFeeAsync struct { - // identified packet to pay fee for - // identified fee must contain the refund address which is also signer of this message - IdentifiedPacketFee IdentifiedPacketFee `protobuf:"bytes,1,opt,name=identified_packet_fee,json=identifiedPacketFee,proto3" json:"identified_packet_fee" yaml:"identified_packet_fee"` + // unique packet identifier + PacketId types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id" yaml:"packet_id"` + // packet fee for incentivization + PacketFee PacketFee `protobuf:"bytes,2,opt,name=packet_fee,json=packetFee,proto3" json:"packet_fee" yaml:"packet_fee"` } func (m *MsgPayPacketFeeAsync) Reset() { *m = MsgPayPacketFeeAsync{} } @@ -281,45 +283,47 @@ func init() { func init() { proto.RegisterFile("ibc/applications/fee/v1/tx.proto", fileDescriptor_05c93128649f1b96) } var fileDescriptor_05c93128649f1b96 = []byte{ - // 594 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4d, 0x4f, 0xdb, 0x4c, - 0x10, 0xc7, 0x6d, 0xc2, 0xc3, 0x03, 0x5b, 0x54, 0x84, 0x81, 0x62, 0x4c, 0x64, 0x53, 0xab, 0xaa, - 0x72, 0x28, 0x76, 0x79, 0x53, 0x55, 0x2e, 0x88, 0x20, 0xa1, 0x72, 0x40, 0x8d, 0x7c, 0xec, 0x25, - 0x72, 0xd6, 0x13, 0xb3, 0x6d, 0xe2, 0xb5, 0xbc, 0x9b, 0xa8, 0xfe, 0x02, 0xa8, 0x47, 0x6e, 0xbd, - 0x72, 0xed, 0x37, 0xe1, 0x54, 0x71, 0xec, 0xc9, 0xaa, 0x92, 0x4b, 0xcf, 0xf9, 0x04, 0x95, 0xed, - 0xd8, 0x75, 0xc8, 0x8b, 0x68, 0x6f, 0x3b, 0x3b, 0xbf, 0xf9, 0xef, 0xcc, 0x7f, 0x57, 0x8b, 0x76, - 0x48, 0x03, 0x9b, 0xb6, 0xef, 0xb7, 0x08, 0xb6, 0x39, 0xa1, 0x1e, 0x33, 0x9b, 0x00, 0x66, 0x77, - 0xcf, 0xe4, 0x9f, 0x0d, 0x3f, 0xa0, 0x9c, 0x4a, 0x9b, 0xa4, 0x81, 0x8d, 0x22, 0x61, 0x34, 0x01, - 0x8c, 0xee, 0x9e, 0xb2, 0xee, 0x52, 0x97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0x0d, 0x22, 0x6d, 0x23, - 0xed, 0x7b, 0x34, 0xaf, 0x5b, 0xcb, 0xe9, 0x46, 0x8d, 0x06, 0xfc, 0xc2, 0x91, 0xde, 0xa1, 0xd5, - 0x21, 0x30, 0x36, 0x7b, 0x79, 0x10, 0x69, 0xf2, 0x88, 0x46, 0xd1, 0x82, 0x95, 0x74, 0xef, 0x2c, - 0x33, 0x42, 0x7a, 0x86, 0x16, 0x18, 0x71, 0x3d, 0x08, 0xe4, 0xf9, 0xe4, 0xae, 0x86, 0x91, 0xa4, - 0xa0, 0xc5, 0x00, 0x5a, 0x76, 0x08, 0x01, 0x93, 0xff, 0xdb, 0x29, 0x55, 0x96, 0xac, 0x3c, 0x2e, - 0x98, 0xb7, 0x85, 0x36, 0x1f, 0x38, 0x92, 0xbb, 0xf5, 0x4d, 0x44, 0xeb, 0x0f, 0x72, 0xa7, 0x2c, - 0xf4, 0xb0, 0x74, 0x2d, 0xa2, 0x0d, 0xe2, 0x80, 0xc7, 0x49, 0x93, 0x80, 0x53, 0xf7, 0x93, 0x6c, - 0xfd, 0x8f, 0x8b, 0xaf, 0xa6, 0xba, 0x78, 0x91, 0x57, 0xe5, 0x92, 0xd5, 0x17, 0xb1, 0xab, 0x83, - 0x48, 0x2b, 0xa7, 0x23, 0x4f, 0x14, 0xd6, 0xad, 0x35, 0x32, 0x5e, 0x5a, 0x18, 0x43, 0x45, 0xe5, - 0x49, 0xad, 0x66, 0xb3, 0xec, 0x5f, 0x97, 0x50, 0xe9, 0x92, 0xb9, 0xd2, 0x57, 0x11, 0x6d, 0xcf, - 0x7a, 0xf9, 0x6f, 0xa6, 0xb6, 0x3e, 0xfb, 0x89, 0x29, 0x27, 0xff, 0x58, 0x98, 0x75, 0x28, 0x7d, - 0x44, 0xcb, 0x23, 0xef, 0xb2, 0x32, 0x4b, 0xb0, 0x48, 0x2a, 0xaf, 0x1f, 0x4b, 0xe6, 0x67, 0x85, - 0x68, 0x75, 0xfc, 0x56, 0x77, 0x1f, 0x2b, 0x93, 0xe0, 0xca, 0xd1, 0x5f, 0xe1, 0xd9, 0xd1, 0xd5, - 0xf7, 0x77, 0x3d, 0x55, 0xbc, 0xef, 0xa9, 0xe2, 0xcf, 0x9e, 0x2a, 0xde, 0xf4, 0x55, 0xe1, 0xbe, - 0xaf, 0x0a, 0x3f, 0xfa, 0xaa, 0xf0, 0xe1, 0xc8, 0x25, 0xfc, 0xaa, 0xd3, 0x30, 0x30, 0x6d, 0x9b, - 0x98, 0xb2, 0x36, 0x65, 0x26, 0x69, 0xe0, 0x5d, 0x97, 0x9a, 0xdd, 0x03, 0xb3, 0x4d, 0x9d, 0x4e, - 0x0b, 0x58, 0xfc, 0xb5, 0x31, 0x73, 0xff, 0xed, 0x6e, 0xfc, 0xab, 0xf1, 0xd0, 0x07, 0xd6, 0x58, - 0x48, 0x7e, 0xb5, 0x83, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x27, 0xb3, 0x4f, 0x4b, 0x05, - 0x00, 0x00, + // 630 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4d, 0x4f, 0xdb, 0x40, + 0x10, 0x8d, 0x09, 0xa5, 0x64, 0x8b, 0x4a, 0xb3, 0x85, 0x62, 0x0c, 0xb5, 0xa9, 0x0f, 0x55, 0x2e, + 0xd8, 0xe5, 0x4b, 0x55, 0xb9, 0x20, 0x82, 0x84, 0xca, 0x01, 0x15, 0x59, 0x3d, 0x55, 0x95, 0x90, + 0xb3, 0x9e, 0x18, 0xb7, 0x89, 0xd7, 0xda, 0x75, 0xa2, 0xfa, 0x0f, 0x54, 0x3d, 0x72, 0xeb, 0x95, + 0x9f, 0xc3, 0xa9, 0xe2, 0xd0, 0x43, 0x4f, 0x56, 0x05, 0x97, 0x9e, 0xf3, 0x0b, 0xaa, 0xf5, 0x97, + 0x1c, 0x48, 0x22, 0xda, 0x9b, 0x77, 0xe6, 0xcd, 0xdb, 0x37, 0x6f, 0xc6, 0x8b, 0xd6, 0xbc, 0x16, + 0x31, 0xed, 0x20, 0xe8, 0x78, 0xc4, 0x0e, 0x3d, 0xea, 0x73, 0xb3, 0x0d, 0x60, 0xf6, 0x37, 0xcc, + 0xf0, 0x8b, 0x11, 0x30, 0x1a, 0x52, 0xbc, 0xe4, 0xb5, 0x88, 0x51, 0x46, 0x18, 0x6d, 0x00, 0xa3, + 0xbf, 0xa1, 0x2c, 0xb8, 0xd4, 0xa5, 0x09, 0xc6, 0x14, 0x5f, 0x29, 0x5c, 0x79, 0x31, 0x8e, 0x50, + 0x54, 0x95, 0x20, 0x84, 0x32, 0x30, 0xc9, 0x99, 0xed, 0xfb, 0xd0, 0x11, 0xe9, 0xec, 0x33, 0x85, + 0xe8, 0x3f, 0x24, 0xa4, 0x1e, 0x73, 0xd7, 0x02, 0xd7, 0xe3, 0x21, 0xb0, 0x03, 0xda, 0xf3, 0x43, + 0x60, 0x81, 0xcd, 0xc2, 0x68, 0xdf, 0x71, 0x18, 0x70, 0x8e, 0x65, 0xf4, 0xd0, 0x4e, 0x3f, 0x65, + 0x69, 0x4d, 0x6a, 0xd4, 0xac, 0xfc, 0x88, 0x2d, 0xb4, 0x40, 0x4a, 0x05, 0xa7, 0x39, 0x6c, 0x4a, + 0xc0, 0x9a, 0xda, 0x20, 0xd6, 0x56, 0x22, 0xbb, 0xdb, 0xd9, 0xd5, 0x47, 0xa1, 0x74, 0xeb, 0x29, + 0x19, 0x71, 0xdb, 0x36, 0x42, 0x99, 0xc2, 0x53, 0xcf, 0x91, 0xab, 0x09, 0xd3, 0xe2, 0x20, 0xd6, + 0xea, 0x19, 0x53, 0x91, 0xd3, 0xad, 0x5a, 0x76, 0x38, 0x72, 0x76, 0x67, 0xbf, 0x5d, 0x68, 0x95, + 0x3f, 0x17, 0x5a, 0x45, 0x6f, 0xa0, 0x97, 0x93, 0xfb, 0xb1, 0x80, 0x07, 0xd4, 0x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, 0x50, 0x16, 0x17, 0xf3, 0x98, 0x4a, 0x68, 0xf5, 0xb1, 0xf3, 0x28, 0x24, + 0x35, 0x97, 0x33, 0xee, 0xfa, 0x10, 0x77, 0x1b, 0x40, 0xb7, 0x32, 0x99, 0x87, 0x00, 0xa5, 0x8e, + 0x55, 0xb4, 0x3a, 0xaa, 0xab, 0xbc, 0xed, 0xcd, 0xaf, 0x55, 0x54, 0x3d, 0xe6, 0x2e, 0xfe, 0x2e, + 0xa1, 0x95, 0x49, 0x3f, 0xc9, 0xeb, 0xb1, 0xda, 0x26, 0x6f, 0xa3, 0xb2, 0xf7, 0x9f, 0x85, 0xb9, + 0x42, 0xfc, 0x09, 0xcd, 0x0d, 0xad, 0x70, 0x63, 0x12, 0x61, 0x19, 0xa9, 0xbc, 0xba, 0x2f, 0xb2, + 0xb8, 0x2b, 0x42, 0xf5, 0xbb, 0x0b, 0xb0, 0x7e, 0x5f, 0x9a, 0x04, 0xae, 0xec, 0xfc, 0x13, 0x3c, + 0xbf, 0xba, 0xf9, 0xee, 0xf2, 0x5a, 0x95, 0xae, 0xae, 0x55, 0xe9, 0xf7, 0xb5, 0x2a, 0x9d, 0xdf, + 0xa8, 0x95, 0xab, 0x1b, 0xb5, 0xf2, 0xeb, 0x46, 0xad, 0x7c, 0xd8, 0x71, 0xbd, 0xf0, 0xac, 0xd7, + 0x32, 0x08, 0xed, 0x9a, 0x84, 0xf2, 0x2e, 0xe5, 0xa6, 0xd7, 0x22, 0xeb, 0x2e, 0x35, 0xfb, 0x5b, + 0x66, 0x97, 0x3a, 0xbd, 0x0e, 0x70, 0xf1, 0x50, 0x72, 0x73, 0xf3, 0xcd, 0xba, 0x78, 0x23, 0xc3, + 0x28, 0x00, 0xde, 0x9a, 0x49, 0x1e, 0xc0, 0xad, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xf7, + 0x58, 0xab, 0x99, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -670,7 +674,17 @@ func (m *MsgPayPacketFeeAsync) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.IdentifiedPacketFee.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.PacketFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -790,7 +804,9 @@ func (m *MsgPayPacketFeeAsync) Size() (n int) { } var l int _ = l - l = m.IdentifiedPacketFee.Size() + l = m.PacketId.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.PacketFee.Size() n += 1 + l + sovTx(uint64(l)) return n } @@ -1298,7 +1314,40 @@ func (m *MsgPayPacketFeeAsync) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdentifiedPacketFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketFee", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1325,7 +1374,7 @@ func (m *MsgPayPacketFeeAsync) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.IdentifiedPacketFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.PacketFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/proto/ibc/applications/fee/v1/tx.proto b/proto/ibc/applications/fee/v1/tx.proto index 8209e14d531..ec2f2cc4f38 100644 --- a/proto/ibc/applications/fee/v1/tx.proto +++ b/proto/ibc/applications/fee/v1/tx.proto @@ -6,6 +6,7 @@ option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; import "ibc/applications/fee/v1/fee.proto"; +import "ibc/core/channel/v1/channel.proto"; // Msg defines the ibc/fee Msg service. service Msg { @@ -64,10 +65,11 @@ message MsgPayPacketFeeAsync { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // identified packet to pay fee for - // identified fee must contain the refund address which is also signer of this message - ibc.applications.fee.v1.IdentifiedPacketFee identified_packet_fee = 1 - [(gogoproto.moretags) = "yaml:\"identified_packet_fee\"", (gogoproto.nullable) = false]; + // unique packet identifier + ibc.core.channel.v1.PacketId packet_id = 1 + [(gogoproto.moretags) = "yaml:\"packet_id\"", (gogoproto.nullable) = false]; + // packet fee for incentivization + PacketFee packet_fee = 2 [(gogoproto.moretags) = "yaml:\"packet_fee\"", (gogoproto.nullable) = false]; } // MsgPayPacketFeeAsyncResponse defines the response type for Msg/PayPacketFeeAsync