mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
trie: add sub-trie iterator with prefix and range iteration support
This commit is contained in:
parent
f125dbd9c7
commit
2db2a18e83
3 changed files with 59 additions and 58 deletions
|
|
@ -1015,8 +1015,9 @@ func TestPrefixIteratorWithDescend(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// We should still respect the prefix boundary even when skipping
|
// We should still respect the prefix boundary even when skipping
|
||||||
|
prefix := []byte("a")
|
||||||
for key := range leafsFound {
|
for key := range leafsFound {
|
||||||
if !bytes.HasPrefix([]byte(key), []byte("a")) {
|
if !bytes.HasPrefix([]byte(key), prefix) {
|
||||||
t.Errorf("Found key outside prefix when using descend=false: %s", key)
|
t.Errorf("Found key outside prefix when using descend=false: %s", key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue