Skip to content

Commit 413b7c1

Browse files
authored
nit(transfer): Mark hops as non nullable. (#6566)
* nit(transfer): Mark hops as non nullable. * lint: fix additional linting issues
1 parent 0c9f368 commit 413b7c1

File tree

4 files changed

+37
-33
lines changed

4 files changed

+37
-33
lines changed

modules/apps/transfer/keeper/relay_forwarding_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (suite *KeeperTestSuite) TestPathForwarding() {
2828
sender := suite.chainA.SenderAccounts[0].SenderAccount
2929
receiver := suite.chainA.SenderAccounts[1].SenderAccount
3030
forwardingPath := types.ForwardingInfo{
31-
Hops: []*types.Hop{
31+
Hops: []types.Hop{
3232
{
3333
PortId: path2.EndpointA.ChannelConfig.PortID,
3434
ChannelId: path2.EndpointA.ChannelID,
@@ -90,7 +90,7 @@ func (suite *KeeperTestSuite) TestEscrowsAreSetAfterForwarding() {
9090
sender := suite.chainA.SenderAccounts[0].SenderAccount
9191
receiver := suite.chainA.SenderAccounts[1].SenderAccount
9292
forwardingPath := types.ForwardingInfo{
93-
Hops: []*types.Hop{
93+
Hops: []types.Hop{
9494
{
9595
PortId: path2.EndpointB.ChannelConfig.PortID,
9696
ChannelId: path2.EndpointB.ChannelID,
@@ -173,7 +173,7 @@ func (suite *KeeperTestSuite) TestHappyPathForwarding() {
173173
sender := suite.chainA.SenderAccounts[0].SenderAccount
174174
receiver := suite.chainA.SenderAccounts[1].SenderAccount
175175
forwardingPath := types.ForwardingInfo{
176-
Hops: []*types.Hop{
176+
Hops: []types.Hop{
177177
{
178178
PortId: path2.EndpointB.ChannelConfig.PortID,
179179
ChannelId: path2.EndpointB.ChannelID,
@@ -281,7 +281,7 @@ func (suite *KeeperTestSuite) TestSimplifiedHappyPathForwarding() {
281281
sender := suite.chainA.SenderAccounts[0].SenderAccount
282282
receiver := suite.chainA.SenderAccounts[1].SenderAccount
283283
forwardingPath := types.ForwardingInfo{
284-
Hops: []*types.Hop{
284+
Hops: []types.Hop{
285285
{
286286
PortId: path2.EndpointB.ChannelConfig.PortID,
287287
ChannelId: path2.EndpointB.ChannelID,
@@ -478,7 +478,7 @@ func (suite *KeeperTestSuite) TestAcknowledgementFailureScenario5Forwarding() {
478478
receiver = suite.chainA.SenderAccounts[0].SenderAccount // Receiver is the A chain account
479479

480480
forwardingPath := types.ForwardingInfo{
481-
Hops: []*types.Hop{
481+
Hops: []types.Hop{
482482
{
483483
PortId: path1.EndpointB.ChannelConfig.PortID,
484484
ChannelId: path1.EndpointB.ChannelID,

modules/apps/transfer/types/packet_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
234234
receiver,
235235
"",
236236
&types.ForwardingInfo{
237-
Hops: []*types.Hop{
237+
Hops: []types.Hop{
238238
{
239239
PortId: "transfer",
240240
ChannelId: "channel-1",
@@ -400,7 +400,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
400400
receiver,
401401
"memo",
402402
&types.ForwardingInfo{
403-
Hops: []*types.Hop{
403+
Hops: []types.Hop{
404404
{
405405
PortId: "transfer",
406406
ChannelId: "channel-1",

modules/apps/transfer/types/transfer.pb.go

Lines changed: 26 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/ibc/applications/transfer/v1/transfer.proto

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ syntax = "proto3";
22

33
package ibc.applications.transfer.v1;
44

5+
import "gogoproto/gogo.proto";
6+
57
option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types";
68

79
// Params defines the set of IBC transfer parameters.
@@ -21,7 +23,7 @@ message Params {
2123
// through which a packet must be forwarded, and the memo string to be used in the
2224
// final destination of the tokens.
2325
message ForwardingInfo {
24-
repeated Hop hops = 1;
26+
repeated Hop hops = 1 [(gogoproto.nullable) = false];
2527
string memo = 2;
2628
}
2729

@@ -30,4 +32,4 @@ message ForwardingInfo {
3032
message Hop {
3133
string port_id = 1;
3234
string channel_id = 2;
33-
}
35+
}

0 commit comments

Comments
 (0)