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
cf9579a9
Unverified
Commit
cf9579a9
authored
Feb 07, 2024
by
clabby
Committed by
GitHub
Feb 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dispute game factory test updates (#9400)
parent
64e7d9ac
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
73 deletions
+68
-73
DisputeGameFactory.t.sol
...s/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol
+59
-65
FaultDisputeGame.t.sol
...ges/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol
+9
-8
No files found.
packages/contracts-bedrock/test/dispute/DisputeGameFactory.t.sol
View file @
cf9579a9
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol
View file @
cf9579a9
...
@@ -63,9 +63,9 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
...
@@ -63,9 +63,9 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
_vm: _vm
_vm: _vm
});
});
// Register the game implementation with the factory.
// Register the game implementation with the factory.
f
actory.setImplementation(GAME_TYPE, gameImpl);
disputeGameF
actory.setImplementation(GAME_TYPE, gameImpl);
// Create a new game.
// Create a new game.
gameProxy = FaultDisputeGame(address(
f
actory.create(GAME_TYPE, rootClaim, extraData)));
gameProxy = FaultDisputeGame(address(
disputeGameF
actory.create(GAME_TYPE, rootClaim, extraData)));
// Check immutables
// Check immutables
assertEq(gameProxy.gameType().raw(), GAME_TYPE.raw());
assertEq(gameProxy.gameType().raw(), GAME_TYPE.raw());
...
@@ -174,7 +174,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
...
@@ -174,7 +174,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
Claim claim = _dummyClaim();
Claim claim = _dummyClaim();
vm.expectRevert(abi.encodeWithSelector(UnexpectedRootClaim.selector, claim));
vm.expectRevert(abi.encodeWithSelector(UnexpectedRootClaim.selector, claim));
gameProxy = FaultDisputeGame(address(
f
actory.create(GAME_TYPE, claim, abi.encode(_blockNumber))));
gameProxy = FaultDisputeGame(address(
disputeGameF
actory.create(GAME_TYPE, claim, abi.encode(_blockNumber))));
}
}
/// @dev Tests that the proxy receives ETH from the dispute game factory.
/// @dev Tests that the proxy receives ETH from the dispute game factory.
...
@@ -183,7 +183,8 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
...
@@ -183,7 +183,8 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
vm.deal(address(this), _value);
vm.deal(address(this), _value);
assertEq(address(gameProxy).balance, 0);
assertEq(address(gameProxy).balance, 0);
gameProxy = FaultDisputeGame(address(factory.create{ value: _value }(GAME_TYPE, ROOT_CLAIM, abi.encode(1))));
gameProxy =
FaultDisputeGame(address(disputeGameFactory.create{ value: _value }(GAME_TYPE, ROOT_CLAIM, abi.encode(1))));
assertEq(address(gameProxy).balance, _value);
assertEq(address(gameProxy).balance, _value);
}
}
...
@@ -206,7 +207,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
...
@@ -206,7 +207,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
Claim claim = _dummyClaim();
Claim claim = _dummyClaim();
vm.expectRevert(abi.encodeWithSelector(ExtraDataTooLong.selector));
vm.expectRevert(abi.encodeWithSelector(ExtraDataTooLong.selector));
gameProxy = FaultDisputeGame(address(
f
actory.create(GAME_TYPE, claim, _extraData)));
gameProxy = FaultDisputeGame(address(
disputeGameF
actory.create(GAME_TYPE, claim, _extraData)));
}
}
/// @dev Tests that the game is initialized with the correct data.
/// @dev Tests that the game is initialized with the correct data.
...
@@ -629,7 +630,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
...
@@ -629,7 +630,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
assertEq(address(gameProxy).balance, 0);
assertEq(address(gameProxy).balance, 0);
// Ensure that the init bond for the game is 0, in case we change it in the test suite in the future.
// Ensure that the init bond for the game is 0, in case we change it in the test suite in the future.
assertEq(
f
actory.initBonds(GAME_TYPE), 0);
assertEq(
disputeGameF
actory.initBonds(GAME_TYPE), 0);
}
}
/// @dev Static unit test asserting that resolve pays out bonds on step, output bisection, and execution trace
/// @dev Static unit test asserting that resolve pays out bonds on step, output bisection, and execution trace
...
@@ -691,7 +692,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
...
@@ -691,7 +692,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
assertEq(address(gameProxy).balance, 0);
assertEq(address(gameProxy).balance, 0);
// Ensure that the init bond for the game is 0, in case we change it in the test suite in the future.
// Ensure that the init bond for the game is 0, in case we change it in the test suite in the future.
assertEq(
f
actory.initBonds(GAME_TYPE), 0);
assertEq(
disputeGameF
actory.initBonds(GAME_TYPE), 0);
}
}
/// @dev Static unit test asserting that resolve pays out bonds on moves to the leftmost actor
/// @dev Static unit test asserting that resolve pays out bonds on moves to the leftmost actor
...
@@ -743,7 +744,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
...
@@ -743,7 +744,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
assertEq(address(gameProxy).balance, 0);
assertEq(address(gameProxy).balance, 0);
// Ensure that the init bond for the game is 0, in case we change it in the test suite in the future.
// Ensure that the init bond for the game is 0, in case we change it in the test suite in the future.
assertEq(
f
actory.initBonds(GAME_TYPE), 0);
assertEq(
disputeGameF
actory.initBonds(GAME_TYPE), 0);
}
}
/// @dev Static unit test asserting that credit may not be drained past allowance through reentrancy.
/// @dev Static unit test asserting that credit may not be drained past allowance through reentrancy.
...
...
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