Skip to content

Commit

Permalink
chore: rename TrieCursorFactory::storage_tries_cursor to `TrieCurso…
Browse files Browse the repository at this point in the history
…rFactory::storage_trie_cursor` (#9145)
  • Loading branch information
rkrasiuk authored Jun 27, 2024
1 parent 867be50 commit 9fd2cf0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/trie/trie/src/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ where
}

let mut tracker = TrieTracker::default();
let trie_cursor = self.trie_cursor_factory.storage_tries_cursor(self.hashed_address)?;
let trie_cursor = self.trie_cursor_factory.storage_trie_cursor(self.hashed_address)?;
let walker = TrieWalker::new(trie_cursor, self.prefix_set).with_updates(retain_updates);

let mut hash_builder = HashBuilder::default().with_updates(retain_updates);
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/trie/src/trie_cursor/database_cursors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl<'a, TX: DbTx> TrieCursorFactory for &'a TX {
Ok(Box::new(DatabaseAccountTrieCursor::new(self.cursor_read::<tables::AccountsTrie>()?)))
}

fn storage_tries_cursor(
fn storage_trie_cursor(
&self,
hashed_address: B256,
) -> Result<Box<dyn TrieCursor + '_>, DatabaseError> {
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/trie/src/trie_cursor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub trait TrieCursorFactory {
fn account_trie_cursor(&self) -> Result<Box<dyn TrieCursor + '_>, DatabaseError>;

/// Create a storage tries cursor.
fn storage_tries_cursor(
fn storage_trie_cursor(
&self,
hashed_address: B256,
) -> Result<Box<dyn TrieCursor + '_>, DatabaseError>;
Expand Down
5 changes: 3 additions & 2 deletions crates/trie/trie/src/trie_cursor/noop.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::{TrieCursor, TrieCursorFactory};
use crate::{updates::TrieKey, BranchNodeCompact, Nibbles};
use reth_db::DatabaseError;
use reth_primitives::B256;

/// Noop trie cursor factory.
#[derive(Default, Debug)]
Expand All @@ -14,9 +15,9 @@ impl TrieCursorFactory for NoopTrieCursorFactory {
}

/// Generates a Noop storage trie cursor.
fn storage_tries_cursor(
fn storage_trie_cursor(
&self,
_hashed_address: reth_primitives::B256,
_hashed_address: B256,
) -> Result<Box<dyn TrieCursor + '_>, DatabaseError> {
Ok(Box::<NoopStorageTrieCursor>::default())
}
Expand Down

0 comments on commit 9fd2cf0

Please sign in to comment.