reth_provider

Trait StorageReader

pub trait StorageReader: Send + Sync {
    // Required methods
    fn plain_state_storages(
        &self,
        addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = FixedBytes<32>>)>,
    ) -> Result<Vec<(Address, Vec<StorageEntry>)>, ProviderError>;
    fn changed_storages_with_range(
        &self,
        range: RangeInclusive<u64>,
    ) -> Result<BTreeMap<Address, BTreeSet<FixedBytes<32>>>, ProviderError>;
    fn changed_storages_and_blocks_with_range(
        &self,
        range: RangeInclusive<u64>,
    ) -> Result<BTreeMap<(Address, FixedBytes<32>), Vec<u64>>, ProviderError>;
}
Expand description

Storage reader

Required Methods§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = FixedBytes<32>>)>, ) -> Result<Vec<(Address, Vec<StorageEntry>)>, ProviderError>

Get plainstate storages for addresses and storage keys.

fn changed_storages_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<Address, BTreeSet<FixedBytes<32>>>, ProviderError>

Iterate over storage changesets and return all storage slots that were changed.

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<(Address, FixedBytes<32>), Vec<u64>>, ProviderError>

Iterate over storage changesets and return all storage slots that were changed alongside each specific set of blocks.

NOTE: Get inclusive range of blocks.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl<'a, T> StorageReader for &'a T
where T: 'a + StorageReader + ?Sized, &'a T: Send + Sync,

§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = FixedBytes<32>>)>, ) -> Result<Vec<(Address, Vec<StorageEntry>)>, ProviderError>

§

fn changed_storages_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<Address, BTreeSet<FixedBytes<32>>>, ProviderError>

§

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<(Address, FixedBytes<32>), Vec<u64>>, ProviderError>

§

impl<T> StorageReader for Box<T>
where T: StorageReader + ?Sized, Box<T>: Send + Sync,

§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = FixedBytes<32>>)>, ) -> Result<Vec<(Address, Vec<StorageEntry>)>, ProviderError>

§

fn changed_storages_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<Address, BTreeSet<FixedBytes<32>>>, ProviderError>

§

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<(Address, FixedBytes<32>), Vec<u64>>, ProviderError>

§

impl<T> StorageReader for Arc<T>
where T: StorageReader + ?Sized, Arc<T>: Send + Sync,

§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = FixedBytes<32>>)>, ) -> Result<Vec<(Address, Vec<StorageEntry>)>, ProviderError>

§

fn changed_storages_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<Address, BTreeSet<FixedBytes<32>>>, ProviderError>

§

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<(Address, FixedBytes<32>), Vec<u64>>, ProviderError>

Implementors§

Source§

impl<TX: DbTx + 'static, N: NodeTypes> StorageReader for DatabaseProvider<TX, N>