Skip to content

Commit

Permalink
refactor: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed Dec 3, 2024
1 parent d644ffa commit b4bbfb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/db/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use revm::{
};
use std::collections::BTreeMap;

use super::{ConcurrentCacheState, ConcurrentStateCache};
use super::{ConcurrentCacheState, ConcurrentStateInfo};

/// Allows building of State and initializing it with different options.
#[derive(Clone, Debug)]
Expand Down Expand Up @@ -150,7 +150,7 @@ impl<DB: DatabaseRef> ConcurrentStateBuilder<DB> {
};
ConcurrentState::new(
self.database,
ConcurrentStateCache {
ConcurrentStateInfo {
cache: self
.with_cache_prestate
.unwrap_or_else(|| ConcurrentCacheState::new(self.with_state_clear)),
Expand Down
2 changes: 1 addition & 1 deletion src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod cache_state;
pub use cache_state::ConcurrentCacheState;

mod sync_state;
pub use sync_state::{ConcurrentState, ConcurrentStateCache};
pub use sync_state::{ConcurrentState, ConcurrentStateInfo};

use crate::{EvmNeedsBlock, Trevm};
use revm::{
Expand Down
10 changes: 5 additions & 5 deletions src/db/sync_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::{collections::hash_map, sync::RwLock};
pub struct ConcurrentState<Db> {
database: Db,
/// Non-DB state cache and transition information.
pub info: ConcurrentStateCache,
pub info: ConcurrentStateInfo,
}

impl<Db> From<State<Db>> for ConcurrentState<Db>
Expand All @@ -29,7 +29,7 @@ where
fn from(value: State<Db>) -> Self {
Self {
database: value.database,
info: ConcurrentStateCache {
info: ConcurrentStateInfo {
cache: value.cache.into(),
transition_state: value.transition_state,
bundle_state: value.bundle_state,
Expand All @@ -42,7 +42,7 @@ where

/// Non-DB contents of [`ConcurrentState`]
#[derive(Debug, Default)]
pub struct ConcurrentStateCache {
pub struct ConcurrentStateInfo {
/// Cached state contains both changed from evm execution and cached/loaded
/// account/storages from database. This allows us to have only one layer
/// of cache where we can fetch data. Additionally we can introduce some
Expand Down Expand Up @@ -75,12 +75,12 @@ pub struct ConcurrentStateCache {
impl<Db: DatabaseRef> ConcurrentState<Db> {
/// Create a new [`ConcurrentState`] with the given database and cache
/// state.
pub const fn new(database: Db, info: ConcurrentStateCache) -> Self {
pub const fn new(database: Db, info: ConcurrentStateInfo) -> Self {
Self { database, info }
}

/// Deconstruct the [`ConcurrentState`] into its parts.
pub fn into_parts(self) -> (Db, ConcurrentStateCache) {
pub fn into_parts(self) -> (Db, ConcurrentStateInfo) {
(self.database, self.info)
}

Expand Down

0 comments on commit b4bbfb7

Please sign in to comment.