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
e1562379
Unverified
Commit
e1562379
authored
Apr 30, 2024
by
Adrian Sutton
Committed by
GitHub
Apr 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-challenger: Include resolution status in list-claims output (#10333)
parent
c5919e51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
list_claims.go
op-challenger/cmd/list_claims.go
+13
-4
No files found.
op-challenger/cmd/list_claims.go
View file @
e1562379
...
...
@@ -82,18 +82,27 @@ func listClaims(ctx context.Context, game contracts.FaultDisputeGameContract) er
// The - 1 here accounts for the fact that the split depth is included in the top game.
bottomDepth
:=
maxDepth
-
splitDepth
-
1
resolved
,
err
:=
game
.
IsResolved
(
ctx
,
rpcblock
.
Latest
,
claims
...
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to retrieve claim resolution: %w"
,
err
)
}
gameState
:=
types
.
NewGameState
(
claims
,
maxDepth
)
lineFormat
:=
"%3v %-7v %6v %5v %14v %-66v %-42v %-4
2
v
\n
"
info
:=
fmt
.
Sprintf
(
lineFormat
,
"Idx"
,
"Move"
,
"Parent"
,
"Depth"
,
"Index"
,
"Value"
,
"Claimant"
,
"
Countered By
"
)
lineFormat
:=
"%3v %-7v %6v %5v %14v %-66v %-42v %-4
4
v
\n
"
info
:=
fmt
.
Sprintf
(
lineFormat
,
"Idx"
,
"Move"
,
"Parent"
,
"Depth"
,
"Index"
,
"Value"
,
"Claimant"
,
"
Resolution
"
)
for
i
,
claim
:=
range
claims
{
pos
:=
claim
.
Position
parent
:=
strconv
.
Itoa
(
claim
.
ParentContractIndex
)
if
claim
.
IsRoot
()
{
parent
=
""
}
countered
:=
claim
.
CounteredBy
.
Hex
()
if
claim
.
CounteredBy
==
(
common
.
Address
{})
{
var
countered
string
if
!
resolved
[
i
]
{
countered
=
"-"
}
else
if
claim
.
CounteredBy
!=
(
common
.
Address
{})
{
countered
=
"❌ "
+
claim
.
CounteredBy
.
Hex
()
}
else
{
countered
=
"✅"
}
move
:=
"Attack"
if
gameState
.
DefendsParent
(
claim
)
{
...
...
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