@@ -395,11 +395,15 @@ func Test_MigrateToken_Success(t *testing.T) {
395395 input .Faucet .Fund (ctx , sender , sdk .NewCoins (amount )... )
396396
397397 // Test token migration
398- ibcCoin , err := input .OPChildKeeper .MigrateToken (ctx , migrationInfo , sender , amount )
398+ _ , err = ms .MigrateToken (ctx , & opchildtypes.MsgMigrateToken {
399+ Sender : sender .String (),
400+ Amount : amount ,
401+ })
399402 require .NoError (t , err )
400403
401404 // Verify the IBC coin was created correctly
402405 expectedIBCDenom := transfertypes .GetTransferCoin (migrationInfo .IbcPortId , migrationInfo .IbcChannelId , "test1" , amount .Amount )
406+ ibcCoin := input .BankKeeper .GetBalance (ctx , sender , expectedIBCDenom .Denom )
403407 require .Equal (t , expectedIBCDenom , ibcCoin )
404408
405409 // Verify sender balance is now 0 for the original token
@@ -437,22 +441,28 @@ func Test_MigrateToken_InvalidAmount(t *testing.T) {
437441
438442 // Test with zero amount
439443 zeroAmount := sdk .NewCoin ("test1" , math .NewInt (0 ))
440- _ , err = input .OPChildKeeper .MigrateToken (ctx , migrationInfo , addrs [0 ], zeroAmount )
444+ _ , err = ms .MigrateToken (ctx , & opchildtypes.MsgMigrateToken {
445+ Sender : addrs [0 ].String (),
446+ Amount : zeroAmount ,
447+ })
441448 require .Error (t , err )
442- require .Contains (t , err .Error (), "amount is not positive " )
449+ require .Contains (t , err .Error (), "invalid amount " )
443450
444451 // Test with negative amount - create coin directly to avoid panic
445452 negativeAmount := sdk.Coin {
446453 Denom : "test1" ,
447454 Amount : math .NewInt (- 100 ),
448455 }
449- _ , err = input .OPChildKeeper .MigrateToken (ctx , migrationInfo , addrs [0 ], negativeAmount )
456+ _ , err = ms .MigrateToken (ctx , & opchildtypes.MsgMigrateToken {
457+ Sender : addrs [0 ].String (),
458+ Amount : negativeAmount ,
459+ })
450460 require .Error (t , err )
451- require .Contains (t , err .Error (), "amount is not positive " )
461+ require .Contains (t , err .Error (), "invalid amount " )
452462}
453463
454- // Test_MigrateToken_DenomMismatch tests token migration with denom mismatch
455- func Test_MigrateToken_DenomMismatch (t * testing.T ) {
464+ // Test_MigrateToken_NotFound tests token migration with not found migration info
465+ func Test_MigrateToken_NotFound (t * testing.T ) {
456466 ctx , input := createDefaultTestInput (t )
457467
458468 // Set up denom pair first (L1 token)
@@ -477,9 +487,12 @@ func Test_MigrateToken_DenomMismatch(t *testing.T) {
477487
478488 // Test with mismatched denom
479489 wrongDenomAmount := sdk .NewCoin ("test2" , math .NewInt (100 ))
480- _ , err = input .OPChildKeeper .MigrateToken (ctx , migrationInfo , addrs [0 ], wrongDenomAmount )
490+ _ , err = ms .MigrateToken (ctx , & opchildtypes.MsgMigrateToken {
491+ Sender : addrs [0 ].String (),
492+ Amount : wrongDenomAmount ,
493+ })
481494 require .Error (t , err )
482- require .Contains (t , err .Error (), "migration info denom does not match " )
495+ require .Contains (t , err .Error (), "migration info not found " )
483496}
484497
485498// Test_MigrateToken_InsufficientBalance tests token migration with insufficient balance
@@ -508,7 +521,10 @@ func Test_MigrateToken_InsufficientBalance(t *testing.T) {
508521
509522 // Test with amount larger than balance
510523 largeAmount := sdk .NewCoin ("test1" , math .NewInt (1000 ))
511- _ , err = input .OPChildKeeper .MigrateToken (ctx , migrationInfo , addrs [0 ], largeAmount )
524+ _ , err = ms .MigrateToken (ctx , & opchildtypes.MsgMigrateToken {
525+ Sender : addrs [0 ].String (),
526+ Amount : largeAmount ,
527+ })
512528 require .Error (t , err )
513529 require .Contains (t , err .Error (), "insufficient funds" )
514530}
0 commit comments