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
9267b85f
Commit
9267b85f
authored
Sep 20, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix contract indices nit
parent
a27f5621
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
game.go
op-challenger/game/fault/types/game.go
+5
-5
No files found.
op-challenger/game/fault/types/game.go
View file @
9267b85f
...
@@ -51,9 +51,9 @@ type extendedClaim struct {
...
@@ -51,9 +51,9 @@ type extendedClaim struct {
type
gameState
struct
{
type
gameState
struct
{
agreeWithProposedOutput
bool
agreeWithProposedOutput
bool
root
claimEntry
root
claimEntry
//
parent
s maps a contract index to it's extended claim.
//
contractIndicie
s maps a contract index to it's extended claim.
// This is used to perform O(1) parent lookups.
// This is used to perform O(1) parent lookups.
parent
s
map
[
int
]
*
extendedClaim
contractIndicie
s
map
[
int
]
*
extendedClaim
// claims maps a claim entry to it's extended claim.
// claims maps a claim entry to it's extended claim.
claims
map
[
claimEntry
]
*
extendedClaim
claims
map
[
claimEntry
]
*
extendedClaim
depth
uint64
depth
uint64
...
@@ -74,7 +74,7 @@ func NewGameState(agreeWithProposedOutput bool, root Claim, depth uint64) *gameS
...
@@ -74,7 +74,7 @@ func NewGameState(agreeWithProposedOutput bool, root Claim, depth uint64) *gameS
agreeWithProposedOutput
:
agreeWithProposedOutput
,
agreeWithProposedOutput
:
agreeWithProposedOutput
,
root
:
rootClaimEntry
,
root
:
rootClaimEntry
,
claims
:
claims
,
claims
:
claims
,
parents
:
parents
,
contractIndicies
:
parents
,
depth
:
depth
,
depth
:
depth
,
}
}
}
}
...
@@ -118,7 +118,7 @@ func (g *gameState) Put(claim Claim) error {
...
@@ -118,7 +118,7 @@ func (g *gameState) Put(claim Claim) error {
children
:
make
([]
claimEntry
,
0
),
children
:
make
([]
claimEntry
,
0
),
}
}
g
.
claims
[
makeClaimEntry
(
claim
)]
=
claimWithExtension
g
.
claims
[
makeClaimEntry
(
claim
)]
=
claimWithExtension
g
.
parent
s
[
claim
.
ContractIndex
]
=
claimWithExtension
g
.
contractIndicie
s
[
claim
.
ContractIndex
]
=
claimWithExtension
return
nil
return
nil
}
}
...
@@ -159,7 +159,7 @@ func (g *gameState) getParent(claim Claim) *extendedClaim {
...
@@ -159,7 +159,7 @@ func (g *gameState) getParent(claim Claim) *extendedClaim {
if
claim
.
IsRoot
()
{
if
claim
.
IsRoot
()
{
return
nil
return
nil
}
}
if
parent
,
ok
:=
g
.
parent
s
[
claim
.
ParentContractIndex
];
ok
{
if
parent
,
ok
:=
g
.
contractIndicie
s
[
claim
.
ParentContractIndex
];
ok
{
return
parent
return
parent
}
}
return
nil
return
nil
...
...
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