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
b4727c47
Commit
b4727c47
authored
Nov 29, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: pause tests
parent
1b84f7d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
L1StandardBridge.t.sol
packages/contracts-bedrock/test/L1/L1StandardBridge.t.sol
+26
-0
L2StandardBridge.t.sol
packages/contracts-bedrock/test/L2/L2StandardBridge.t.sol
+6
-0
StandardBridge.t.sol
...ges/contracts-bedrock/test/universal/StandardBridge.t.sol
+5
-0
No files found.
packages/contracts-bedrock/test/L1/L1StandardBridge.t.sol
View file @
b4727c47
...
@@ -14,6 +14,7 @@ import { Constants } from "src/libraries/Constants.sol";
...
@@ -14,6 +14,7 @@ import { Constants } from "src/libraries/Constants.sol";
import { StandardBridge } from "src/universal/StandardBridge.sol";
import { StandardBridge } from "src/universal/StandardBridge.sol";
import { L2StandardBridge } from "src/L2/L2StandardBridge.sol";
import { L2StandardBridge } from "src/L2/L2StandardBridge.sol";
import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
// Target contract
// Target contract
...
@@ -38,6 +39,31 @@ contract L1StandardBridge_Initialize_Test is Bridge_Initializer {
...
@@ -38,6 +39,31 @@ contract L1StandardBridge_Initialize_Test is Bridge_Initializer {
}
}
}
}
contract L1StandardBridge_Pause_Test is Bridge_Initializer {
/// @dev Test that the accessors return the correct initialized values
function test_paused_succeeds() external {
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
}
/// @dev Tests that the superchain config is called by the messengers paused function
function test_pause_callsSuperchainConfig_succeeds() external {
vm.expectCall(address(superchainConfig), abi.encodeWithSelector(SuperchainConfig.paused.selector));
l1StandardBridge.paused();
}
/// @dev Tests that changing the superchain config paused status changes the return value of the bridge.
function test_pause_matchesSuperchainConfig_succeeds() external {
assertFalse(l1StandardBridge.paused());
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
vm.prank(superchainConfig.guardian());
superchainConfig.pause("identifier");
assertTrue(l1StandardBridge.paused());
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
}
}
contract L1StandardBridge_Initialize_TestFail is Bridge_Initializer { }
contract L1StandardBridge_Initialize_TestFail is Bridge_Initializer { }
contract L1StandardBridge_Receive_Test is Bridge_Initializer {
contract L1StandardBridge_Receive_Test is Bridge_Initializer {
...
...
packages/contracts-bedrock/test/L2/L2StandardBridge.t.sol
View file @
b4727c47
...
@@ -28,6 +28,12 @@ contract L2StandardBridge_Test is Bridge_Initializer {
...
@@ -28,6 +28,12 @@ contract L2StandardBridge_Test is Bridge_Initializer {
assertEq(address(l2StandardBridge.OTHER_BRIDGE()), address(l1StandardBridge));
assertEq(address(l2StandardBridge.OTHER_BRIDGE()), address(l1StandardBridge));
}
}
/// @dev Ensures that the L2StandardBridge is always not paused. The pausability
/// happens on L1 and not L2.
function test_paused_succeeds() external {
assertFalse(l2StandardBridge.paused());
}
/// @dev Tests that the bridge receives ETH and successfully initiates a withdrawal.
/// @dev Tests that the bridge receives ETH and successfully initiates a withdrawal.
function test_receive_succeeds() external {
function test_receive_succeeds() external {
assertEq(address(l2ToL1MessagePasser).balance, 0);
assertEq(address(l2ToL1MessagePasser).balance, 0);
...
...
packages/contracts-bedrock/test/universal/StandardBridge.t.sol
View file @
b4727c47
...
@@ -112,4 +112,9 @@ contract StandardBridge_Stateless_Test is CommonTest {
...
@@ -112,4 +112,9 @@ contract StandardBridge_Stateless_Test is CommonTest {
vm.expectRevert();
vm.expectRevert();
bridge.isCorrectTokenPair(address(erc20), address(1));
bridge.isCorrectTokenPair(address(erc20), address(1));
}
}
/// @notice The bridge by default should be unpaused.
function test_paused_succeeds() external {
assertFalse(bridge.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