Skip to content

Commit

Permalink
nit(transfer): Mark hops as non nullable. (#6566)
Browse files Browse the repository at this point in the history
* nit(transfer): Mark hops as non nullable.

* lint: fix additional linting issues
  • Loading branch information
DimitrisJim authored Jun 12, 2024
1 parent 0c9f368 commit 413b7c1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 33 deletions.
10 changes: 5 additions & 5 deletions modules/apps/transfer/keeper/relay_forwarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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,
Expand Down Expand Up @@ -90,7 +90,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,
Expand Down Expand Up @@ -173,7 +173,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,
Expand Down Expand Up @@ -281,7 +281,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,
Expand Down Expand Up @@ -478,7 +478,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,
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/transfer/types/packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
receiver,
"",
&types.ForwardingInfo{
Hops: []*types.Hop{
Hops: []types.Hop{
{
PortId: "transfer",
ChannelId: "channel-1",
Expand Down Expand Up @@ -400,7 +400,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
receiver,
"memo",
&types.ForwardingInfo{
Hops: []*types.Hop{
Hops: []types.Hop{
{
PortId: "transfer",
ChannelId: "channel-1",
Expand Down
50 changes: 26 additions & 24 deletions modules/apps/transfer/types/transfer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions proto/ibc/applications/transfer/v1/transfer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}

Expand All @@ -30,4 +32,4 @@ message ForwardingInfo {
message Hop {
string port_id = 1;
string channel_id = 2;
}
}

0 comments on commit 413b7c1

Please sign in to comment.