File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
modules/apps/transfer/types Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 4242 ibcCoins = sdk .NewCoins (sdk .NewCoin ("ibc/7F1D3FCF4AE79E1554D670D1AD949A9BA4E4A3C76C63093E17E446A46061A7A2" , sdkmath .NewInt (100 )))
4343 invalidIBCCoins = sdk .NewCoins (sdk .NewCoin ("ibc/7F1D3FCF4AE79E1554" , sdkmath .NewInt (100 )))
4444 invalidDenomCoins = []sdk.Coin {{Denom : "0atom" , Amount : sdkmath .NewInt (100 )}}
45- zeroCoins = sdk .NewCoins (sdk. Coin {Denom : "atoms" , Amount : sdkmath .NewInt (0 )})
45+ zeroCoins = [] sdk.Coin {{ Denom : "atoms" , Amount : sdkmath .NewInt (0 )}}
4646
4747 timeoutHeight = clienttypes .NewHeight (0 , 10 )
4848)
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ func (ftpd FungibleTokenPacketData) GetCustomPacketData(key string) interface{}
9797 return memoData
9898}
9999
100- // NewFungibleTokenPacketDataV2 constructs a new NewFungibleTokenPacketDataV2 instance
100+ // NewFungibleTokenPacketDataV2 constructs a new FungibleTokenPacketDataV2 instance
101101func NewFungibleTokenPacketDataV2 (
102102 tokens []Token ,
103103 sender , receiver string ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package types_test
33import (
44 "encoding/json"
55 "fmt"
6+ ibctesting "github.com/cosmos/ibc-go/v8/testing"
67 "testing"
78
89 "github.com/stretchr/testify/require"
@@ -338,6 +339,22 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
338339 ),
339340 ibcerrors .ErrInvalidAddress ,
340341 },
342+ {
343+ "failure: memo field too large" ,
344+ types .NewFungibleTokenPacketDataV2 (
345+ []types.Token {
346+ {
347+ Denom : denom ,
348+ Amount : largeAmount ,
349+ Trace : []string {"transfer/channel-0" , "transfer/channel-1" },
350+ },
351+ },
352+ sender ,
353+ receiver ,
354+ ibctesting .GenerateString (types .MaximumMemoLength + 1 ),
355+ ),
356+ types .ErrInvalidMemo ,
357+ },
341358 }
342359
343360 for _ , tc := range testCases {
You can’t perform that action at this time.
0 commit comments