@@ -445,17 +445,30 @@ describe('L2GraphTokenGateway', () => {
445
445
await testValidFinalizeTransfer ( defaultDataWithNotEmptyCallHookData )
446
446
expect ( rewardsManagerMock . pow ) . to . have . been . calledWith ( toBN ( 1 ) , toBN ( 2 ) , toBN ( 3 ) )
447
447
} )
448
- it ( 'performs the transfer even if a callhook reverts' , async function ( ) {
448
+ it ( 'reverts if a callhook reverts' , async function ( ) {
449
449
const rewardsManagerMock = await smock . fake ( 'RewardsManagerMock' , {
450
450
address : l2Receiver . address ,
451
451
} )
452
452
rewardsManagerMock . pow . reverts ( )
453
453
await l2GraphTokenGateway
454
454
. connect ( governor . signer )
455
455
. addToCallhookWhitelist ( tokenSender . address )
456
- const tx = testValidFinalizeTransfer ( defaultDataWithNotEmptyCallHookData )
457
- await expect ( tx ) . emit ( l2GraphTokenGateway , 'CallhookFailed' ) . withArgs ( l2Receiver . address )
458
- expect ( rewardsManagerMock . pow ) . to . have . been . calledWith ( toBN ( 1 ) , toBN ( 2 ) , toBN ( 3 ) )
456
+ const mockL1GatewayL2Alias = await getL2SignerFromL1 ( mockL1Gateway . address )
457
+ await me . signer . sendTransaction ( {
458
+ to : await mockL1GatewayL2Alias . getAddress ( ) ,
459
+ value : utils . parseUnits ( '1' , 'ether' ) ,
460
+ } )
461
+ const tx = l2GraphTokenGateway
462
+ . connect ( mockL1GatewayL2Alias )
463
+ . finalizeInboundTransfer (
464
+ mockL1GRT . address ,
465
+ tokenSender . address ,
466
+ l2Receiver . address ,
467
+ toGRT ( '10' ) ,
468
+ defaultDataWithNotEmptyCallHookData ,
469
+ )
470
+ await expect ( tx )
471
+ . revertedWith ( 'CALLHOOK_FAILED' )
459
472
} )
460
473
} )
461
474
} )
0 commit comments