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
61843b80
Unverified
Commit
61843b80
authored
Dec 06, 2022
by
mergify[bot]
Committed by
GitHub
Dec 06, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4247 from ethereum-optimism/jm/ctb-test-cleanup/5
Rename CrossDomainOwnable, L1Block and L1BlockNumber tests
parents
83cd4177
cbae1cbf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
36 deletions
+36
-36
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+16
-17
CrossDomainOwnable.t.sol
...contracts-bedrock/contracts/test/CrossDomainOwnable.t.sol
+3
-3
CrossDomainOwnable2.t.sol
...ontracts-bedrock/contracts/test/CrossDomainOwnable2.t.sol
+7
-6
L1Block.t.sol
packages/contracts-bedrock/contracts/test/L1Block.t.sol
+7
-7
L1BlockNumber.t.sol
...ages/contracts-bedrock/contracts/test/L1BlockNumber.t.sol
+3
-3
No files found.
packages/contracts-bedrock/.gas-snapshot
View file @
61843b80
...
...
@@ -9,13 +9,13 @@ GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 88513)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 74953)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 36044)
CrossDomainMessenger_BaseGas_Test:test_baseGas_succeeds() (gas: 20098)
CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner() (gas: 61806)
CrossDomainOwnable_Test:test_onlyOwner
() (gas: 34861
)
CrossDomainOwnable_Test:test_
revertOnlyOwner() (gas: 10530
)
CrossDomainOwnable2_Test:test_onlyOwner
() (gas: 77782
)
CrossDomainOwnable2_Test:test_
revertNotSetOnlyOwner() (gas: 8461
)
CrossDomainOwnable2_Test:test_
revertNotSetOnlyOwner2() (gas: 14565
)
CrossDomainOwnable2_Test:test_
revertOnlyOwner() (gas: 6171
2)
CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner
_succeeds
() (gas: 61806)
CrossDomainOwnable_Test:test_onlyOwner
_notOwner_reverts() (gas: 10530
)
CrossDomainOwnable_Test:test_
onlyOwner_succeeds() (gas: 34861
)
CrossDomainOwnable2_Test:test_onlyOwner
_notMessenger_reverts() (gas: 8416
)
CrossDomainOwnable2_Test:test_
onlyOwner_notOwner2_reverts() (gas: 61733
)
CrossDomainOwnable2_Test:test_
onlyOwner_notOwner_reverts() (gas: 16588
)
CrossDomainOwnable2_Test:test_
onlyOwner_succeeds() (gas: 7778
2)
DeployerWhitelist_Test:test_owner() (gas: 7516)
DeployerWhitelist_Test:test_storageSlots() (gas: 33395)
FeeVault_Test:test_constructor_succeeds() (gas: 10601)
...
...
@@ -28,16 +28,15 @@ GasPriceOracle_Test:test_scalar_succeeds() (gas: 10611)
GasPriceOracle_Test:test_setGasPrice_doesNotExist_reverts() (gas: 5910)
GasPriceOracle_Test:test_setL1BaseFee_doesNotExist_reverts() (gas: 5910)
Hashing_Test:test_hashDepositSource_succeeds() (gas: 650)
L1BlockTest:test_basefee() (gas: 7531)
L1BlockTest:test_hash() (gas: 7553)
L1BlockTest:test_number() (gas: 7608)
L1BlockTest:test_sequenceNumber() (gas: 7673)
L1BlockTest:test_timestamp() (gas: 7594)
L1BlockTest:test_updateValues() (gas: 60459)
L1BlockTest:test_updatesValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256) (runs: 256, μ: 69416, ~: 70615)
L1BlockNumberTest:test_fallback() (gas: 18611)
L1BlockNumberTest:test_getL1BlockNumber() (gas: 10602)
L1BlockNumberTest:test_receive() (gas: 25341)
L1BlockTest:test_basefee_succeeds() (gas: 7553)
L1BlockTest:test_hash_succeeds() (gas: 7510)
L1BlockTest:test_number_succeeds() (gas: 7584)
L1BlockTest:test_sequenceNumber_succeeds() (gas: 7630)
L1BlockTest:test_timestamp_succeeds() (gas: 7595)
L1BlockTest:test_updateValues_succeeds() (gas: 60481)
L1BlockNumberTest:test_fallback_succeeds() (gas: 18633)
L1BlockNumberTest:test_getL1BlockNumber_succeeds() (gas: 10603)
L1BlockNumberTest:test_receive_succeeds() (gas: 25340)
L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 24538)
L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 24496)
L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 24715)
...
...
packages/contracts-bedrock/contracts/test/CrossDomainOwnable.t.sol
View file @
61843b80
...
...
@@ -23,13 +23,13 @@ contract CrossDomainOwnable_Test is CommonTest {
}
// 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");
setter.set(1);
}
// Check that making a call can set the value properly
function test_onlyOwner() external {
function test_onlyOwner
_succeeds
() external {
assertEq(setter.value(), 0);
vm.prank(AddressAliasHelper.applyL1ToL2Alias(setter.owner()));
...
...
@@ -48,7 +48,7 @@ contract CrossDomainOwnableThroughPortal_Test is Portal_Initializer {
setter = new XDomainSetter();
}
function test_depositTransaction_crossDomainOwner() external {
function test_depositTransaction_crossDomainOwner
_succeeds
() external {
vm.recordLogs();
vm.prank(alice);
...
...
packages/contracts-bedrock/contracts/test/CrossDomainOwnable2.t.sol
View file @
61843b80
...
...
@@ -25,15 +25,15 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
setter = new XDomainSetter2();
}
function test_
revertNotSetOnlyOwner
() external {
function test_
onlyOwner_notMessenger_reverts
() external {
vm.expectRevert("CrossDomainOwnable2: caller is not the messenger");
setter.set(1);
}
function test_
revertNotSetOnlyOwner2
() external {
// set the x
domain messeng
er storage slot
function test_
onlyOwner_notOwner_reverts
() external {
// set the x
DomainMsgSend
er storage slot
bytes32 key = bytes32(uint256(204));
bytes32 value = Bytes32AddressLib.fillLast12Bytes(address(
setter
));
bytes32 value = Bytes32AddressLib.fillLast12Bytes(address(
alice
));
vm.store(address(L2Messenger), key, value);
vm.prank(address(L2Messenger));
...
...
@@ -41,7 +41,8 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
setter.set(1);
}
function test_revertOnlyOwner() external {
function test_onlyOwner_notOwner2_reverts() external {
uint240 nonce = 0;
address sender = bob;
address target = address(setter);
...
...
@@ -76,7 +77,7 @@ contract CrossDomainOwnable2_Test is Messenger_Initializer {
assertEq(setter.value(), 0);
}
function test_onlyOwner() external {
function test_onlyOwner
_succeeds
() external {
address owner = setter.owner();
// Simulate the L2 execution where the call is coming from
...
...
packages/contracts-bedrock/contracts/test/L1Block.t.sol
View file @
61843b80
...
...
@@ -25,7 +25,7 @@ contract L1BlockTest is CommonTest {
});
}
function test
_updatesValue
s(
function test
Fuzz_updatesValues_succeed
s(
uint64 n,
uint64 t,
uint256 b,
...
...
@@ -47,27 +47,27 @@ contract L1BlockTest is CommonTest {
assertEq(lb.l1FeeScalar(), fs);
}
function test_number() external {
function test_number
_succeeds
() external {
assertEq(lb.number(), uint64(1));
}
function test_timestamp() external {
function test_timestamp
_succeeds
() external {
assertEq(lb.timestamp(), uint64(2));
}
function test_basefee() external {
function test_basefee
_succeeds
() external {
assertEq(lb.basefee(), 3);
}
function test_hash() external {
function test_hash
_succeeds
() external {
assertEq(lb.hash(), NON_ZERO_HASH);
}
function test_sequenceNumber() external {
function test_sequenceNumber
_succeeds
() external {
assertEq(lb.sequenceNumber(), uint64(4));
}
function test_updateValues() external {
function test_updateValues
_succeeds
() external {
vm.prank(depositor);
lb.setL1BlockValues({
_number: type(uint64).max,
...
...
packages/contracts-bedrock/contracts/test/L1BlockNumber.t.sol
View file @
61843b80
...
...
@@ -30,17 +30,17 @@ contract L1BlockNumberTest is Test {
});
}
function test_getL1BlockNumber() external {
function test_getL1BlockNumber
_succeeds
() external {
assertEq(bn.getL1BlockNumber(), number);
}
function test_fallback() external {
function test_fallback
_succeeds
() external {
(bool success, bytes memory ret) = address(bn).call(hex"");
assertEq(success, true);
assertEq(ret, abi.encode(number));
}
function test_receive() external {
function test_receive
_succeeds
() external {
(bool success, bytes memory ret) = address(bn).call{ value: 1 }(hex"");
assertEq(success, true);
assertEq(ret, abi.encode(number));
...
...
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