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>,
impl<TC, HC> StorageProofCalculator<TC, HC>where
TC: TrieStorageCursor,
HC: HashedStorageCursor<Value = U256>,
Sourcepub fn new_storage(trie_cursor: TC, hashed_cursor: HC) -> Self
pub fn new_storage(trie_cursor: TC, hashed_cursor: HC) -> Self
Create a new StorageProofCalculator instance.
Sourcepub fn storage_proof(
&mut self,
hashed_address: B256,
targets: &mut [ProofV2Target],
) -> Result<Vec<ProofTrieNode>, StateProofError>
pub fn storage_proof( &mut self, hashed_address: B256, targets: &mut [ProofV2Target], ) -> Result<Vec<ProofTrieNode>, StateProofError>
Generate a proof for a storage trie at the given hashed address.
Given a set of ProofV2Targets, returns nodes on the requested paths, including the child
branch of every retained extension so its persistence masks remain available even for an
absence target that diverges within the extension key. 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.
Sourcepub fn storage_root_node(
&mut self,
hashed_address: B256,
) -> Result<ProofTrieNode, StateProofError>
pub fn storage_root_node( &mut self, hashed_address: B256, ) -> Result<ProofTrieNode, StateProofError>
Calculates the root node of a storage trie.
This method does not accept targets or retain descendant proofs. Returns the standard root
node, which can be used to compute the root hash via Self::compute_root_hash. For a root
extension, use Self::storage_root_nodes to also obtain its separate child branch.
Sourcepub fn storage_root_nodes(
&mut self,
hashed_address: B256,
) -> Result<Vec<ProofTrieNode>, StateProofError>
pub fn storage_root_nodes( &mut self, hashed_address: B256, ) -> Result<Vec<ProofTrieNode>, StateProofError>
Calculates storage root nodes in children-before-parents order.
Includes the separate child branch of an extension root, even without proof targets.
Sourcepub fn storage_root(
&mut self,
hashed_address: B256,
) -> Result<B256, StateProofError>
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.