Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nit(transfer): Mark hops as non nullable. #6566

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading