From 25ba846b2bb2a0186cf5b15b5c38ff191fec6d20 Mon Sep 17 00:00:00 2001 From: Adrian Sutton <adrian@oplabs.co> Date: Tue, 8 Aug 2023 08:40:16 +1000 Subject: [PATCH] op-e2e: Tidy up game helpers --- op-e2e/e2eutils/disputegame/cannon_helper.go | 3 +-- op-e2e/e2eutils/disputegame/game_helper.go | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/op-e2e/e2eutils/disputegame/cannon_helper.go b/op-e2e/e2eutils/disputegame/cannon_helper.go index d6beade24..f3c90033a 100644 --- a/op-e2e/e2eutils/disputegame/cannon_helper.go +++ b/op-e2e/e2eutils/disputegame/cannon_helper.go @@ -18,8 +18,7 @@ func (g *CannonGameHelper) StartChallenger(ctx context.Context, l1Endpoint strin c.GameAddress = g.addr c.GameDepth = cannonGameDepth c.TraceType = config.TraceTypeCannon - // By default, agree with the proposed output root - c.AgreeWithProposedOutput = true + c.AgreeWithProposedOutput = false c.CannonL2 = l2Endpoint c.CannonBin = "../cannon/bin/cannon" c.CannonDatadir = g.t.TempDir() diff --git a/op-e2e/e2eutils/disputegame/game_helper.go b/op-e2e/e2eutils/disputegame/game_helper.go index de99183db..b14f9ff6e 100644 --- a/op-e2e/e2eutils/disputegame/game_helper.go +++ b/op-e2e/e2eutils/disputegame/game_helper.go @@ -33,9 +33,9 @@ func (g *FaultGameHelper) GameDuration(ctx context.Context) time.Duration { } func (g *FaultGameHelper) WaitForClaimCount(ctx context.Context, count int64) { - ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + ctx, cancel := context.WithTimeout(ctx, time.Minute) defer cancel() - err := utils.WaitFor(ctx, 1*time.Second, func() (bool, error) { + err := utils.WaitFor(ctx, time.Second, func() (bool, error) { actual, err := g.game.ClaimDataLen(&bind.CallOpts{Context: ctx}) if err != nil { return false, err @@ -55,9 +55,9 @@ type ContractClaim struct { } func (g *FaultGameHelper) WaitForClaim(ctx context.Context, predicate func(claim ContractClaim) bool) { - ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + ctx, cancel := context.WithTimeout(ctx, time.Minute) defer cancel() - err := utils.WaitFor(ctx, 1*time.Second, func() (bool, error) { + err := utils.WaitFor(ctx, time.Second, func() (bool, error) { count, err := g.game.ClaimDataLen(&bind.CallOpts{Context: ctx}) if err != nil { return false, fmt.Errorf("retrieve number of claims: %w", err) @@ -85,7 +85,7 @@ func (g *FaultGameHelper) WaitForClaimAtMaxDepth(ctx context.Context, countered } func (g *FaultGameHelper) Resolve(ctx context.Context) { - ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + ctx, cancel := context.WithTimeout(ctx, time.Minute) defer cancel() tx, err := g.game.Resolve(g.opts) g.require.NoError(err) @@ -95,9 +95,9 @@ func (g *FaultGameHelper) Resolve(ctx context.Context) { func (g *FaultGameHelper) WaitForGameStatus(ctx context.Context, expected Status) { g.t.Logf("Waiting for game %v to have status %v", g.addr, expected) - ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + ctx, cancel := context.WithTimeout(ctx, time.Minute) defer cancel() - err := utils.WaitFor(ctx, 1*time.Second, func() (bool, error) { + err := utils.WaitFor(ctx, time.Second, func() (bool, error) { ctx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() status, err := g.game.Status(&bind.CallOpts{Context: ctx}) -- 2.23.0