File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
modules/apps/transfer/types Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,31 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
220220 ),
221221 nil ,
222222 },
223+ {
224+ "success: valid packet with forwarding path hops" ,
225+ types .NewFungibleTokenPacketDataV2 (
226+ []types.Token {
227+ {
228+ Denom : denom ,
229+ Amount : amount ,
230+ Trace : []string {"transfer/channel-0" , "transfer/channel-1" },
231+ },
232+ },
233+ sender ,
234+ receiver ,
235+ "" ,
236+ & types.ForwardingInfo {
237+ Hops : []* types.Hop {
238+ {
239+ PortId : "transfer" ,
240+ ChannelId : "channel-1" ,
241+ },
242+ },
243+ Memo : "" ,
244+ },
245+ ),
246+ nil ,
247+ },
223248 {
224249 "failure: invalid denom" ,
225250 types .NewFungibleTokenPacketDataV2 (
@@ -367,6 +392,31 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) {
367392 ),
368393 types .ErrInvalidMemo ,
369394 },
395+ {
396+ "failure: memo must be empty if forwarding path hops is not empty" ,
397+ types .NewFungibleTokenPacketDataV2 (
398+ []types.Token {
399+ {
400+ Denom : denom ,
401+ Amount : amount ,
402+ Trace : []string {"transfer/channel-0" , "transfer/channel-1" },
403+ },
404+ },
405+ sender ,
406+ receiver ,
407+ "memo" ,
408+ & types.ForwardingInfo {
409+ Hops : []* types.Hop {
410+ {
411+ PortId : "transfer" ,
412+ ChannelId : "channel-1" ,
413+ },
414+ },
415+ Memo : "" ,
416+ },
417+ ),
418+ types .ErrInvalidMemo ,
419+ },
370420 }
371421
372422 for _ , tc := range testCases {
You can’t perform that action at this time.
0 commit comments