Commit 9743a364 authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

Merge pull request #8432 from ethereum-optimism/aj/output_cannon_e2e

op-e2e: Update output_cannon e2e test to execute a step and resolve the game
parents 1c013805 88e243d5
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
op_e2e "github.com/ethereum-optimism/optimism/op-e2e" op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
...@@ -42,4 +43,25 @@ func TestOutputCannonGame(t *testing.T) { ...@@ -42,4 +43,25 @@ func TestOutputCannonGame(t *testing.T) {
// Wait for the challenger to post the first claim in the cannon trace // Wait for the challenger to post the first claim in the cannon trace
game.WaitForClaimAtDepth(ctx, int(splitDepth+1)) game.WaitForClaimAtDepth(ctx, int(splitDepth+1))
game.LogGameData(ctx) game.LogGameData(ctx)
game.Attack(ctx, splitDepth+1, common.Hash{0x00, 0xcc})
gameDepth := game.MaxDepth(ctx)
for i := splitDepth + 3; i < gameDepth; i += 2 {
// Wait for challenger to respond
game.WaitForClaimAtDepth(ctx, int(i))
game.LogGameData(ctx)
// Respond to push the game down to the max depth
game.Defend(ctx, i, common.Hash{0x00, 0xdd})
game.LogGameData(ctx)
}
game.LogGameData(ctx)
// Challenger should be able to call step and counter the leaf claim.
game.WaitForClaimAtMaxDepth(ctx, true)
game.LogGameData(ctx)
sys.TimeTravelClock.AdvanceTime(game.GameDuration(ctx))
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForGameStatus(ctx, disputegame.StatusChallengerWins)
} }
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