Commit 343177c6 authored by Maurelian's avatar Maurelian

ctb: Fix CrossDomainOwnable test name

parent b62149a0
...@@ -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);
......
...@@ -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 xdomain messenger storage slot // set the xDomainMsgSender 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
......
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