Commit 20fe9498 authored by coolhill's avatar coolhill

test L1StandardBridge, revert if failed withdraw

parent 23fecaeb
...@@ -244,6 +244,30 @@ describe('L1StandardBridge', () => { ...@@ -244,6 +244,30 @@ describe('L1StandardBridge', () => {
).to.be.revertedWith(ERR_INVALID_X_DOMAIN_MSG_SENDER) ).to.be.revertedWith(ERR_INVALID_X_DOMAIN_MSG_SENDER)
}) })
it('should revert in nothing to withdraw', async () => {
// make sure no balance at start of test
expect(await ethers.provider.getBalance(NON_ZERO_ADDRESS)).to.be.equal(0)
const withdrawalAmount = 100
Mock__L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
() => DUMMY_L2_BRIDGE_ADDRESS
)
await expect(
L1StandardBridge.finalizeETHWithdrawal(
NON_ZERO_ADDRESS,
NON_ZERO_ADDRESS,
withdrawalAmount,
NON_NULL_BYTES32,
{
from: Mock__L1CrossDomainMessenger.address,
}
)
).to.be.revertedWith(
'TransferHelper::safeTransferETH: ETH transfer failed'
)
})
it('should credit funds to the withdrawer and not use too much gas', async () => { it('should credit funds to the withdrawer and not use too much gas', async () => {
// make sure no balance at start of test // make sure no balance at start of test
expect(await ethers.provider.getBalance(NON_ZERO_ADDRESS)).to.be.equal(0) expect(await ethers.provider.getBalance(NON_ZERO_ADDRESS)).to.be.equal(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment