Skip to content

Commit 7696343

Browse files
committed
fixing function name
Signed-off-by: Chengxuan Xing <chengxuan.xing@kaleido.io>
1 parent 64f0c67 commit 7696343

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

go-sdk/internal/sparse-merkle-tree/node/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ func (idx *nodeIndex) Equal(other core.NodeRef) bool {
153153
func (idx *nodeIndex) ToPath(levels int) []bool {
154154
path := make([]bool, levels)
155155
for l := 0; l < levels; l++ {
156-
path[l] = idx.IsBitOn(uint(l))
156+
path[l] = idx.IsBitOne(uint(l))
157157
}
158158
return path
159159
}
160160

161-
func (idx *nodeIndex) IsBitOn(pos uint) bool {
161+
func (idx *nodeIndex) IsBitOne(pos uint) bool {
162162
if pos >= 256 {
163163
return false
164164
}

go-sdk/internal/sparse-merkle-tree/smt/proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (p *proof) AllSiblings() []core.NodeRef {
8989
func (p *proof) getPath(index core.NodeIndex) []bool {
9090
path := make([]bool, p.depth)
9191
for n := 0; n < int(p.depth); n++ {
92-
path[n] = index.IsBitOn(uint(n))
92+
path[n] = index.IsBitOne(uint(n))
9393
}
9494
return path
9595
}

go-sdk/pkg/sparse-merkle-tree/core/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ type NodeRef interface {
4949
// NodeIndex defines the functions of leaf nodes in the SMT, which provide access to their node paths in addition to the NodeRef functions.
5050
type NodeIndex interface {
5151
NodeRef
52-
// IsBitOn returns true if the index bit at the given position is 1
53-
IsBitOn(uint) bool
52+
// IsBitOne returns true if the index bit at the given position is 1
53+
IsBitOne(uint) bool
5454
// ToPath returns the binary path from the root to the leaf
5555
ToPath(int) []bool
5656
}

0 commit comments

Comments
 (0)