chore(trie): rename cursor module (#2333)

This commit is contained in:
Roman Krasiuk
2023-04-21 15:06:18 +03:00
committed by GitHub
parent dfc63e524a
commit c9f126df20
9 changed files with 13 additions and 14 deletions

View File

@@ -1,9 +0,0 @@
mod account_cursor;
mod storage_cursor;
mod subnode;
mod trie_cursor;
pub use self::{
account_cursor::AccountTrieCursor, storage_cursor::StorageTrieCursor, subnode::CursorSubNode,
trie_cursor::TrieCursor,
};

View File

@@ -26,7 +26,7 @@ pub mod hash_builder;
pub mod prefix_set;
/// The cursor implementations for navigating account and storage tries.
pub mod cursor;
pub mod trie_cursor;
/// The trie walker for iterating over the trie nodes.
pub mod walker;

View File

@@ -1,4 +1,4 @@
use crate::{cursor::CursorSubNode, hash_builder::HashBuilder, updates::TrieUpdates, Nibbles};
use crate::{hash_builder::HashBuilder, trie_cursor::CursorSubNode, updates::TrieUpdates, Nibbles};
use reth_primitives::{trie::StoredSubNode, MerkleCheckpoint, H256};
/// The progress of the state root computation.

View File

@@ -1,10 +1,10 @@
use crate::{
account::EthAccount,
cursor::{AccountTrieCursor, StorageTrieCursor},
hash_builder::HashBuilder,
nibbles::Nibbles,
prefix_set::{PrefixSet, PrefixSetLoader},
progress::{IntermediateStateRootState, StateRootProgress},
trie_cursor::{AccountTrieCursor, StorageTrieCursor},
updates::{TrieKey, TrieOp, TrieUpdates},
walker::TrieWalker,
StateRootError, StorageRootError,

View File

@@ -2,6 +2,14 @@ use crate::updates::TrieKey;
use reth_db::{table::Key, Error};
use reth_primitives::trie::BranchNodeCompact;
mod account_cursor;
mod storage_cursor;
mod subnode;
pub use self::{
account_cursor::AccountTrieCursor, storage_cursor::StorageTrieCursor, subnode::CursorSubNode,
};
/// A cursor for navigating a trie that works with both Tables and DupSort tables.
pub trait TrieCursor<K: Key> {
/// Move the cursor to the key and return if it is an exact match.

View File

@@ -1,6 +1,6 @@
use crate::{
cursor::{CursorSubNode, TrieCursor},
prefix_set::PrefixSet,
trie_cursor::{CursorSubNode, TrieCursor},
updates::TrieUpdates,
Nibbles,
};
@@ -252,7 +252,7 @@ impl<'a, K: Key + From<Vec<u8>>, C: TrieCursor<K>> TrieWalker<'a, K, C> {
#[cfg(test)]
mod tests {
use super::*;
use crate::cursor::{AccountTrieCursor, StorageTrieCursor};
use crate::trie_cursor::{AccountTrieCursor, StorageTrieCursor};
use reth_db::{
cursor::DbCursorRW, mdbx::test_utils::create_test_rw_db, tables, transaction::DbTxMut,
};