Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
20fe9498
Commit
20fe9498
authored
Dec 22, 2021
by
coolhill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test L1StandardBridge, revert if failed withdraw
parent
23fecaeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
L1StandardBridge.spec.ts
...acts/test/contracts/L1/messaging/L1StandardBridge.spec.ts
+24
-0
No files found.
packages/contracts/test/contracts/L1/messaging/L1StandardBridge.spec.ts
View file @
20fe9498
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment