pub struct Proof<T, H, K = AddedRemovedKeys> { /* private fields */ }Expand description
A struct for generating merkle proofs.
Proof generator adds the target address and slots to the prefix set, enables the proof retainer
on the hash builder and follows the same algorithm as the state root calculator.
See StateRoot::root for more info.
Implementations§
Source§impl<T, H, K> Proof<T, H, K>
impl<T, H, K> Proof<T, H, K>
Sourcepub fn with_prefix_sets_mut(self, prefix_sets: TriePrefixSetsMut) -> Self
pub fn with_prefix_sets_mut(self, prefix_sets: TriePrefixSetsMut) -> Self
Set the prefix sets. They have to be mutable in order to allow extension with proof target.
Sourcepub const fn with_branch_node_masks(self, branch_node_masks: bool) -> Self
pub const fn with_branch_node_masks(self, branch_node_masks: bool) -> Self
Set the flag indicating whether to include branch node masks in the proof.
Sourcepub fn with_added_removed_keys<K2>(
self,
added_removed_keys: Option<K2>,
) -> Proof<T, H, K2>
pub fn with_added_removed_keys<K2>( self, added_removed_keys: Option<K2>, ) -> Proof<T, H, K2>
Configures the proof to retain certain nodes which would otherwise fall outside the target set, when those nodes might be required to calculate the state root when keys have been added or removed to the trie.
If None is given then retention of extra proofs is disabled.
Sourcepub const fn trie_cursor_factory(&self) -> &T
pub const fn trie_cursor_factory(&self) -> &T
Get a reference to the trie cursor factory.
Sourcepub const fn hashed_cursor_factory(&self) -> &H
pub const fn hashed_cursor_factory(&self) -> &H
Get a reference to the hashed cursor factory.
Source§impl<T, H, K> Proof<T, H, K>
impl<T, H, K> Proof<T, H, K>
Sourcepub fn account_proof(
self,
address: Address,
slots: &[B256],
) -> Result<AccountProof, StateProofError>
pub fn account_proof( self, address: Address, slots: &[B256], ) -> Result<AccountProof, StateProofError>
Generate an account proof from intermediate nodes.
Sourcepub fn multiproof(
self,
targets: MultiProofTargets,
) -> Result<MultiProof, StateProofError>
pub fn multiproof( self, targets: MultiProofTargets, ) -> Result<MultiProof, StateProofError>
Generate a state multiproof according to specified targets.
Trait Implementations§
Auto Trait Implementations§
impl<T, H, K> Freeze for Proof<T, H, K>
impl<T, H, K> RefUnwindSafe for Proof<T, H, K>
impl<T, H, K> Send for Proof<T, H, K>
impl<T, H, K> Sync for Proof<T, H, K>
impl<T, H, K> Unpin for Proof<T, H, K>
impl<T, H, K> UnsafeUnpin for Proof<T, H, K>
impl<T, H, K> UnwindSafe for Proof<T, H, K>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.