@@ -14,14 +14,14 @@ describe("L2EthToken tests", () => {
14
14
let wallets : Array < Wallet > ;
15
15
let l2EthToken : L2EthToken ;
16
16
let bootloaderAccount : ethers . Signer ;
17
- let selector : string ;
17
+ let mailboxIface : ethers . utils . Interface ;
18
18
19
19
before ( async ( ) => {
20
20
await prepareEnvironment ( ) ;
21
21
await deployContractOnAddress ( TEST_ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS , "L2EthToken" ) ;
22
22
l2EthToken = L2EthTokenFactory . connect ( TEST_ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS , richWallet ) ;
23
23
bootloaderAccount = await ethers . getImpersonatedSigner ( TEST_BOOTLOADER_FORMAL_ADDRESS ) ;
24
- selector = new ethers . utils . Interface ( ( await loadArtifact ( "IMailbox" ) ) . abi ) . getSighash ( "finalizeEthWithdrawal" ) ;
24
+ mailboxIface = new ethers . utils . Interface ( ( await loadArtifact ( "IMailbox" ) ) . abi ) ;
25
25
} ) ;
26
26
27
27
beforeEach ( async ( ) => {
@@ -170,7 +170,7 @@ describe("L2EthToken tests", () => {
170
170
const amountToWithdraw : BigNumber = ethers . utils . parseEther ( "1.0" ) ;
171
171
const message : string = ethers . utils . solidityPack (
172
172
[ "bytes4" , "address" , "uint256" ] ,
173
- [ selector , wallets [ 1 ] . address , amountToWithdraw ]
173
+ [ mailboxIface . getSighash ( "finalizeEthWithdrawal" ) , wallets [ 1 ] . address , amountToWithdraw ]
174
174
) ;
175
175
176
176
await setResult ( "L1Messenger" , "sendToL1" , [ message ] , {
@@ -201,7 +201,13 @@ describe("L2EthToken tests", () => {
201
201
const additionalData : string = ethers . utils . defaultAbiCoder . encode ( [ "string" ] , [ "additional data" ] ) ;
202
202
const message : string = ethers . utils . solidityPack (
203
203
[ "bytes4" , "address" , "uint256" , "address" , "bytes" ] ,
204
- [ selector , wallets [ 1 ] . address , amountToWithdraw , richWallet . address , additionalData ]
204
+ [
205
+ mailboxIface . getSighash ( "finalizeEthWithdrawal" ) ,
206
+ wallets [ 1 ] . address ,
207
+ amountToWithdraw ,
208
+ richWallet . address ,
209
+ additionalData ,
210
+ ]
205
211
) ;
206
212
207
213
await setResult ( "L1Messenger" , "sendToL1" , [ message ] , {
0 commit comments