Trait StateProofProvider
pub trait StateProofProvider: Send + Sync {
// Required methods
fn proof(
&self,
input: TrieInput,
address: Address,
slots: &[FixedBytes<32>],
) -> Result<AccountProof, ProviderError>;
fn multiproof(
&self,
input: TrieInput,
targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>,
) -> Result<MultiProof, ProviderError>;
fn witness(
&self,
input: TrieInput,
target: HashedPostState,
) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>;
}
Expand description
A type that can generate state proof on top of a given post state.
Required Methods§
fn proof(
&self,
input: TrieInput,
address: Address,
slots: &[FixedBytes<32>],
) -> Result<AccountProof, ProviderError>
fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
Get account and storage proofs of target keys in the HashedPostState
on top of the current state.
fn multiproof(
&self,
input: TrieInput,
targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>,
) -> Result<MultiProof, ProviderError>
fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>
Generate [MultiProof
] for target hashed account and corresponding
hashed storage slot keys.
fn witness(
&self,
input: TrieInput,
target: HashedPostState,
) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
Get trie witness for provided state.
Implementations on Foreign Types§
§impl StateProofProvider for StateProviderTest
impl StateProofProvider for StateProviderTest
fn proof( &self, _input: TrieInput, _address: Address, _slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof( &self, _input: TrieInput, _targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>
fn witness( &self, _input: TrieInput, _target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
§impl<'a, N> StateProofProvider for MemoryOverlayStateProviderRef<'a, N>where
N: NodePrimitives,
impl<'a, N> StateProofProvider for MemoryOverlayStateProviderRef<'a, N>where
N: NodePrimitives,
fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>
fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
§impl<'a, T> StateProofProvider for &'a T
impl<'a, T> StateProofProvider for &'a T
fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>
fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
§impl<N> StateProofProvider for MemoryOverlayStateProvider<N>where
N: NodePrimitives,
impl<N> StateProofProvider for MemoryOverlayStateProvider<N>where
N: NodePrimitives,
fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>
fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
§impl<T> StateProofProvider for Box<T>
impl<T> StateProofProvider for Box<T>
fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>
fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
§impl<T> StateProofProvider for Arc<T>
impl<T> StateProofProvider for Arc<T>
fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>
fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>
Implementors§
impl StateProofProvider for MockEthProvider
Available on crate feature
test-utils
only.impl StateProofProvider for NoopProvider
Available on crate feature
test-utils
only.