Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
25ba846b
Unverified
Commit
25ba846b
authored
Aug 08, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Tidy up game helpers
parent
cdf9ab14
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
cannon_helper.go
op-e2e/e2eutils/disputegame/cannon_helper.go
+1
-2
game_helper.go
op-e2e/e2eutils/disputegame/game_helper.go
+7
-7
No files found.
op-e2e/e2eutils/disputegame/cannon_helper.go
View file @
25ba846b
...
@@ -18,8 +18,7 @@ func (g *CannonGameHelper) StartChallenger(ctx context.Context, l1Endpoint strin
...
@@ -18,8 +18,7 @@ func (g *CannonGameHelper) StartChallenger(ctx context.Context, l1Endpoint strin
c
.
GameAddress
=
g
.
addr
c
.
GameAddress
=
g
.
addr
c
.
GameDepth
=
cannonGameDepth
c
.
GameDepth
=
cannonGameDepth
c
.
TraceType
=
config
.
TraceTypeCannon
c
.
TraceType
=
config
.
TraceTypeCannon
// By default, agree with the proposed output root
c
.
AgreeWithProposedOutput
=
false
c
.
AgreeWithProposedOutput
=
true
c
.
CannonL2
=
l2Endpoint
c
.
CannonL2
=
l2Endpoint
c
.
CannonBin
=
"../cannon/bin/cannon"
c
.
CannonBin
=
"../cannon/bin/cannon"
c
.
CannonDatadir
=
g
.
t
.
TempDir
()
c
.
CannonDatadir
=
g
.
t
.
TempDir
()
...
...
op-e2e/e2eutils/disputegame/game_helper.go
View file @
25ba846b
...
@@ -33,9 +33,9 @@ func (g *FaultGameHelper) GameDuration(ctx context.Context) time.Duration {
...
@@ -33,9 +33,9 @@ func (g *FaultGameHelper) GameDuration(ctx context.Context) time.Duration {
}
}
func
(
g
*
FaultGameHelper
)
WaitForClaimCount
(
ctx
context
.
Context
,
count
int64
)
{
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
()
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
})
actual
,
err
:=
g
.
game
.
ClaimDataLen
(
&
bind
.
CallOpts
{
Context
:
ctx
})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
...
@@ -55,9 +55,9 @@ type ContractClaim struct {
...
@@ -55,9 +55,9 @@ type ContractClaim struct {
}
}
func
(
g
*
FaultGameHelper
)
WaitForClaim
(
ctx
context
.
Context
,
predicate
func
(
claim
ContractClaim
)
bool
)
{
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
()
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
})
count
,
err
:=
g
.
game
.
ClaimDataLen
(
&
bind
.
CallOpts
{
Context
:
ctx
})
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"retrieve number of claims: %w"
,
err
)
return
false
,
fmt
.
Errorf
(
"retrieve number of claims: %w"
,
err
)
...
@@ -85,7 +85,7 @@ func (g *FaultGameHelper) WaitForClaimAtMaxDepth(ctx context.Context, countered
...
@@ -85,7 +85,7 @@ func (g *FaultGameHelper) WaitForClaimAtMaxDepth(ctx context.Context, countered
}
}
func
(
g
*
FaultGameHelper
)
Resolve
(
ctx
context
.
Context
)
{
func
(
g
*
FaultGameHelper
)
Resolve
(
ctx
context
.
Context
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
1
*
time
.
Minute
)
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
time
.
Minute
)
defer
cancel
()
defer
cancel
()
tx
,
err
:=
g
.
game
.
Resolve
(
g
.
opts
)
tx
,
err
:=
g
.
game
.
Resolve
(
g
.
opts
)
g
.
require
.
NoError
(
err
)
g
.
require
.
NoError
(
err
)
...
@@ -95,9 +95,9 @@ func (g *FaultGameHelper) Resolve(ctx context.Context) {
...
@@ -95,9 +95,9 @@ func (g *FaultGameHelper) Resolve(ctx context.Context) {
func
(
g
*
FaultGameHelper
)
WaitForGameStatus
(
ctx
context
.
Context
,
expected
Status
)
{
func
(
g
*
FaultGameHelper
)
WaitForGameStatus
(
ctx
context
.
Context
,
expected
Status
)
{
g
.
t
.
Logf
(
"Waiting for game %v to have status %v"
,
g
.
addr
,
expected
)
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
()
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
)
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
30
*
time
.
Second
)
defer
cancel
()
defer
cancel
()
status
,
err
:=
g
.
game
.
Status
(
&
bind
.
CallOpts
{
Context
:
ctx
})
status
,
err
:=
g
.
game
.
Status
(
&
bind
.
CallOpts
{
Context
:
ctx
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment