Commit 5a364314 authored by clabby's avatar clabby

Add check for the fault implementation prior to setting it

parent 0a002e1e
...@@ -693,12 +693,14 @@ contract Deploy is Deployer { ...@@ -693,12 +693,14 @@ 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));
factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({ if (address(factory.gameImpls(GameTypes.FAULT)) == address(0)) {
_absolutePrestate: absolutePrestate, factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({
_maxGameDepth: cfg.faultGameMaxDepth(), _absolutePrestate: absolutePrestate,
_vm: faultVm _maxGameDepth: cfg.faultGameMaxDepth(),
})); _vm: faultVm
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