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
343177c6
Unverified
Commit
343177c6
authored
Nov 30, 2022
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctb: Fix CrossDomainOwnable test name
parent
b62149a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
CrossDomainOwnable.t.sol
...contracts-bedrock/contracts/test/CrossDomainOwnable.t.sol
+3
-3
CrossDomainOwnable2.t.sol
...ontracts-bedrock/contracts/test/CrossDomainOwnable2.t.sol
+7
-6
No files found.
packages/contracts-bedrock/contracts/test/CrossDomainOwnable.t.sol
View file @
343177c6
...
@@ -23,13 +23,13 @@ contract CrossDomainOwnable_Test is CommonTest {
...
@@ -23,13 +23,13 @@ contract CrossDomainOwnable_Test is CommonTest {
}
}
// Check that the revert message is correct
// Check that the revert message is correct
function test_
revertOnlyOwner
() external {
function test_
onlyOwner_notOwner_reverts
() external {
vm.expectRevert("CrossDomainOwnable: caller is not the owner");
vm.expectRevert("CrossDomainOwnable: caller is not the owner");
setter.set(1);
setter.set(1);
}
}
// Check that making a call can set the value properly
// Check that making a call can set the value properly
function test_onlyOwner() external {
function test_onlyOwner
_succeeds
() external {
assertEq(setter.value(), 0);
assertEq(setter.value(), 0);
vm.prank(AddressAliasHelper.applyL1ToL2Alias(setter.owner()));
vm.prank(AddressAliasHelper.applyL1ToL2Alias(setter.owner()));
...
@@ -48,7 +48,7 @@ contract CrossDomainOwnableThroughPortal_Test is Portal_Initializer {
...
@@ -48,7 +48,7 @@ contract CrossDomainOwnableThroughPortal_Test is Portal_Initializer {
setter = new XDomainSetter();
setter = new XDomainSetter();
}
}
function test_depositTransaction_crossDomainOwner() external {
function test_depositTransaction_crossDomainOwner
_succeeds
() external {
vm.recordLogs();
vm.recordLogs();
vm.prank(alice);
vm.prank(alice);
...
...
packages/contracts-bedrock/contracts/test/CrossDomainOwnable2.t.sol
View file @
343177c6
...
@@ -25,15 +25,15 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
...
@@ -25,15 +25,15 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
setter = new XDomainSetter2();
setter = new XDomainSetter2();
}
}
function test_
revertNotSetOnlyOwner
() external {
function test_
onlyOwner_notMessenger_reverts
() external {
vm.expectRevert("CrossDomainOwnable2: caller is not the messenger");
vm.expectRevert("CrossDomainOwnable2: caller is not the messenger");
setter.set(1);
setter.set(1);
}
}
function test_
revertNotSetOnlyOwner2
() external {
function test_
onlyOwner_notOwner_reverts
() external {
// set the x
domain messeng
er storage slot
// set the x
DomainMsgSend
er storage slot
bytes32 key = bytes32(uint256(204));
bytes32 key = bytes32(uint256(204));
bytes32 value = Bytes32AddressLib.fillLast12Bytes(address(
setter
));
bytes32 value = Bytes32AddressLib.fillLast12Bytes(address(
alice
));
vm.store(address(L2Messenger), key, value);
vm.store(address(L2Messenger), key, value);
vm.prank(address(L2Messenger));
vm.prank(address(L2Messenger));
...
@@ -41,7 +41,8 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
...
@@ -41,7 +41,8 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
setter.set(1);
setter.set(1);
}
}
function test_revertOnlyOwner() external {
function test_onlyOwner_notOwner2_reverts() external {
uint240 nonce = 0;
uint240 nonce = 0;
address sender = bob;
address sender = bob;
address target = address(setter);
address target = address(setter);
...
@@ -76,7 +77,7 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
...
@@ -76,7 +77,7 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
assertEq(setter.value(), 0);
assertEq(setter.value(), 0);
}
}
function test_onlyOwner() external {
function test_onlyOwner
_succeeds
() external {
address owner = setter.owner();
address owner = setter.owner();
// Simulate the L2 execution where the call is coming from
// Simulate the L2 execution where the call is coming from
...
...
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