Skip to main content

StorageProofCalculator

Type Alias StorageProofCalculator 

Source
pub type StorageProofCalculator<TC, HC> = ProofCalculator<TC, HC, StorageValueEncoder>;
Expand description

A proof calculator for storage tries.

Aliased Type§

pub struct StorageProofCalculator<TC, HC> { /* private fields */ }

Implementations§

Source§

impl<TC, HC> StorageProofCalculator<TC, HC>
where TC: TrieStorageCursor, HC: HashedStorageCursor<Value = U256>,

Source

pub fn new_storage(trie_cursor: TC, hashed_cursor: HC) -> Self

Create a new StorageProofCalculator instance.

Source

pub fn storage_proof( &mut self, hashed_address: B256, targets: &mut [ProofV2Target], ) -> Result<Vec<ProofTrieNodeV2>, StateProofError>

Generate a proof for a storage trie at the given hashed address.

Given a set of ProofV2Targets, returns nodes whose paths are a prefix of any target. The returned nodes are sorted in depth-first post-order (children before parents).

Targets may be supplied in any order. Calculation sorts the slice in place by known parent context, then by key within each group.

Source

pub fn storage_root_node( &mut self, hashed_address: B256, ) -> Result<ProofTrieNodeV2, StateProofError>

Calculates the root node of a storage trie.

This method does not accept targets nor retain proofs. Returns the root node which can be used to compute the root hash via Self::compute_root_hash.

Source

pub fn storage_root( &mut self, hashed_address: B256, ) -> Result<B256, StateProofError>

Calculates the storage root hash of the account at hashed_address.

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.