diff --git a/modules/apps/transfer/keeper/relay_forwarding_test.go b/modules/apps/transfer/keeper/relay_forwarding_test.go index 8e691ad03f4..4647e87b554 100644 --- a/modules/apps/transfer/keeper/relay_forwarding_test.go +++ b/modules/apps/transfer/keeper/relay_forwarding_test.go @@ -29,7 +29,7 @@ func (suite *KeeperTestSuite) TestPathForwarding() { sender := suite.chainA.SenderAccounts[0].SenderAccount receiver := suite.chainA.SenderAccounts[1].SenderAccount forwardingPath := types.ForwardingInfo{ - Hops: []*types.Hop{ + Hops: []types.Hop{ { PortId: path2.EndpointA.ChannelConfig.PortID, ChannelId: path2.EndpointA.ChannelID, @@ -91,7 +91,7 @@ func (suite *KeeperTestSuite) TestEscrowsAreSetAfterForwarding() { sender := suite.chainA.SenderAccounts[0].SenderAccount receiver := suite.chainA.SenderAccounts[1].SenderAccount forwardingPath := types.ForwardingInfo{ - Hops: []*types.Hop{ + Hops: []types.Hop{ { PortId: path2.EndpointB.ChannelConfig.PortID, ChannelId: path2.EndpointB.ChannelID, @@ -174,7 +174,7 @@ func (suite *KeeperTestSuite) TestHappyPathForwarding() { sender := suite.chainA.SenderAccounts[0].SenderAccount receiver := suite.chainA.SenderAccounts[1].SenderAccount forwardingPath := types.ForwardingInfo{ - Hops: []*types.Hop{ + Hops: []types.Hop{ { PortId: path2.EndpointB.ChannelConfig.PortID, ChannelId: path2.EndpointB.ChannelID, @@ -282,7 +282,7 @@ func (suite *KeeperTestSuite) TestSimplifiedHappyPathForwarding() { sender := suite.chainA.SenderAccounts[0].SenderAccount receiver := suite.chainA.SenderAccounts[1].SenderAccount forwardingPath := types.ForwardingInfo{ - Hops: []*types.Hop{ + Hops: []types.Hop{ { PortId: path2.EndpointB.ChannelConfig.PortID, ChannelId: path2.EndpointB.ChannelID, @@ -476,7 +476,7 @@ func (suite *KeeperTestSuite) TestAcknowledgementFailureScenario5Forwarding() { receiver = suite.chainA.SenderAccounts[0].SenderAccount // Receiver is the A chain account forwardingPath := types.ForwardingInfo{ - Hops: []*types.Hop{ + Hops: []types.Hop{ { PortId: path1.EndpointB.ChannelConfig.PortID, ChannelId: path1.EndpointB.ChannelID, diff --git a/modules/apps/transfer/types/errors.go b/modules/apps/transfer/types/errors.go index 2a7d90c0fbe..13f87f17a77 100644 --- a/modules/apps/transfer/types/errors.go +++ b/modules/apps/transfer/types/errors.go @@ -16,4 +16,5 @@ var ( ErrMaxTransferChannels = errorsmod.Register(ModuleName, 9, "max transfer channels") ErrInvalidAuthorization = errorsmod.Register(ModuleName, 10, "invalid transfer authorization") ErrInvalidMemo = errorsmod.Register(ModuleName, 11, "invalid memo") + ErrInvalidForwardingInfo = errorsmod.Register(ModuleName, 12, "invalid forwarding info") ) diff --git a/modules/apps/transfer/types/forwarding_info.go b/modules/apps/transfer/types/forwarding_info.go new file mode 100644 index 00000000000..167ca89bff0 --- /dev/null +++ b/modules/apps/transfer/types/forwarding_info.go @@ -0,0 +1,39 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" +) + +const MaximumNumberOfForwardingHops = 64 + +// NewForwardingInfo creates a new ForwardingInfo instance given a memo and a variable number of hops. +func NewForwardingInfo(memo string, hops ...Hop) *ForwardingInfo { + return &ForwardingInfo{ + Memo: memo, + Hops: hops, + } +} + +// Validate performs a basic validation of the ForwardingInfo fields. +func (fi ForwardingInfo) Validate() error { + if len(fi.Hops) > MaximumNumberOfForwardingHops { + return errorsmod.Wrapf(ErrInvalidForwardingInfo, "number of hops in forwarding path cannot exceed %d", MaximumNumberOfForwardingHops) + } + + for _, hop := range fi.Hops { + if err := host.PortIdentifierValidator(hop.PortId); err != nil { + return errorsmod.Wrapf(err, "invalid source port ID %s", hop.PortId) + } + if err := host.ChannelIdentifierValidator(hop.ChannelId); err != nil { + return errorsmod.Wrapf(err, "invalid source channel ID %s", hop.ChannelId) + } + } + + if len(fi.Memo) > MaximumMemoLength { + return errorsmod.Wrapf(ErrInvalidMemo, "memo length cannot exceed %d", MaximumMemoLength) + } + + return nil +} diff --git a/modules/apps/transfer/types/forwarding_info_test.go b/modules/apps/transfer/types/forwarding_info_test.go new file mode 100644 index 00000000000..7be1fadeeaa --- /dev/null +++ b/modules/apps/transfer/types/forwarding_info_test.go @@ -0,0 +1,151 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + ibctesting "github.com/cosmos/ibc-go/v8/testing" +) + +var validHop = types.Hop{ + PortId: types.PortID, + ChannelId: ibctesting.FirstChannelID, +} + +func TestForwardingInfo_Validate(t *testing.T) { + tests := []struct { + name string + forwardingInfo *types.ForwardingInfo + expError error + }{ + { + "valid forwarding info with no hops", + types.NewForwardingInfo(""), + nil, + }, + { + "valid forwarding info with hops", + types.NewForwardingInfo("", validHop), + nil, + }, + { + "valid forwarding info with memo", + types.NewForwardingInfo(testMemo1, validHop, validHop), + nil, + }, + { + "valid forwarding info with max hops", + types.NewForwardingInfo("", generateHops(types.MaximumNumberOfForwardingHops)...), + nil, + }, + { + "valid forwarding info with max memo length", + types.NewForwardingInfo(ibctesting.GenerateString(types.MaximumMemoLength), validHop), + nil, + }, + { + "invalid forwarding info with too many hops", + types.NewForwardingInfo("", generateHops(types.MaximumNumberOfForwardingHops+1)...), + types.ErrInvalidForwardingInfo, + }, + { + "invalid forwarding info with too long memo", + types.NewForwardingInfo(ibctesting.GenerateString(types.MaximumMemoLength+1), validHop), + types.ErrInvalidMemo, + }, + { + "invalid forwarding info with too short hop port ID", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: invalidShortPort, + ChannelId: ibctesting.FirstChannelID, + }, + ), + host.ErrInvalidID, + }, + { + "invalid forwarding info with too long hop port ID", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: invalidLongPort, + ChannelId: ibctesting.FirstChannelID, + }, + ), + host.ErrInvalidID, + }, + { + "invalid forwarding info with non-alpha hop port ID", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: invalidPort, + ChannelId: ibctesting.FirstChannelID, + }, + ), + host.ErrInvalidID, + }, + { + "invalid forwarding info with too long hop channel ID", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: types.PortID, + ChannelId: invalidLongChannel, + }, + ), + host.ErrInvalidID, + }, + { + "invalid forwarding info with too short hop channel ID", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: types.PortID, + ChannelId: invalidShortChannel, + }, + ), + host.ErrInvalidID, + }, + { + "invalid forwarding info with non-alpha hop channel ID", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: types.PortID, + ChannelId: invalidChannel, + }, + ), + host.ErrInvalidID, + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + tc := tc + + err := tc.forwardingInfo.Validate() + + expPass := tc.expError == nil + if expPass { + require.NoError(t, err) + } else { + require.ErrorIs(t, err, tc.expError) + } + }) + } +} + +func generateHops(n int) []types.Hop { + hops := make([]types.Hop, n) + for i := 0; i < n; i++ { + hops[i] = types.Hop{ + PortId: types.PortID, + ChannelId: ibctesting.FirstChannelID, + } + } + return hops +} diff --git a/modules/apps/transfer/types/msgs.go b/modules/apps/transfer/types/msgs.go index 3c10f3b5779..a50a6e5719a 100644 --- a/modules/apps/transfer/types/msgs.go +++ b/modules/apps/transfer/types/msgs.go @@ -102,6 +102,17 @@ func (msg MsgTransfer) ValidateBasic() error { return errorsmod.Wrapf(ErrInvalidMemo, "memo must not exceed %d bytes", MaximumMemoLength) } + if msg.ForwardingPath != nil { + if err := msg.ForwardingPath.Validate(); err != nil { + return err + } + + // We cannot have non-empty memo and non-empty forwarding path hops at the same time. + if len(msg.ForwardingPath.Hops) > 0 && msg.Memo != "" { + return errorsmod.Wrapf(ErrInvalidMemo, "memo must be empty if forwarding path hops is not empty: %s, %s", msg.Memo, msg.ForwardingPath.Hops) + } + } + for _, coin := range msg.GetCoins() { if err := validateIBCCoin(coin); err != nil { return errorsmod.Wrapf(ibcerrors.ErrInvalidCoins, "%s: %s", err.Error(), coin.String()) diff --git a/modules/apps/transfer/types/msgs_test.go b/modules/apps/transfer/types/msgs_test.go index 2f153eacca0..447fd619a36 100644 --- a/modules/apps/transfer/types/msgs_test.go +++ b/modules/apps/transfer/types/msgs_test.go @@ -79,19 +79,24 @@ func TestMsgTransferValidation(t *testing.T) { {"multidenom: zero coins", types.NewMsgTransfer(validPort, validChannel, zeroCoins, sender, receiver, timeoutHeight, 0, "", nil), ibcerrors.ErrInvalidCoins}, {"multidenom: too many coins", types.NewMsgTransfer(validPort, validChannel, make([]sdk.Coin, types.MaximumTokensLength+1), sender, receiver, timeoutHeight, 0, "", nil), ibcerrors.ErrInvalidCoins}, {"multidenom: both token and tokens are set", &types.MsgTransfer{validPort, validChannel, coin, sender, receiver, timeoutHeight, 0, "", coins, nil}, ibcerrors.ErrInvalidCoins}, + {"memo must be empty if forwarding path hops is not empty", types.NewMsgTransfer(validPort, validChannel, coins, sender, receiver, timeoutHeight, 0, "memo", types.NewForwardingInfo("", validHop)), types.ErrInvalidMemo}, + {"invalid forwarding info port", types.NewMsgTransfer(validPort, validChannel, coins, sender, receiver, timeoutHeight, 0, "", types.NewForwardingInfo("", types.Hop{PortId: invalidPort, ChannelId: validChannel})), host.ErrInvalidID}, + {"invalid forwarding info channel", types.NewMsgTransfer(validPort, validChannel, coins, sender, receiver, timeoutHeight, 0, "", types.NewForwardingInfo("", types.Hop{PortId: validPort, ChannelId: invalidChannel})), host.ErrInvalidID}, + {"invalid forwarding info too many hops", types.NewMsgTransfer(validPort, validChannel, coins, sender, receiver, timeoutHeight, 0, "", types.NewForwardingInfo("", generateHops(types.MaximumNumberOfForwardingHops+1)...)), types.ErrInvalidForwardingInfo}, + {"invalid forwarding info too long memo", types.NewMsgTransfer(validPort, validChannel, coins, sender, receiver, timeoutHeight, 0, "", types.NewForwardingInfo(ibctesting.GenerateString(types.MaximumMemoLength+1), validHop)), types.ErrInvalidMemo}, } for _, tc := range testCases { - tc := tc - - err := tc.msg.ValidateBasic() - - expPass := tc.expError == nil - if expPass { - require.NoError(t, err) - } else { - require.ErrorIs(t, err, tc.expError) - } + t.Run(tc.name, func(t *testing.T) { + err := tc.msg.ValidateBasic() + + expPass := tc.expError == nil + if expPass { + require.NoError(t, err) + } else { + require.ErrorIs(t, err, tc.expError) + } + }) } } @@ -119,16 +124,16 @@ func TestMsgUpdateParamsValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc - - err := tc.msg.ValidateBasic() - - expPass := tc.expError == nil - if expPass { - require.NoError(t, err) - } else { - require.ErrorIs(t, err, tc.expError) - } + t.Run(tc.name, func(t *testing.T) { + err := tc.msg.ValidateBasic() + + expPass := tc.expError == nil + if expPass { + require.NoError(t, err) + } else { + require.ErrorIs(t, err, tc.expError) + } + }) } } @@ -144,21 +149,21 @@ func TestMsgUpdateParamsGetSigners(t *testing.T) { } for _, tc := range testCases { - tc := tc - - msg := types.MsgUpdateParams{ - Signer: tc.address.String(), - Params: types.DefaultParams(), - } - - encodingCfg := moduletestutil.MakeTestEncodingConfig(transfer.AppModuleBasic{}) - signers, _, err := encodingCfg.Codec.GetMsgV1Signers(&msg) - - if tc.expPass { - require.NoError(t, err) - require.Equal(t, tc.address.Bytes(), signers[0]) - } else { - require.Error(t, err) - } + t.Run(tc.name, func(t *testing.T) { + msg := types.MsgUpdateParams{ + Signer: tc.address.String(), + Params: types.DefaultParams(), + } + + encodingCfg := moduletestutil.MakeTestEncodingConfig(transfer.AppModuleBasic{}) + signers, _, err := encodingCfg.Codec.GetMsgV1Signers(&msg) + + if tc.expPass { + require.NoError(t, err) + require.Equal(t, tc.address.Bytes(), signers[0]) + } else { + require.Error(t, err) + } + }) } } diff --git a/modules/apps/transfer/types/packet.go b/modules/apps/transfer/types/packet.go index fcdb431695e..e4f5179bd78 100644 --- a/modules/apps/transfer/types/packet.go +++ b/modules/apps/transfer/types/packet.go @@ -140,9 +140,15 @@ func (ftpd FungibleTokenPacketDataV2) ValidateBasic() error { return errorsmod.Wrapf(ErrInvalidMemo, "memo must not exceed %d bytes", MaximumMemoLength) } - // We cannot have non-empty memo and non-empty forwarding path hops at the same time. - if ftpd.ForwardingPath != nil && len(ftpd.ForwardingPath.Hops) > 0 && ftpd.Memo != "" { - return errorsmod.Wrapf(ErrInvalidMemo, "memo must be empty if forwarding path hops is not empty: %s, %s", ftpd.Memo, ftpd.ForwardingPath.Hops) + if ftpd.ForwardingPath != nil { + if err := ftpd.ForwardingPath.Validate(); err != nil { + return err + } + + // We cannot have non-empty memo and non-empty forwarding path hops at the same time. + if len(ftpd.ForwardingPath.Hops) > 0 && ftpd.Memo != "" { + return errorsmod.Wrapf(ErrInvalidMemo, "memo must be empty if forwarding path hops is not empty: %s, %s", ftpd.Memo, ftpd.ForwardingPath.Hops) + } } return nil diff --git a/modules/apps/transfer/types/packet_test.go b/modules/apps/transfer/types/packet_test.go index 9997751b69e..509435f5323 100644 --- a/modules/apps/transfer/types/packet_test.go +++ b/modules/apps/transfer/types/packet_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" ibcerrors "github.com/cosmos/ibc-go/v8/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v8/testing" ) @@ -223,25 +224,30 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, sender, receiver, "", - &types.ForwardingInfo{ - Hops: []*types.Hop{ - { - PortId: "transfer", - ChannelId: "channel-1", - }, + types.NewForwardingInfo("", validHop, validHop), + ), + nil, + }, + { + "success: valid packet with forwarding path hops with memo", + types.NewFungibleTokenPacketDataV2( + []types.Token{ + { + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), + Amount: amount, }, - Memo: "", }, + sender, + receiver, + "", + types.NewForwardingInfo("memo", validHop), ), nil, }, @@ -389,25 +395,90 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, sender, receiver, "memo", - &types.ForwardingInfo{ - Hops: []*types.Hop{ - { - PortId: "transfer", - ChannelId: "channel-1", - }, + types.NewForwardingInfo("", validHop), + ), + types.ErrInvalidMemo, + }, + { + "failure: invalid forwarding path port ID", + types.NewFungibleTokenPacketDataV2( + []types.Token{ + { + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), + Amount: amount, }, - Memo: "", }, + sender, + receiver, + "", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: invalidPort, + ChannelId: "channel-1", + }, + ), + ), + host.ErrInvalidID, + }, + { + "failure: invalid forwarding path channel ID", + types.NewFungibleTokenPacketDataV2( + []types.Token{ + { + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), + Amount: amount, + }, + }, + sender, + receiver, + "", + types.NewForwardingInfo( + "", + types.Hop{ + PortId: "transfer", + ChannelId: invalidChannel, + }, + ), + ), + host.ErrInvalidID, + }, + { + "failure: invalid forwarding path too many hops", + types.NewFungibleTokenPacketDataV2( + []types.Token{ + { + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), + Amount: amount, + }, + }, + sender, + receiver, + "", + types.NewForwardingInfo("", generateHops(types.MaximumNumberOfForwardingHops+1)...), + ), + types.ErrInvalidForwardingInfo, + }, + { + "failure: invalid forwarding path too long memo", + types.NewFungibleTokenPacketDataV2( + []types.Token{ + { + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), + Amount: amount, + }, + }, + sender, + receiver, + "", + types.NewForwardingInfo(ibctesting.GenerateString(types.MaximumMemoLength+1), validHop), ), types.ErrInvalidMemo, }, diff --git a/modules/apps/transfer/types/transfer.pb.go b/modules/apps/transfer/types/transfer.pb.go index 75ee2e183d4..70af1be23e4 100644 --- a/modules/apps/transfer/types/transfer.pb.go +++ b/modules/apps/transfer/types/transfer.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" math "math" @@ -86,7 +87,7 @@ func (m *Params) GetReceiveEnabled() bool { // through which a packet must be forwarded, and the memo string to be used in the // final destination of the tokens. type ForwardingInfo struct { - Hops []*Hop `protobuf:"bytes,1,rep,name=hops,proto3" json:"hops,omitempty"` + Hops []Hop `protobuf:"bytes,1,rep,name=hops,proto3" json:"hops"` Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` } @@ -123,7 +124,7 @@ func (m *ForwardingInfo) XXX_DiscardUnknown() { var xxx_messageInfo_ForwardingInfo proto.InternalMessageInfo -func (m *ForwardingInfo) GetHops() []*Hop { +func (m *ForwardingInfo) GetHops() []Hop { if m != nil { return m.Hops } @@ -202,27 +203,28 @@ func init() { } var fileDescriptor_5041673e96e97901 = []byte{ - // 308 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x3f, 0x4f, 0x3a, 0x31, - 0x1c, 0xc6, 0xb9, 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, 0xb0, 0xf8, 0x18, 0xfd, 0xb7, - 0xe0, 0xc2, 0x54, 0x6d, 0xab, 0xb6, 0xd2, 0x66, 0x71, 0x9c, 0x08, 0x7c, 0x8a, 0x10, 0x5f, 0x50, - 0x63, 0x64, 0x56, 0xdc, 0x6d, 0x5f, 0xb6, 0x76, 0x64, 0x22, 0xee, 0x9f, 0xbf, 0xd6, 0x71, 0xb4, - 0x5a, 0xc7, 0xd1, 0xcf, 0x3a, 0x8e, 0x3e, 0x37, 0x71, 0x6d, 0xb5, 0x89, 0x6b, 0xdf, 0x9b, 0xb8, - 0xf6, 0x7a, 0x33, 0x57, 0x61, 0xb1, 0x64, 0x09, 0x07, 0x4d, 0x38, 0x78, 0x0d, 0x9e, 0x28, 0xc6, - 0x2f, 0xe6, 0x40, 0xf2, 0x5b, 0xa2, 0x41, 0x2c, 0x33, 0xe9, 0x8b, 0xd9, 0xf7, 0xe6, 0x0e, 0x1f, - 0x56, 0x7a, 0xd6, 0x2c, 0x97, 0xbe, 0xfa, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x05, 0xad, 0xe6, 0x9f, - 0x98, 0x01, 0x00, 0x00, + // 325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x18, 0x86, 0x5b, 0x37, 0xa6, 0xcb, 0x64, 0x42, 0x10, 0x1c, 0xa2, 0x75, 0xdb, 0xc5, 0x81, 0xd8, + 0x30, 0x3d, 0x28, 0x88, 0x97, 0x81, 0xb2, 0xdd, 0xb4, 0x78, 0xf2, 0x32, 0xd2, 0x34, 0xeb, 0x02, + 0x6d, 0xbe, 0x90, 0x74, 0x15, 0xff, 0x85, 0x3f, 0x6b, 0xc7, 0x1d, 0x3d, 0x89, 0x6c, 0x7f, 0x44, + 0x9a, 0x8e, 0xb2, 0x93, 0xb7, 0x37, 0x4f, 0x9e, 0x97, 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d6, 0x9e, 0xfb, 0xbb, 0xf6, 0xdc, 0xaf, 0x8d, 0xe7, 0xac, 0x36, 0x9e, 0xf3, 0xbd, 0xf1, 0x9c, + 0xf7, 0xbb, 0x58, 0x64, 0xf3, 0x45, 0xe8, 0x33, 0x48, 0x09, 0x03, 0x93, 0x82, 0x21, 0x22, 0x64, + 0xd7, 0x31, 0x90, 0xfc, 0x9e, 0xa4, 0x10, 0x2d, 0x12, 0x6e, 0x8a, 0x95, 0xec, 0xac, 0x22, 0xfb, + 0x54, 0xdc, 0x84, 0x0d, 0xfb, 0xa3, 0xb7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x1c, 0xa2, + 0x4b, 0xb4, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -565,7 +567,7 @@ func (m *ForwardingInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Hops = append(m.Hops, &Hop{}) + m.Hops = append(m.Hops, Hop{}) if err := m.Hops[len(m.Hops)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ibc/applications/transfer/v1/transfer.proto b/proto/ibc/applications/transfer/v1/transfer.proto index 45dc9c0d2b5..2eac86c7f6c 100644 --- a/proto/ibc/applications/transfer/v1/transfer.proto +++ b/proto/ibc/applications/transfer/v1/transfer.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package ibc.applications.transfer.v1; +import "gogoproto/gogo.proto"; + option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; // Params defines the set of IBC transfer parameters. @@ -21,7 +23,7 @@ message Params { // through which a packet must be forwarded, and the memo string to be used in the // final destination of the tokens. message ForwardingInfo { - repeated Hop hops = 1; + repeated Hop hops = 1 [(gogoproto.nullable) = false]; string memo = 2; } @@ -30,4 +32,4 @@ message ForwardingInfo { message Hop { string port_id = 1; string channel_id = 2; -} \ No newline at end of file +}