Skip to content

Commit

Permalink
fixing function name
Browse files Browse the repository at this point in the history
Signed-off-by: Chengxuan Xing <[email protected]>
  • Loading branch information
Chengxuan committed Oct 4, 2024
1 parent 64f0c67 commit 7696343
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions go-sdk/internal/sparse-merkle-tree/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ func (idx *nodeIndex) Equal(other core.NodeRef) bool {
func (idx *nodeIndex) ToPath(levels int) []bool {
path := make([]bool, levels)
for l := 0; l < levels; l++ {
path[l] = idx.IsBitOn(uint(l))
path[l] = idx.IsBitOne(uint(l))
}
return path
}

func (idx *nodeIndex) IsBitOn(pos uint) bool {
func (idx *nodeIndex) IsBitOne(pos uint) bool {
if pos >= 256 {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion go-sdk/internal/sparse-merkle-tree/smt/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (p *proof) AllSiblings() []core.NodeRef {
func (p *proof) getPath(index core.NodeIndex) []bool {
path := make([]bool, p.depth)
for n := 0; n < int(p.depth); n++ {
path[n] = index.IsBitOn(uint(n))
path[n] = index.IsBitOne(uint(n))
}
return path
}
Expand Down
4 changes: 2 additions & 2 deletions go-sdk/pkg/sparse-merkle-tree/core/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ type NodeRef interface {
// NodeIndex defines the functions of leaf nodes in the SMT, which provide access to their node paths in addition to the NodeRef functions.
type NodeIndex interface {
NodeRef
// IsBitOn returns true if the index bit at the given position is 1
IsBitOn(uint) bool
// IsBitOne returns true if the index bit at the given position is 1
IsBitOne(uint) bool
// ToPath returns the binary path from the root to the leaf
ToPath(int) []bool
}
Expand Down

0 comments on commit 7696343

Please sign in to comment.