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 const 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: impl IntoIterator<Item = Nibbles>, ) -> Result<Vec<ProofTrieNode>, StateProofError>

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

Given lexicographically sorted targets, returns nodes whose paths are a prefix of any target. The returned nodes will be sorted lexicographically by path.

§Panics

In debug builds, panics if the targets are not sorted lexicographically.

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.