Skip to content

Instantly share code, notes, and snippets.

@starius
Created November 29, 2018 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starius/29d774a63da9caae1651fcd84d35eef0 to your computer and use it in GitHub Desktop.
Save starius/29d774a63da9caae1651fcd84d35eef0 to your computer and use it in GitHub Desktop.
diff --git a/range_test.go b/range_test.go
index c3b4c71..3f380aa 100644
--- a/range_test.go
+++ b/range_test.go
@@ -200,6 +200,12 @@ func TestBuildVerifyRangeProof(t *testing.T) {
if !VerifyRangeProof(leafData[start*leafSize:end*leafSize], blake, leafSize, start, end, proof, smallRoot) {
t.Errorf("BuildRangeProof constructed an incorrect proof for range %v-%v", start, end)
}
+ if end == start + 1 {
+ singleProof := append([][]byte{leafData[start*leafSize:end*leafSize]}, proof...)
+ if !VerifyProof(blake, smallRoot, singleProof, uint64(start), 12) {
+ t.Errorf("!!!")
+ }
+ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment