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
7ef9e859
Unverified
Commit
7ef9e859
authored
Dec 01, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
challenger: Allow cannon and output_cannon games to be supported at the same time.
parent
5edd8208
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
config.go
op-challenger/config/config.go
+0
-4
config_test.go
op-challenger/config/config_test.go
+6
-7
No files found.
op-challenger/config/config.go
View file @
7ef9e859
...
@@ -34,7 +34,6 @@ var (
...
@@ -34,7 +34,6 @@ var (
ErrCannonNetworkAndL2Genesis
=
errors
.
New
(
"only specify one of network or l2 genesis path"
)
ErrCannonNetworkAndL2Genesis
=
errors
.
New
(
"only specify one of network or l2 genesis path"
)
ErrCannonNetworkUnknown
=
errors
.
New
(
"unknown cannon network"
)
ErrCannonNetworkUnknown
=
errors
.
New
(
"unknown cannon network"
)
ErrMissingRollupRpc
=
errors
.
New
(
"missing rollup rpc url"
)
ErrMissingRollupRpc
=
errors
.
New
(
"missing rollup rpc url"
)
ErrCannonAndOutputCannonConflict
=
errors
.
New
(
"trace types cannon and outputCannon cannot be enabled at the same time"
)
)
)
type
TraceType
string
type
TraceType
string
...
@@ -188,9 +187,6 @@ func (c Config) Check() error {
...
@@ -188,9 +187,6 @@ func (c Config) Check() error {
return
ErrCannonAndOutputCannonConflict
return
ErrCannonAndOutputCannonConflict
}
}
}
}
if
c
.
TraceTypeEnabled
(
TraceTypeCannon
)
&&
c
.
TraceTypeEnabled
(
TraceTypeOutputCannon
)
{
return
ErrCannonAndOutputCannonConflict
}
if
c
.
TraceTypeEnabled
(
TraceTypeCannon
)
||
c
.
TraceTypeEnabled
(
TraceTypeOutputCannon
)
{
if
c
.
TraceTypeEnabled
(
TraceTypeCannon
)
||
c
.
TraceTypeEnabled
(
TraceTypeOutputCannon
)
{
if
c
.
CannonBin
==
""
{
if
c
.
CannonBin
==
""
{
return
ErrMissingCannonBin
return
ErrMissingCannonBin
...
...
op-challenger/config/config_test.go
View file @
7ef9e859
...
@@ -146,12 +146,6 @@ func TestRollupRpcRequired_OutputAlphabet(t *testing.T) {
...
@@ -146,12 +146,6 @@ func TestRollupRpcRequired_OutputAlphabet(t *testing.T) {
require
.
ErrorIs
(
t
,
config
.
Check
(),
ErrMissingRollupRpc
)
require
.
ErrorIs
(
t
,
config
.
Check
(),
ErrMissingRollupRpc
)
}
}
func
TestCannotEnableBothCannonAndOutputCannonTraceTypes
(
t
*
testing
.
T
)
{
config
:=
validConfig
(
TraceTypeOutputCannon
)
config
.
TraceTypes
=
append
(
config
.
TraceTypes
,
TraceTypeCannon
)
require
.
ErrorIs
(
t
,
config
.
Check
(),
ErrCannonAndOutputCannonConflict
)
}
func
TestCannonL2Required
(
t
*
testing
.
T
)
{
func
TestCannonL2Required
(
t
*
testing
.
T
)
{
config
:=
validConfig
(
TraceTypeCannon
)
config
:=
validConfig
(
TraceTypeCannon
)
config
.
CannonL2
=
""
config
.
CannonL2
=
""
...
@@ -214,7 +208,7 @@ func TestNetworkMustBeValid(t *testing.T) {
...
@@ -214,7 +208,7 @@ func TestNetworkMustBeValid(t *testing.T) {
func
TestRequireConfigForMultipleTraceTypes
(
t
*
testing
.
T
)
{
func
TestRequireConfigForMultipleTraceTypes
(
t
*
testing
.
T
)
{
cfg
:=
validConfig
(
TraceTypeCannon
)
cfg
:=
validConfig
(
TraceTypeCannon
)
cfg
.
TraceTypes
=
[]
TraceType
{
TraceTypeCannon
,
TraceTypeAlphabet
}
cfg
.
TraceTypes
=
[]
TraceType
{
TraceTypeCannon
,
TraceTypeAlphabet
,
TraceTypeOutputCannon
}
// Set all required options and check its valid
// Set all required options and check its valid
cfg
.
RollupRpc
=
validRollupRpc
cfg
.
RollupRpc
=
validRollupRpc
cfg
.
AlphabetTrace
=
validAlphabetTrace
cfg
.
AlphabetTrace
=
validAlphabetTrace
...
@@ -228,4 +222,9 @@ func TestRequireConfigForMultipleTraceTypes(t *testing.T) {
...
@@ -228,4 +222,9 @@ func TestRequireConfigForMultipleTraceTypes(t *testing.T) {
// Require alphabet specific args
// Require alphabet specific args
cfg
.
AlphabetTrace
=
""
cfg
.
AlphabetTrace
=
""
require
.
ErrorIs
(
t
,
cfg
.
Check
(),
ErrMissingAlphabetTrace
)
require
.
ErrorIs
(
t
,
cfg
.
Check
(),
ErrMissingAlphabetTrace
)
cfg
.
AlphabetTrace
=
validAlphabetTrace
// Require output cannon specific args
cfg
.
RollupRpc
=
""
require
.
ErrorIs
(
t
,
cfg
.
Check
(),
ErrMissingRollupRpc
)
}
}
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