Skip to content

Commit

Permalink
improved test
Browse files Browse the repository at this point in the history
  • Loading branch information
Longarithm committed May 10, 2023
1 parent cd4788a commit 82d404a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions core/store/src/trie/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,17 @@ impl<'a> TrieIterator<'a> {
target: "runtime",
"visit_nodes_interval")
.entered();
println!("path: {:?} {:?}", path_begin, path_end);
let path_begin_encoded = NibbleSlice::encode_nibbles(path_begin, true);
let last_hash =
self.seek_nibble_slice(NibbleSlice::from_encoded(&path_begin_encoded).0, false)?;
let mut prefix = Self::common_prefix(path_end, &self.key_nibbles);
println!("nibbles: {:?} {:?}", &self.key_nibbles[prefix..], &path_end[prefix..]);
if self.key_nibbles[prefix..] >= path_end[prefix..] {
return Ok(vec![]);
}
let mut nodes_list = Vec::new();

// Actually (self.key_nibbles[..] == path_begin) always because path_begin always ends in a node
if &self.key_nibbles[..] >= path_begin {
println!("add");
nodes_list.push(TrieTraversalItem {
hash: last_hash,
key: self.has_value().then(|| self.key()),
Expand All @@ -346,7 +343,6 @@ impl<'a> TrieIterator<'a> {
Some(iter_step) => iter_step,
None => break,
};
println!("{:?}", iter_step);
match iter_step {
IterStep::PopTrail => {
self.trail.pop();
Expand Down

0 comments on commit 82d404a

Please sign in to comment.