mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(trie): make MultiProofTargets a type alias (#13364)
This commit is contained in:
@ -13,29 +13,11 @@ use alloy_trie::{
|
||||
proof::{verify_proof, ProofNodes, ProofVerificationError},
|
||||
TrieMask, EMPTY_ROOT_HASH,
|
||||
};
|
||||
use derive_more::derive::{Deref, DerefMut, From, Into, IntoIterator};
|
||||
use itertools::Itertools;
|
||||
use reth_primitives_traits::Account;
|
||||
|
||||
/// Proof targets map.
|
||||
#[derive(Debug, Default, Clone, Deref, DerefMut, From, Into, IntoIterator)]
|
||||
pub struct MultiProofTargets(B256HashMap<B256HashSet>);
|
||||
|
||||
impl MultiProofTargets {
|
||||
/// Extends the proof targets map with another one.
|
||||
pub fn extend(&mut self, other: Self) {
|
||||
for (address, slots) in other.0 {
|
||||
self.0.entry(address).or_default().extend(slots);
|
||||
}
|
||||
}
|
||||
|
||||
/// Extends the proof targets map with another one by reference.
|
||||
pub fn extend_ref(&mut self, other: &Self) {
|
||||
for (address, slots) in &other.0 {
|
||||
self.0.entry(*address).or_default().extend(slots);
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type MultiProofTargets = B256HashMap<B256HashSet>;
|
||||
|
||||
/// The state multiproof of target accounts and multiproofs of their storage tries.
|
||||
/// Multiproof is effectively a state subtrie that only contains the nodes
|
||||
|
||||
Reference in New Issue
Block a user