@@ -312,11 +312,37 @@ describe("SpokePool Relayer Logic", async function () {
312312 expect ( acrossMessageHandler . handleAcrossMessage ) . to . have . been . calledOnceWith (
313313 weth . address ,
314314 consts . amountToRelay ,
315+ false ,
316+ relayer . address ,
317+ "0x1234"
318+ ) ;
319+ } ) ;
320+ it ( "Handler is called with correct params" , async function ( ) {
321+ const acrossMessageHandler = await createFake ( "AcrossMessageHandlerMock" ) ;
322+ const { relayData } = getRelayHash (
323+ depositor . address ,
324+ acrossMessageHandler . address ,
325+ consts . firstDepositId ,
326+ consts . originChainId ,
327+ consts . destinationChainId ,
328+ weth . address ,
329+ undefined ,
330+ undefined ,
331+ undefined ,
315332 "0x1234"
316333 ) ;
317334
318- // The collateral should have not unwrapped to ETH and then transferred to recipient.
319- expect ( await weth . balanceOf ( acrossMessageHandler . address ) ) . to . equal ( consts . amountToRelay ) ;
335+ // Handler is called with full fill and relayer address.
336+ await spokePool
337+ . connect ( depositor )
338+ . fillRelay ( ...getFillRelayParams ( relayData , relayData . amount , consts . destinationChainId ) ) ;
339+ expect ( acrossMessageHandler . handleAcrossMessage ) . to . have . been . calledOnceWith (
340+ weth . address ,
341+ relayData . amount . mul ( consts . totalPostFeesPct ) . div ( toBN ( consts . oneHundredPct ) ) ,
342+ true , // True because fill completed deposit.
343+ depositor . address , // Custom relayer
344+ "0x1234"
345+ ) ;
320346 } ) ;
321347 it ( "Self-relay transfers no tokens" , async function ( ) {
322348 const largeRelayAmount = consts . amountToSeedWallets . mul ( 100 ) ;
@@ -654,6 +680,8 @@ async function testfillRelayWithUpdatedDeposit(depositorAddress: string) {
654680 expect ( acrossMessageHandler . handleAcrossMessage ) . to . have . been . calledOnceWith (
655681 relayData . destinationToken ,
656682 amountActuallySent ,
683+ false ,
684+ relayer . address ,
657685 updatedMessage
658686 ) ;
659687
0 commit comments