Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move HashedPostState into trie-common crate #14219

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/trie/common/src/hash_builder/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ use nybbles::Nibbles;
derive(arbitrary::Arbitrary),
reth_codecs::add_arbitrary_tests(compact)
)]
pub struct HashedPostState {
/// Mapping of hashed address to account info, `None` if destroyed.
pub accounts: B256HashMap<Option<Account>>,
/// Mapping of hashed address to hashed storage.
pub storages: B256HashMap<HashedStorage>,
}
Comment on lines +15 to +20
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to move the entire file

perhaps state.rs -> hashedstate.rs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm working on it and will soon raise a PR for it.


pub struct HashBuilderState {
/// The current key.
pub key: Vec<u8>,
Expand Down
6 changes: 0 additions & 6 deletions crates/trie/trie/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ use std::borrow::Cow;

/// Representation of in-memory hashed state.
#[derive(PartialEq, Eq, Clone, Default, Debug)]
pub struct HashedPostState {
/// Mapping of hashed address to account info, `None` if destroyed.
pub accounts: B256HashMap<Option<Account>>,
/// Mapping of hashed address to hashed storage.
pub storages: B256HashMap<HashedStorage>,
}

impl HashedPostState {
/// Initialize [`HashedPostState`] from bundle state.
Expand Down
Loading