Skip to content

Commit

Permalink
chore: address linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Sep 22, 2023
1 parent d058d81 commit 62073eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions smt.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func (smt *SMT) ProveClosest(path []byte) (
proof *SparseMerkleProof, // proof of the key-value pair found
err error, // the error value encountered
) {
workingPath := make([]byte, len(path), len(path))
workingPath := make([]byte, len(path))
copy(workingPath, path)
var siblings []treeNode
var sib treeNode
Expand Down Expand Up @@ -427,6 +427,8 @@ func (smt *SMT) ProveClosest(path []byte) (
depth -= depthDelta
// flip the path bit at the parent depth
flipPathBit(workingPath, depth)
} else {
depthDelta = 0
}
// end traversal when we hit a leaf node
if _, ok := node.(*leafNode); ok {
Expand All @@ -439,7 +441,7 @@ func (smt *SMT) ProveClosest(path []byte) (
siblings = append(siblings, nil)
}
depth += length
depthDelta = length
depthDelta += length
node = ext.child
node, err = smt.resolveLazy(node)
if err != nil {
Expand All @@ -457,7 +459,7 @@ func (smt *SMT) ProveClosest(path []byte) (
}
siblings = append(siblings, sib)
depth += 1
depthDelta = 1
depthDelta += 1
}

// Retrieve the closest path and value hash if found
Expand Down

0 comments on commit 62073eb

Please sign in to comment.