Commit 5a364314 authored by clabby's avatar clabby

Add check for the fault implementation prior to setting it

parent 0a002e1e
...@@ -693,6 +693,7 @@ contract Deploy is Deployer { ...@@ -693,6 +693,7 @@ contract Deploy is Deployer {
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy")); DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
Claim absolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate())); Claim absolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
IBigStepper faultVm = IBigStepper(new AlphabetVM(absolutePrestate)); IBigStepper faultVm = IBigStepper(new AlphabetVM(absolutePrestate));
if (address(factory.gameImpls(GameTypes.FAULT)) == address(0)) {
factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({ factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({
_absolutePrestate: absolutePrestate, _absolutePrestate: absolutePrestate,
_maxGameDepth: cfg.faultGameMaxDepth(), _maxGameDepth: cfg.faultGameMaxDepth(),
...@@ -701,5 +702,6 @@ contract Deploy is Deployer { ...@@ -701,5 +702,6 @@ contract Deploy is Deployer {
console.log("DisputeGameFactory: set `FaultDisputeGame` implementation"); console.log("DisputeGameFactory: set `FaultDisputeGame` implementation");
} }
} }
}
} }
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