Created
November 29, 2018 09:27
-
-
Save starius/29d774a63da9caae1651fcd84d35eef0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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