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
bc765931
Commit
bc765931
authored
Oct 05, 2023
by
refcell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert to explicit bigint construction
parent
d5ebf81a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
position.go
op-challenger/game/fault/types/position.go
+2
-2
types_test.go
op-challenger/game/fault/types/types_test.go
+1
-2
helper.go
op-e2e/e2eutils/disputegame/helper.go
+1
-1
No files found.
op-challenger/game/fault/types/position.go
View file @
bc765931
...
@@ -133,11 +133,11 @@ func (p Position) ToGIndex() *big.Int {
...
@@ -133,11 +133,11 @@ func (p Position) ToGIndex() *big.Int {
// bigMSB returns the index of the most significant bit
// bigMSB returns the index of the most significant bit
func
bigMSB
(
x
*
big
.
Int
)
int
{
func
bigMSB
(
x
*
big
.
Int
)
int
{
if
x
.
Cmp
(
new
(
big
.
Int
))
==
0
{
if
x
.
Cmp
(
big
.
NewInt
(
0
))
==
0
{
return
0
return
0
}
}
out
:=
0
out
:=
0
for
;
x
.
Cmp
(
new
(
big
.
Int
))
!=
0
;
out
++
{
for
;
x
.
Cmp
(
big
.
NewInt
(
0
))
!=
0
;
out
++
{
x
=
new
(
big
.
Int
)
.
Rsh
(
x
,
1
)
x
=
new
(
big
.
Int
)
.
Rsh
(
x
,
1
)
}
}
return
out
-
1
return
out
-
1
...
...
op-challenger/game/fault/types/types_test.go
View file @
bc765931
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"math/big"
"math/big"
"testing"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
@@ -34,7 +33,7 @@ func TestIsRootPosition(t *testing.T) {
...
@@ -34,7 +33,7 @@ func TestIsRootPosition(t *testing.T) {
}{
}{
{
{
name
:
"ZeroRoot"
,
name
:
"ZeroRoot"
,
position
:
NewPositionFromGIndex
(
common
.
Big0
),
position
:
NewPositionFromGIndex
(
big
.
NewInt
(
0
)
),
expected
:
true
,
expected
:
true
,
},
},
{
{
...
...
op-e2e/e2eutils/disputegame/helper.go
View file @
bc765931
...
@@ -38,7 +38,7 @@ const alphabetGameDepth = 4
...
@@ -38,7 +38,7 @@ const alphabetGameDepth = 4
var
lastAlphabetTraceIndex
=
big
.
NewInt
(
1
<<
alphabetGameDepth
-
1
)
var
lastAlphabetTraceIndex
=
big
.
NewInt
(
1
<<
alphabetGameDepth
-
1
)
// rootPosition is the position of the root claim.
// rootPosition is the position of the root claim.
var
rootPosition
=
faultTypes
.
NewPositionFromGIndex
(
common
.
Big1
)
var
rootPosition
=
faultTypes
.
NewPositionFromGIndex
(
big
.
NewInt
(
1
)
)
type
Status
uint8
type
Status
uint8
...
...
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