Skip to content

Commit

Permalink
chore: update test comment
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Sep 25, 2023
1 parent 72a65e3 commit c0eba42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions smst_proofs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ func TestSMST_ProveClosest(t *testing.T) {

root = smst.Root()

// testKey2 is the child of an inner node which is the child of an extension node
// the extension node has the path bounds of [3, 7] by flipping these bits we force
// a double backstep to return to avoid nil nodes and find the closest key which is
// then testKey2
// `testKey2` is the child of an inner node, which is the child of an extension node.
// The extension node has the path bounds of [3, 7]. This means any bits between
// 3-6 can be flipped, and the resulting path would still traverse through the same
// extension node and lead to testKey2 - the closest key. However, flipping bit 7
// will lead to testKey4.
path := sha256.Sum256([]byte("testKey2"))
flipPathBit(path[:], 3)
flipPathBit(path[:], 6)
Expand Down
9 changes: 5 additions & 4 deletions smt_proofs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ func TestSMT_ProveClosest(t *testing.T) {

root = smt.Root()

// testKey2 is the child of an inner node which is the child of an extension node
// the extension node has the path bounds of [3, 7] by flipping these bits we force
// a double backstep to return to avoid nil nodes and find the closest key which is
// then testKey2
// `testKey2` is the child of an inner node, which is the child of an extension node.
// The extension node has the path bounds of [3, 7]. This means any bits between
// 3-6 can be flipped, and the resulting path would still traverse through the same
// extension node and lead to testKey2 - the closest key. However, flipping bit 7
// will lead to testKey4.
path := sha256.Sum256([]byte("testKey2"))
flipPathBit(path[:], 3)
flipPathBit(path[:], 6)
Expand Down

0 comments on commit c0eba42

Please sign in to comment.