Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cheme committed May 13, 2024
1 parent 8fdcc41 commit b97b355
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions test-support/reference-trie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,6 @@ where
L: TrieLayout,
DB: hash_db::HashDB<L::Hash, DBValue> + hash_db::HashDBRef<L::Hash, DBValue> + Default,
{
use hash_db::{HashDB, EMPTY_PREFIX};
use trie_db::{decode_compact, encode_compact, Recorder};
let mut ref_tree = std::collections::BTreeMap::new();

// Populate DB with full trie from entries.
Expand Down
3 changes: 0 additions & 3 deletions trie-db/src/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ impl<L: TrieLayout> TrieDBRawIterator<L> {
if !partial.starts_with(&slice) {
if (fwd && slice < partial) || (!fwd && slice > partial) {
crumb.status = Status::AftExiting;
self.key_nibbles.append_partial(slice.right());
return Ok(false);
}
return Ok(slice.starts_with(&partial));
Expand Down Expand Up @@ -231,8 +230,6 @@ impl<L: TrieLayout> TrieDBRawIterator<L> {
if !partial.starts_with(&slice) {
if (fwd && slice < partial) || (!fwd && slice > partial) {
crumb.status = Status::AftExiting;
self.key_nibbles.append_partial(slice.right());
self.key_nibbles.push((nibble_ops::NIBBLE_LENGTH - 1) as u8);
return Ok(false);
}
return Ok(slice.starts_with(&partial));
Expand Down
5 changes: 4 additions & 1 deletion trie-db/test/src/double_ended_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,10 @@ fn fuzz_set_internal<T: TrieLayout>() {
trie_db::DBValue,
>;

let fuzz_inputs = [vec![0, 5, 0, 0, 43, 0, 5, 0]];
let fuzz_inputs = [
vec![32, 65, 255, 254, 255, 213, 0, 0, 0, 254, 255, 0, 0, 235, 0, 0, 35],
vec![0, 5, 0, 0, 43, 0, 5, 0],
];
for i in fuzz_inputs {
reference_trie::fuzz_double_iter::<T, DB<T>>(&i);
}
Expand Down

0 comments on commit b97b355

Please sign in to comment.