Skip to main content

StorageReader

Trait StorageReader 

Source
pub trait StorageReader: Send {
    // Required methods
    fn plain_state_storages(
        &self,
        addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = B256>)>,
    ) -> ProviderResult<Vec<(Address, Vec<StorageEntry>)>>;
    fn changed_storages_with_range(
        &self,
        range: RangeInclusive<BlockNumber>,
    ) -> ProviderResult<BTreeMap<Address, BTreeSet<B256>>>;
    fn changed_storages_and_blocks_with_range(
        &self,
        range: RangeInclusive<BlockNumber>,
    ) -> ProviderResult<BTreeMap<(Address, B256), Vec<u64>>>;
}
Expand description

Storage reader

Required Methods§

Source

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = B256>)>, ) -> ProviderResult<Vec<(Address, Vec<StorageEntry>)>>

Get plainstate storages for addresses and storage keys.

Source

fn changed_storages_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<Address, BTreeSet<B256>>>

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

Source

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<(Address, B256), Vec<u64>>>

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".

Implementations on Foreign Types§

Source§

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

Source§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = B256>)>, ) -> ProviderResult<Vec<(Address, Vec<StorageEntry>)>>

Source§

fn changed_storages_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<Address, BTreeSet<B256>>>

Source§

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<(Address, B256), Vec<u64>>>

Source§

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

Source§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = B256>)>, ) -> ProviderResult<Vec<(Address, Vec<StorageEntry>)>>

Source§

fn changed_storages_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<Address, BTreeSet<B256>>>

Source§

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<(Address, B256), Vec<u64>>>

Source§

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

Source§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = B256>)>, ) -> ProviderResult<Vec<(Address, Vec<StorageEntry>)>>

Source§

fn changed_storages_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<Address, BTreeSet<B256>>>

Source§

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<BTreeMap<(Address, B256), Vec<u64>>>

Implementors§