From c0eba42f9353a3683566736af9a879d94576e9d3 Mon Sep 17 00:00:00 2001 From: harry <53987565+h5law@users.noreply.github.com> Date: Mon, 25 Sep 2023 18:50:11 +0100 Subject: [PATCH] chore: update test comment --- smst_proofs_test.go | 9 +++++---- smt_proofs_test.go | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/smst_proofs_test.go b/smst_proofs_test.go index ddb016e..22b0454 100644 --- a/smst_proofs_test.go +++ b/smst_proofs_test.go @@ -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) diff --git a/smt_proofs_test.go b/smt_proofs_test.go index d754ff0..822c3b5 100644 --- a/smt_proofs_test.go +++ b/smt_proofs_test.go @@ -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)