Commit 3ea3937e authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: refactor test

Use the same init logic for the factory in multiple places
parent e6b251da
......@@ -29,6 +29,7 @@ contract DisputeGameFactory_Initializer is Test {
_data: abi.encodeCall(impl.initialize, (address(this)))
});
factory = DisputeGameFactory(address(proxy));
vm.label(address(factory), "DisputeGameFactoryProxy");
}
}
......
......@@ -2,6 +2,7 @@
pragma solidity ^0.8.15;
import { Test } from "forge-std/Test.sol";
import { DisputeGameFactory_Initializer } from "./DisputeGameFactory.t.sol";
import { DisputeGameFactory } from "../dispute/DisputeGameFactory.sol";
import { FaultDisputeGame } from "../dispute/FaultDisputeGame.sol";
......@@ -10,7 +11,7 @@ import "../libraries/DisputeErrors.sol";
import { LibClock } from "../dispute/lib/LibClock.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.
*/
......@@ -28,10 +29,6 @@ contract FaultDisputeGame_Test is Test {
*/
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.
*/
......@@ -43,10 +40,8 @@ contract FaultDisputeGame_Test is Test {
event Move(uint256 indexed parentIndex, Claim indexed pivot, address indexed claimant);
function setUp() public {
// Deploy a new dispute game factory.
factory = new DisputeGameFactory();
factory.initialize(address(this));
function setUp() public override {
super.setUp();
// Deploy an implementation of the fault game
gameImpl = new FaultDisputeGame();
// Register the game implementation with the factory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment