Skip to content

Commit 6bc89e8

Browse files
committed
blobal mailboxIface instead of selector
1 parent 109f832 commit 6bc89e8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

system-contracts/test/L2EthToken.spec.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ describe("L2EthToken tests", () => {
1414
let wallets: Array<Wallet>;
1515
let l2EthToken: L2EthToken;
1616
let bootloaderAccount: ethers.Signer;
17-
let selector: string;
17+
let mailboxIface: ethers.utils.Interface;
1818

1919
before(async () => {
2020
await prepareEnvironment();
2121
await deployContractOnAddress(TEST_ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS, "L2EthToken");
2222
l2EthToken = L2EthTokenFactory.connect(TEST_ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS, richWallet);
2323
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);
2525
});
2626

2727
beforeEach(async () => {
@@ -170,7 +170,7 @@ describe("L2EthToken tests", () => {
170170
const amountToWithdraw: BigNumber = ethers.utils.parseEther("1.0");
171171
const message: string = ethers.utils.solidityPack(
172172
["bytes4", "address", "uint256"],
173-
[selector, wallets[1].address, amountToWithdraw]
173+
[mailboxIface.getSighash("finalizeEthWithdrawal"), wallets[1].address, amountToWithdraw]
174174
);
175175

176176
await setResult("L1Messenger", "sendToL1", [message], {
@@ -201,7 +201,13 @@ describe("L2EthToken tests", () => {
201201
const additionalData: string = ethers.utils.defaultAbiCoder.encode(["string"], ["additional data"]);
202202
const message: string = ethers.utils.solidityPack(
203203
["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+
]
205211
);
206212

207213
await setResult("L1Messenger", "sendToL1", [message], {

0 commit comments

Comments
 (0)