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
3ea3937e
Commit
3ea3937e
authored
Jun 16, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: refactor test
Use the same init logic for the factory in multiple places
parent
e6b251da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
DisputeGameFactory.t.sol
...contracts-bedrock/contracts/test/DisputeGameFactory.t.sol
+1
-0
FaultDisputeGame.t.sol
...s/contracts-bedrock/contracts/test/FaultDisputeGame.t.sol
+4
-9
No files found.
packages/contracts-bedrock/contracts/test/DisputeGameFactory.t.sol
View file @
3ea3937e
...
@@ -29,6 +29,7 @@ contract DisputeGameFactory_Initializer is Test {
...
@@ -29,6 +29,7 @@ contract DisputeGameFactory_Initializer is Test {
_data: abi.encodeCall(impl.initialize, (address(this)))
_data: abi.encodeCall(impl.initialize, (address(this)))
});
});
factory = DisputeGameFactory(address(proxy));
factory = DisputeGameFactory(address(proxy));
vm.label(address(factory), "DisputeGameFactoryProxy");
}
}
}
}
...
...
packages/contracts-bedrock/contracts/test/FaultDisputeGame.t.sol
View file @
3ea3937e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
pragma solidity ^0.8.15;
pragma solidity ^0.8.15;
import { Test } from "forge-std/Test.sol";
import { Test } from "forge-std/Test.sol";
import { DisputeGameFactory_Initializer } from "./DisputeGameFactory.t.sol";
import { DisputeGameFactory } from "../dispute/DisputeGameFactory.sol";
import { DisputeGameFactory } from "../dispute/DisputeGameFactory.sol";
import { FaultDisputeGame } from "../dispute/FaultDisputeGame.sol";
import { FaultDisputeGame } from "../dispute/FaultDisputeGame.sol";
...
@@ -10,7 +11,7 @@ import "../libraries/DisputeErrors.sol";
...
@@ -10,7 +11,7 @@ import "../libraries/DisputeErrors.sol";
import { LibClock } from "../dispute/lib/LibClock.sol";
import { LibClock } from "../dispute/lib/LibClock.sol";
import { LibPosition } from "../dispute/lib/LibPosition.sol";
import { LibPosition } from "../dispute/lib/LibPosition.sol";
contract FaultDisputeGame_Test is
Test
{
contract FaultDisputeGame_Test is
DisputeGameFactory_Initializer
{
/**
/**
* @dev The root claim of the game.
* @dev The root claim of the game.
*/
*/
...
@@ -28,10 +29,6 @@ contract FaultDisputeGame_Test is Test {
...
@@ -28,10 +29,6 @@ contract FaultDisputeGame_Test is Test {
*/
*/
string internal constant VERSION = "0.0.1";
string internal constant VERSION = "0.0.1";
/**
* @dev The factory that will be used to create the game.
*/
DisputeGameFactory internal factory;
/**
/**
* @dev The implementation of the game.
* @dev The implementation of the game.
*/
*/
...
@@ -43,10 +40,8 @@ contract FaultDisputeGame_Test is Test {
...
@@ -43,10 +40,8 @@ contract FaultDisputeGame_Test is Test {
event Move(uint256 indexed parentIndex, Claim indexed pivot, address indexed claimant);
event Move(uint256 indexed parentIndex, Claim indexed pivot, address indexed claimant);
function setUp() public {
function setUp() public override {
// Deploy a new dispute game factory.
super.setUp();
factory = new DisputeGameFactory();
factory.initialize(address(this));
// Deploy an implementation of the fault game
// Deploy an implementation of the fault game
gameImpl = new FaultDisputeGame();
gameImpl = new FaultDisputeGame();
// Register the game implementation with the factory.
// Register the game implementation with the factory.
...
...
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