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
af78ef3f
Commit
af78ef3f
authored
Jul 25, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Negative test for `loadLocalData`
parent
0eb8edea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+3
-2
PreimageOracle.t.sol
packages/contracts-bedrock/test/PreimageOracle.t.sol
+9
-0
No files found.
packages/contracts-bedrock/.gas-snapshot
View file @
af78ef3f
...
@@ -437,8 +437,9 @@ OptimistTest:test_tokenURI_returnsCorrectTokenURI_succeeds() (gas: 195908)
...
@@ -437,8 +437,9 @@ OptimistTest:test_tokenURI_returnsCorrectTokenURI_succeeds() (gas: 195908)
OptimistTest:test_transferFrom_soulbound_reverts() (gas: 75512)
OptimistTest:test_transferFrom_soulbound_reverts() (gas: 75512)
PreimageOracle_Test:test_keccak256PreimageKey_succeeds() (gas: 420)
PreimageOracle_Test:test_keccak256PreimageKey_succeeds() (gas: 420)
PreimageOracle_Test:test_loadKeccak256PreimagePart_outOfBoundsOffset_reverts() (gas: 8864)
PreimageOracle_Test:test_loadKeccak256PreimagePart_outOfBoundsOffset_reverts() (gas: 8864)
PreimageOracle_Test:test_loadKeccak256PreimagePart_succeeds() (gas: 76518)
PreimageOracle_Test:test_loadKeccak256PreimagePart_succeeds() (gas: 76541)
PreimageOracle_Test:test_loadLocalData_onePart_succeeds() (gas: 76339)
PreimageOracle_Test:test_loadLocalData_onePart_succeeds() (gas: 76317)
PreimageOracle_Test:test_loadLocalData_outOfBoundsOffset_reverts() (gas: 8865)
ProxyAdmin_Test:test_chugsplashChangeProxyAdmin_succeeds() (gas: 35586)
ProxyAdmin_Test:test_chugsplashChangeProxyAdmin_succeeds() (gas: 35586)
ProxyAdmin_Test:test_chugsplashGetProxyAdmin_succeeds() (gas: 15675)
ProxyAdmin_Test:test_chugsplashGetProxyAdmin_succeeds() (gas: 15675)
ProxyAdmin_Test:test_chugsplashGetProxyImplementation_succeeds() (gas: 51084)
ProxyAdmin_Test:test_chugsplashGetProxyImplementation_succeeds() (gas: 51084)
...
...
packages/contracts-bedrock/test/PreimageOracle.t.sol
View file @
af78ef3f
...
@@ -104,6 +104,15 @@ contract PreimageOracle_Test is Test {
...
@@ -104,6 +104,15 @@ contract PreimageOracle_Test is Test {
assertTrue(ok);
assertTrue(ok);
}
}
/// @notice Tests that a pre-image cannot be set with an out-of-bounds offset.
function test_loadLocalData_outOfBoundsOffset_reverts() public {
bytes32 preimage = bytes32(uint256(0xdeadbeef));
uint256 offset = preimage.length + 9;
vm.expectRevert();
oracle.loadLocalData(1, preimage, 32, offset);
}
/// @notice Tests that a pre-image cannot be set with an out-of-bounds offset.
/// @notice Tests that a pre-image cannot be set with an out-of-bounds offset.
function test_loadKeccak256PreimagePart_outOfBoundsOffset_reverts() public {
function test_loadKeccak256PreimagePart_outOfBoundsOffset_reverts() public {
bytes memory preimage = hex"deadbeef";
bytes memory preimage = hex"deadbeef";
...
...
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