Commit 390150d5 authored by Michael Lynch's avatar Michael Lynch Committed by GitHub

refactor(challenger): rewrite unit tests for converting gindex to Position (#8782)

* refactor(challenger): rewrite unit tests for converting gindex to Position

* Update

* refactor: replace single-use named structs with anonymous structs

* refactor(challenger): refactor TestAttack and TestDefend tests

* Update op-challenger/game/fault/types/position.go
Co-authored-by: default avatarrefcell.eth <abigger87@gmail.com>

* Remove example from spec

* Remove Equal method

* Move treeNodes into TestTraceIndex

* Get rid of extra function docstring

---------
Co-authored-by: default avatarrefcell.eth <abigger87@gmail.com>
parent 7a678883
......@@ -25,6 +25,7 @@ func NewPosition(depth int, indexAtDepth *big.Int) Position {
}
}
// NewPositionFromGIndex creates a new Position given a generalized index.
func NewPositionFromGIndex(x *big.Int) Position {
depth := bigMSB(x)
withoutMSB := new(big.Int).Not(new(big.Int).Lsh(big.NewInt(1), uint(depth)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment