Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions op-e2e/config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,20 +498,24 @@ func cannonPrestate(monorepoRoot string, allocType AllocType) common.Hash {
once.Do(func() {
f, err := os.Open(path.Join(monorepoRoot, "op-program", "bin", filename))
if err != nil {
log.Error("error opening prestate file", "err", err)
log.Warn("error opening prestate file. If you're running a test that requires prestates, make sure you've run `make cannon-prestates`", "err", err)
return
}
defer f.Close()

var prestate prestateFile
dec := json.NewDecoder(f)
if err := dec.Decode(&prestate); err != nil {
log.Error("error decoding prestate file", "err", err)
log.Error("error decoding prestate file. If you're running a test that requires prestates, make sure you've run `make cannon-prestates`", "err", err)
return
}

*cacheVar = common.HexToHash(prestate.Pre)
})

// Provide a dummy value so that the DeployDisputeGame script succeeds. Many tests do not require a dispute game. So this allieviates the need to build prestates during local development.
if *cacheVar == (common.Hash{}) {
*cacheVar = common.HexToHash("0xc02b59f772cb23a75b6ffb9f7602ba25fdd5d8e75ad88efcc013fec2c63b0895") // keccak("dummy")
}
return *cacheVar
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ contract DeployDisputeGame_Test is Test {
)
public
{
vm.assume(_input.absolutePrestate != bytes32(0));
vm.assume(_input.l2ChainId != 0);
vm.assume(_gameType != 0);
vm.assume(_clockExtension != 0);
Expand Down Expand Up @@ -87,6 +88,7 @@ contract DeployDisputeGame_Test is Test {
)
public
{
vm.assume(_input.absolutePrestate != bytes32(0));
vm.assume(_input.l2ChainId != 0);
vm.assume(_gameType != 0);
vm.assume(_clockExtension != 0);
Expand Down