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
68149448
Commit
68149448
authored
Dec 01, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: update comments
parent
e3ead426
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
L1StandardBridge.t.sol
packages/contracts-bedrock/test/L1/L1StandardBridge.t.sol
+9
-3
No files found.
packages/contracts-bedrock/test/L1/L1StandardBridge.t.sol
View file @
68149448
...
@@ -40,18 +40,18 @@ contract L1StandardBridge_Initialize_Test is Bridge_Initializer {
...
@@ -40,18 +40,18 @@ contract L1StandardBridge_Initialize_Test is Bridge_Initializer {
}
}
contract L1StandardBridge_Pause_Test is Bridge_Initializer {
contract L1StandardBridge_Pause_Test is Bridge_Initializer {
/// @dev
Test that the accessors return the correct initialized values
/// @dev
Verifies that the `paused` accessor returns the same value as the `paused` function of the `superchainConfig`.
function test_paused_succeeds() external {
function test_paused_succeeds() external {
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
}
}
/// @dev
Tests that the superchain config is called by the messengers paused function
/// @dev
Ensures that the `paused` function of the bridge contract actually calls the `paused` function of the `superchainConfig`.
function test_pause_callsSuperchainConfig_succeeds() external {
function test_pause_callsSuperchainConfig_succeeds() external {
vm.expectCall(address(superchainConfig), abi.encodeWithSelector(SuperchainConfig.paused.selector));
vm.expectCall(address(superchainConfig), abi.encodeWithSelector(SuperchainConfig.paused.selector));
l1StandardBridge.paused();
l1StandardBridge.paused();
}
}
/// @dev
Tests that changing the superchain config paused status changes the return value of the bridge
.
/// @dev
Checks that the `paused` state of the bridge matches the `paused` state of the `superchainConfig` after it's been changed
.
function test_pause_matchesSuperchainConfig_succeeds() external {
function test_pause_matchesSuperchainConfig_succeeds() external {
assertFalse(l1StandardBridge.paused());
assertFalse(l1StandardBridge.paused());
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
...
@@ -65,6 +65,8 @@ contract L1StandardBridge_Pause_Test is Bridge_Initializer {
...
@@ -65,6 +65,8 @@ contract L1StandardBridge_Pause_Test is Bridge_Initializer {
}
}
contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
/// @dev Sets up the test by pausing the bridge, giving ether to the bridge and mocking
/// the calls to the xDomainMessageSender so that it returns the correct value.
function setUp() public override {
function setUp() public override {
super.setUp();
super.setUp();
vm.prank(superchainConfig.guardian());
vm.prank(superchainConfig.guardian());
...
@@ -80,6 +82,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
...
@@ -80,6 +82,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
);
);
}
}
/// @dev Confirms that the `finalizeBridgeETH` function reverts when the bridge is paused.
function test_pause_finalizeBridgeETH_reverts() external {
function test_pause_finalizeBridgeETH_reverts() external {
vm.prank(address(l1StandardBridge.messenger()));
vm.prank(address(l1StandardBridge.messenger()));
vm.expectRevert("StandardBridge: paused");
vm.expectRevert("StandardBridge: paused");
...
@@ -91,6 +94,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
...
@@ -91,6 +94,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
});
});
}
}
/// @dev Confirms that the `finalizeETHWithdrawal` function reverts when the bridge is paused.
function test_pause_finalizeETHWithdrawal_reverts() external {
function test_pause_finalizeETHWithdrawal_reverts() external {
vm.prank(address(l1StandardBridge.messenger()));
vm.prank(address(l1StandardBridge.messenger()));
vm.expectRevert("StandardBridge: paused");
vm.expectRevert("StandardBridge: paused");
...
@@ -102,6 +106,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
...
@@ -102,6 +106,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
});
});
}
}
/// @dev Confirms that the `finalizeERC20Withdrawal` function reverts when the bridge is paused.
function test_pause_finalizeERC20Withdrawal_reverts() external {
function test_pause_finalizeERC20Withdrawal_reverts() external {
vm.prank(address(l1StandardBridge.messenger()));
vm.prank(address(l1StandardBridge.messenger()));
vm.expectRevert("StandardBridge: paused");
vm.expectRevert("StandardBridge: paused");
...
@@ -115,6 +120,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
...
@@ -115,6 +120,7 @@ contract L1StandardBridge_Pause_TestFail is Bridge_Initializer {
});
});
}
}
/// @dev Confirms that the `finalizeBridgeERC20` function reverts when the bridge is paused.
function test_pause_finalizeBridgeERC20_reverts() external {
function test_pause_finalizeBridgeERC20_reverts() external {
vm.prank(address(l1StandardBridge.messenger()));
vm.prank(address(l1StandardBridge.messenger()));
vm.expectRevert("StandardBridge: paused");
vm.expectRevert("StandardBridge: paused");
...
...
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