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
95d39a7a
Unverified
Commit
95d39a7a
authored
May 15, 2024
by
Adrian Sutton
Committed by
GitHub
May 14, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Delete unused helpers from pre-output root support (#10532)
parent
52abfb50
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
455 deletions
+0
-455
alphabet_helper.go
op-e2e/e2eutils/disputegame/alphabet_helper.go
+0
-37
game_helper.go
op-e2e/e2eutils/disputegame/game_helper.go
+0
-363
honest_helper.go
op-e2e/e2eutils/disputegame/honest_helper.go
+0
-55
No files found.
op-e2e/e2eutils/disputegame/alphabet_helper.go
deleted
100644 → 0
View file @
52abfb50
package
disputegame
import
(
"context"
"math/big"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/alphabet"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
)
type
AlphabetGameHelper
struct
{
FaultGameHelper
}
func
(
g
*
AlphabetGameHelper
)
StartChallenger
(
ctx
context
.
Context
,
sys
challenger
.
EndpointProvider
,
name
string
,
options
...
challenger
.
Option
)
*
challenger
.
Helper
{
opts
:=
[]
challenger
.
Option
{
challenger
.
WithFactoryAddress
(
g
.
factoryAddr
),
challenger
.
WithGameAddress
(
g
.
addr
),
challenger
.
WithAlphabet
(),
}
opts
=
append
(
opts
,
options
...
)
c
:=
challenger
.
NewChallenger
(
g
.
t
,
ctx
,
sys
,
name
,
opts
...
)
g
.
t
.
Cleanup
(
func
()
{
_
=
c
.
Close
()
})
return
c
}
func
(
g
*
AlphabetGameHelper
)
CreateHonestActor
(
alphabetTrace
string
,
depth
types
.
Depth
)
*
HonestHelper
{
return
&
HonestHelper
{
t
:
g
.
t
,
require
:
g
.
require
,
game
:
&
g
.
FaultGameHelper
,
correctTrace
:
alphabet
.
NewTraceProvider
(
big
.
NewInt
(
0
),
depth
),
}
}
op-e2e/e2eutils/disputegame/game_helper.go
deleted
100644 → 0
View file @
52abfb50
This diff is collapsed.
Click to expand it.
op-e2e/e2eutils/disputegame/honest_helper.go
deleted
100644 → 0
View file @
52abfb50
package
disputegame
import
(
"context"
"testing"
"time"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/stretchr/testify/require"
)
type
HonestHelper
struct
{
t
*
testing
.
T
require
*
require
.
Assertions
game
*
FaultGameHelper
correctTrace
types
.
TraceProvider
}
func
(
h
*
HonestHelper
)
Attack
(
ctx
context
.
Context
,
claimIdx
int64
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
2
*
time
.
Minute
)
defer
cancel
()
claim
:=
h
.
game
.
getClaim
(
ctx
,
claimIdx
)
pos
:=
types
.
NewPositionFromGIndex
(
claim
.
Position
)
attackPos
:=
pos
.
Attack
()
h
.
t
.
Logf
(
"Attacking at position %v with g index %v"
,
attackPos
,
attackPos
.
ToGIndex
())
value
,
err
:=
h
.
correctTrace
.
Get
(
ctx
,
attackPos
)
h
.
require
.
NoErrorf
(
err
,
"Get correct claim at position %v with g index %v"
,
attackPos
,
attackPos
.
ToGIndex
())
h
.
t
.
Log
(
"Performing attack"
)
h
.
game
.
Attack
(
ctx
,
claimIdx
,
value
)
h
.
t
.
Log
(
"Attack complete"
)
}
func
(
h
*
HonestHelper
)
Defend
(
ctx
context
.
Context
,
claimIdx
int64
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
2
*
time
.
Minute
)
defer
cancel
()
claim
:=
h
.
game
.
getClaim
(
ctx
,
claimIdx
)
pos
:=
types
.
NewPositionFromGIndex
(
claim
.
Position
)
defendPos
:=
pos
.
Defend
()
value
,
err
:=
h
.
correctTrace
.
Get
(
ctx
,
defendPos
)
h
.
game
.
require
.
NoErrorf
(
err
,
"Get correct claim at position %v with g index %v"
,
defendPos
,
defendPos
.
ToGIndex
())
h
.
game
.
Defend
(
ctx
,
claimIdx
,
value
)
}
func
(
h
*
HonestHelper
)
StepFails
(
ctx
context
.
Context
,
claimIdx
int64
,
isAttack
bool
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
2
*
time
.
Minute
)
defer
cancel
()
pos
:=
h
.
game
.
getClaimPosition
(
ctx
,
claimIdx
)
if
!
isAttack
{
// If we're defending, then the step will be from the trace to the next one
pos
=
pos
.
MoveRight
()
}
prestate
,
proofData
,
_
,
err
:=
h
.
correctTrace
.
GetStepData
(
ctx
,
pos
)
h
.
require
.
NoError
(
err
,
"Get step data"
)
h
.
game
.
StepFails
(
claimIdx
,
isAttack
,
prestate
,
proofData
)
}
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