Skip to content

Commit

Permalink
chore: address minor nits
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim committed May 23, 2024
1 parent 575403e commit 52d2106
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/apps/transfer/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
ibcCoins = sdk.NewCoins(sdk.NewCoin("ibc/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2", sdkmath.NewInt(100)))
invalidIBCCoins = sdk.NewCoins(sdk.NewCoin("ibc/7F1D3FCF4AE79E1554", sdkmath.NewInt(100)))
invalidDenomCoins = []sdk.Coin{{Denom: "0atom", Amount: sdkmath.NewInt(100)}}
zeroCoins = sdk.NewCoins(sdk.Coin{Denom: "atoms", Amount: sdkmath.NewInt(0)})
zeroCoins = []sdk.Coin{{Denom: "atoms", Amount: sdkmath.NewInt(0)}}

timeoutHeight = clienttypes.NewHeight(0, 10)
)
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/types/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (ftpd FungibleTokenPacketData) GetCustomPacketData(key string) interface{}
return memoData
}

// NewFungibleTokenPacketDataV2 constructs a new NewFungibleTokenPacketDataV2 instance
// NewFungibleTokenPacketDataV2 constructs a new FungibleTokenPacketDataV2 instance
func NewFungibleTokenPacketDataV2(
tokens []Token,
sender, receiver string,
Expand Down
17 changes: 17 additions & 0 deletions modules/apps/transfer/types/packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibcerrors "github.com/cosmos/ibc-go/v8/modules/core/errors"
ibctesting "github.com/cosmos/ibc-go/v8/testing"
)

const (
Expand Down Expand Up @@ -338,6 +339,22 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
),
ibcerrors.ErrInvalidAddress,
},
{
"failure: memo field too large",
types.NewFungibleTokenPacketDataV2(
[]types.Token{
{
Denom: denom,
Amount: largeAmount,
Trace: []string{"transfer/channel-0", "transfer/channel-1"},
},
},
sender,
receiver,
ibctesting.GenerateString(types.MaximumMemoLength+1),
),
types.ErrInvalidMemo,
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit 52d2106

Please sign in to comment.