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
9fc18379
Commit
9fc18379
authored
Nov 30, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for invalid claims at the split depth
parent
59677ca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
OutputBisectionGame.t.sol
.../contracts-bedrock/test/dispute/OutputBisectionGame.t.sol
+21
-2
No files found.
packages/contracts-bedrock/test/dispute/OutputBisectionGame.t.sol
View file @
9fc18379
...
@@ -125,7 +125,7 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
...
@@ -125,7 +125,7 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
}
}
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// `IOutputBisectionGame` Implementation Tests
//
// `IOutputBisectionGame` Implementation Tests //
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/// @dev Tests that the game is initialized with the correct data.
/// @dev Tests that the game is initialized with the correct data.
...
@@ -323,6 +323,26 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
...
@@ -323,6 +323,26 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
);
);
}
}
/// @dev Tests that making a claim at the execution trace bisection root level with an invalid status
/// byte reverts with the `UnexpectedRootClaim` error.
function test_move_incorrectStatusExecRoot_reverts() public {
for (uint256 i; i < 4; i++) {
gameProxy.attack(i, Claim.wrap(bytes32(uint256(5))));
}
vm.expectRevert(abi.encodeWithSelector(UnexpectedRootClaim.selector, bytes32(0)));
gameProxy.attack(4, Claim.wrap(bytes32(0)));
}
/// @dev Tests that making a claim at the execution trace bisection root level with a valid status
/// byte succeeds.
function test_move_correctStatusExecRoot_succeeds() public {
for (uint256 i; i < 4; i++) {
gameProxy.attack(i, Claim.wrap(bytes32(uint256(5))));
}
gameProxy.attack(4, ROOT_CLAIM);
}
/// @dev Static unit test for the correctness an uncontested root resolution.
/// @dev Static unit test for the correctness an uncontested root resolution.
function test_resolve_rootUncontested_succeeds() public {
function test_resolve_rootUncontested_succeeds() public {
vm.warp(block.timestamp + 3 days + 12 hours + 1 seconds);
vm.warp(block.timestamp + 3 days + 12 hours + 1 seconds);
...
@@ -487,7 +507,6 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
...
@@ -487,7 +507,6 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
// Expected start/disputed claims
// Expected start/disputed claims
bytes32 startingClaim = Hash.unwrap(GENESIS_OUTPUT_ROOT);
bytes32 startingClaim = Hash.unwrap(GENESIS_OUTPUT_ROOT);
Position startingPos = LibPosition.wrap(0, 0);
bytes32 disputedClaim = bytes32(uint256(3));
bytes32 disputedClaim = bytes32(uint256(3));
Position disputedPos = LibPosition.wrap(4, 0);
Position disputedPos = LibPosition.wrap(4, 0);
...
...
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