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
384e2dc7
Unverified
Commit
384e2dc7
authored
Jun 07, 2024
by
Adrian Sutton
Committed by
GitHub
Jun 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
challenger: Allow interrupting subcommands. (#10765)
parent
c04ca0c4
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
7 deletions
+14
-7
create_game.go
op-challenger/cmd/create_game.go
+1
-1
credits.go
op-challenger/cmd/credits.go
+1
-1
list_claims.go
op-challenger/cmd/list_claims.go
+1
-1
list_games.go
op-challenger/cmd/list_games.go
+1
-1
move.go
op-challenger/cmd/move.go
+1
-1
resolve.go
op-challenger/cmd/resolve.go
+1
-1
resolve_claim.go
op-challenger/cmd/resolve_claim.go
+1
-1
utils.go
op-challenger/cmd/utils.go
+7
-0
No files found.
op-challenger/cmd/create_game.go
View file @
384e2dc7
...
@@ -76,6 +76,6 @@ var CreateGameCommand = &cli.Command{
...
@@ -76,6 +76,6 @@ var CreateGameCommand = &cli.Command{
Name
:
"create-game"
,
Name
:
"create-game"
,
Usage
:
"Creates a dispute game via the factory"
,
Usage
:
"Creates a dispute game via the factory"
,
Description
:
"Creates a dispute game via the factory"
,
Description
:
"Creates a dispute game via the factory"
,
Action
:
CreateGame
,
Action
:
Interruptible
(
CreateGame
)
,
Flags
:
createGameFlags
(),
Flags
:
createGameFlags
(),
}
}
op-challenger/cmd/credits.go
View file @
384e2dc7
...
@@ -112,6 +112,6 @@ var ListCreditsCommand = &cli.Command{
...
@@ -112,6 +112,6 @@ var ListCreditsCommand = &cli.Command{
Name
:
"list-credits"
,
Name
:
"list-credits"
,
Usage
:
"List the credits in a dispute game"
,
Usage
:
"List the credits in a dispute game"
,
Description
:
"Lists the credits in a dispute game"
,
Description
:
"Lists the credits in a dispute game"
,
Action
:
ListCredits
,
Action
:
Interruptible
(
ListCredits
)
,
Flags
:
listCreditsFlags
(),
Flags
:
listCreditsFlags
(),
}
}
op-challenger/cmd/list_claims.go
View file @
384e2dc7
...
@@ -198,6 +198,6 @@ var ListClaimsCommand = &cli.Command{
...
@@ -198,6 +198,6 @@ var ListClaimsCommand = &cli.Command{
Name
:
"list-claims"
,
Name
:
"list-claims"
,
Usage
:
"List the claims in a dispute game"
,
Usage
:
"List the claims in a dispute game"
,
Description
:
"Lists the claims in a dispute game"
,
Description
:
"Lists the claims in a dispute game"
,
Action
:
ListClaims
,
Action
:
Interruptible
(
ListClaims
)
,
Flags
:
listClaimsFlags
(),
Flags
:
listClaimsFlags
(),
}
}
op-challenger/cmd/list_games.go
View file @
384e2dc7
...
@@ -183,6 +183,6 @@ var ListGamesCommand = &cli.Command{
...
@@ -183,6 +183,6 @@ var ListGamesCommand = &cli.Command{
Name
:
"list-games"
,
Name
:
"list-games"
,
Usage
:
"List the games created by a dispute game factory"
,
Usage
:
"List the games created by a dispute game factory"
,
Description
:
"Lists the games created by a dispute game factory"
,
Description
:
"Lists the games created by a dispute game factory"
,
Action
:
ListGames
,
Action
:
Interruptible
(
ListGames
)
,
Flags
:
listGamesFlags
(),
Flags
:
listGamesFlags
(),
}
}
op-challenger/cmd/move.go
View file @
384e2dc7
...
@@ -97,6 +97,6 @@ var MoveCommand = &cli.Command{
...
@@ -97,6 +97,6 @@ var MoveCommand = &cli.Command{
Name
:
"move"
,
Name
:
"move"
,
Usage
:
"Creates and sends a move transaction to the dispute game"
,
Usage
:
"Creates and sends a move transaction to the dispute game"
,
Description
:
"Creates and sends a move transaction to the dispute game"
,
Description
:
"Creates and sends a move transaction to the dispute game"
,
Action
:
Move
,
Action
:
Interruptible
(
Move
)
,
Flags
:
moveFlags
(),
Flags
:
moveFlags
(),
}
}
op-challenger/cmd/resolve.go
View file @
384e2dc7
...
@@ -46,6 +46,6 @@ var ResolveCommand = &cli.Command{
...
@@ -46,6 +46,6 @@ var ResolveCommand = &cli.Command{
Name
:
"resolve"
,
Name
:
"resolve"
,
Usage
:
"Resolves the specified dispute game if possible"
,
Usage
:
"Resolves the specified dispute game if possible"
,
Description
:
"Resolves the specified dispute game if possible"
,
Description
:
"Resolves the specified dispute game if possible"
,
Action
:
Resolve
,
Action
:
Interruptible
(
Resolve
)
,
Flags
:
resolveFlags
(),
Flags
:
resolveFlags
(),
}
}
op-challenger/cmd/resolve_claim.go
View file @
384e2dc7
...
@@ -66,6 +66,6 @@ var ResolveClaimCommand = &cli.Command{
...
@@ -66,6 +66,6 @@ var ResolveClaimCommand = &cli.Command{
Name
:
"resolve-claim"
,
Name
:
"resolve-claim"
,
Usage
:
"Resolves the specified claim if possible"
,
Usage
:
"Resolves the specified claim if possible"
,
Description
:
"Resolves the specified claim if possible"
,
Description
:
"Resolves the specified claim if possible"
,
Action
:
ResolveClaim
,
Action
:
Interruptible
(
ResolveClaim
)
,
Flags
:
resolveClaimFlags
(),
Flags
:
resolveClaimFlags
(),
}
}
op-challenger/cmd/utils.go
View file @
384e2dc7
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
contractMetrics
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts/metrics"
contractMetrics
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts/metrics"
opservice
"github.com/ethereum-optimism/optimism/op-service"
opservice
"github.com/ethereum-optimism/optimism/op-service"
"github.com/ethereum-optimism/optimism/op-service/dial"
"github.com/ethereum-optimism/optimism/op-service/dial"
"github.com/ethereum-optimism/optimism/op-service/opio"
"github.com/ethereum-optimism/optimism/op-service/sources/batching"
"github.com/ethereum-optimism/optimism/op-service/sources/batching"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum-optimism/optimism/op-service/txmgr/metrics"
"github.com/ethereum-optimism/optimism/op-service/txmgr/metrics"
...
@@ -17,6 +18,12 @@ import (
...
@@ -17,6 +18,12 @@ import (
type
ContractCreator
[
T
any
]
func
(
context
.
Context
,
contractMetrics
.
ContractMetricer
,
common
.
Address
,
*
batching
.
MultiCaller
)
(
T
,
error
)
type
ContractCreator
[
T
any
]
func
(
context
.
Context
,
contractMetrics
.
ContractMetricer
,
common
.
Address
,
*
batching
.
MultiCaller
)
(
T
,
error
)
func
Interruptible
(
action
cli
.
ActionFunc
)
cli
.
ActionFunc
{
return
func
(
ctx
*
cli
.
Context
)
error
{
ctx
.
Context
=
opio
.
CancelOnInterrupt
(
ctx
.
Context
)
return
action
(
ctx
)
}
}
func
AddrFromFlag
(
flagName
string
)
func
(
ctx
*
cli
.
Context
)
(
common
.
Address
,
error
)
{
func
AddrFromFlag
(
flagName
string
)
func
(
ctx
*
cli
.
Context
)
(
common
.
Address
,
error
)
{
return
func
(
ctx
*
cli
.
Context
)
(
common
.
Address
,
error
)
{
return
func
(
ctx
*
cli
.
Context
)
(
common
.
Address
,
error
)
{
gameAddr
,
err
:=
opservice
.
ParseAddress
(
ctx
.
String
(
flagName
))
gameAddr
,
err
:=
opservice
.
ParseAddress
(
ctx
.
String
(
flagName
))
...
...
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