pub trait StateRangeProvider {
// Required methods
fn account_range(
&self,
start: FixedBytes<32>,
limit: FixedBytes<32>,
response_bytes: usize,
) -> Result<RangeResponse<(FixedBytes<32>, Account)>, ProviderError>;
fn storage_root_by_hash(
&self,
hashed_address: FixedBytes<32>,
) -> Result<FixedBytes<32>, ProviderError>;
fn storage_range(
&self,
hashed_address: FixedBytes<32>,
start: FixedBytes<32>,
limit: FixedBytes<32>,
response_bytes: usize,
) -> Result<Option<RangeResponse<(FixedBytes<32>, Uint<256, 4>)>>, ProviderError>;
fn account_range_proof(
&self,
keys: &[FixedBytes<32>],
) -> Result<Vec<Bytes>, ProviderError>;
fn storage_range_proof(
&self,
hashed_address: FixedBytes<32>,
keys: &[FixedBytes<32>],
) -> Result<Vec<Bytes>, ProviderError>;
}Expand description
A type that can iterate over consecutive hashed accounts and storage slots, and generate
boundary proofs for them, for serving snap/2 (EIP-8189) GetAccountRange/GetStorageRanges
requests. Hash-native throughout, unlike StorageRootProvider.
Required Methods§
Sourcefn account_range(
&self,
start: FixedBytes<32>,
limit: FixedBytes<32>,
response_bytes: usize,
) -> Result<RangeResponse<(FixedBytes<32>, Account)>, ProviderError>
fn account_range( &self, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<RangeResponse<(FixedBytes<32>, Account)>, ProviderError>
Returns accounts (hash, account) in [start, limit], bounded by response_bytes.
Sourcefn storage_root_by_hash(
&self,
hashed_address: FixedBytes<32>,
) -> Result<FixedBytes<32>, ProviderError>
fn storage_root_by_hash( &self, hashed_address: FixedBytes<32>, ) -> Result<FixedBytes<32>, ProviderError>
Returns the storage root for hashed_address without needing its address preimage.
Sourcefn storage_range(
&self,
hashed_address: FixedBytes<32>,
start: FixedBytes<32>,
limit: FixedBytes<32>,
response_bytes: usize,
) -> Result<Option<RangeResponse<(FixedBytes<32>, Uint<256, 4>)>>, ProviderError>
fn storage_range( &self, hashed_address: FixedBytes<32>, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<Option<RangeResponse<(FixedBytes<32>, Uint<256, 4>)>>, ProviderError>
Same as Self::account_range, but for the storage slots of hashed_address.
Returns None if hashed_address isn’t present in the account trie at the pinned state
root, distinct from an account that is present but has no storage.
Sourcefn account_range_proof(
&self,
keys: &[FixedBytes<32>],
) -> Result<Vec<Bytes>, ProviderError>
fn account_range_proof( &self, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
Returns an account-trie boundary proof for the already-hashed keys.
Sourcefn storage_range_proof(
&self,
hashed_address: FixedBytes<32>,
keys: &[FixedBytes<32>],
) -> Result<Vec<Bytes>, ProviderError>
fn storage_range_proof( &self, hashed_address: FixedBytes<32>, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
Same as Self::account_range_proof, but for the storage trie of hashed_address.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, T> StateRangeProvider for &'a Twhere
T: 'a + StateRangeProvider + ?Sized,
impl<'a, T> StateRangeProvider for &'a Twhere
T: 'a + StateRangeProvider + ?Sized,
fn account_range( &self, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<RangeResponse<(FixedBytes<32>, Account)>, ProviderError>
fn storage_root_by_hash( &self, hashed_address: FixedBytes<32>, ) -> Result<FixedBytes<32>, ProviderError>
fn storage_range( &self, hashed_address: FixedBytes<32>, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<Option<RangeResponse<(FixedBytes<32>, Uint<256, 4>)>>, ProviderError>
fn account_range_proof( &self, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
fn storage_range_proof( &self, hashed_address: FixedBytes<32>, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
Source§impl<T> StateRangeProvider for Arc<T>where
T: StateRangeProvider + ?Sized,
impl<T> StateRangeProvider for Arc<T>where
T: StateRangeProvider + ?Sized,
fn account_range( &self, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<RangeResponse<(FixedBytes<32>, Account)>, ProviderError>
fn storage_root_by_hash( &self, hashed_address: FixedBytes<32>, ) -> Result<FixedBytes<32>, ProviderError>
fn storage_range( &self, hashed_address: FixedBytes<32>, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<Option<RangeResponse<(FixedBytes<32>, Uint<256, 4>)>>, ProviderError>
fn account_range_proof( &self, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
fn storage_range_proof( &self, hashed_address: FixedBytes<32>, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
Source§impl<T> StateRangeProvider for Box<T>where
T: StateRangeProvider + ?Sized,
impl<T> StateRangeProvider for Box<T>where
T: StateRangeProvider + ?Sized,
fn account_range( &self, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<RangeResponse<(FixedBytes<32>, Account)>, ProviderError>
fn storage_root_by_hash( &self, hashed_address: FixedBytes<32>, ) -> Result<FixedBytes<32>, ProviderError>
fn storage_range( &self, hashed_address: FixedBytes<32>, start: FixedBytes<32>, limit: FixedBytes<32>, response_bytes: usize, ) -> Result<Option<RangeResponse<(FixedBytes<32>, Uint<256, 4>)>>, ProviderError>
fn account_range_proof( &self, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
fn storage_range_proof( &self, hashed_address: FixedBytes<32>, keys: &[FixedBytes<32>], ) -> Result<Vec<Bytes>, ProviderError>
Implementors§
impl<T: NodePrimitives, ChainSpec> StateRangeProvider for MockEthProvider<T, ChainSpec>
test-utils only.