Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion trie/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func TestBadRangeProof(t *testing.T) {
// with the first/last second element(since small values are
// embedded in the parent). Avoid this case.
index = mrand.Intn(end - start)
if (index == end-start-1 || index == 0) && end <= 100 {
if (index == 0 && start < 100) || (index == end-start-1 && end <= 100) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this change. Why does it matter that start is < 100?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if the gapped element is the first one in the batch. And also the batch contains some small values(embedded nodes). In this case, the edge proof can be used as proof for the second element.

So if we pick the first element for gapping, we need to ensure it's not small value.

continue
}
keys = append(keys[:index], keys[index+1:]...)
Expand Down