ChangeSetReader

Trait ChangeSetReader 

Source
pub trait ChangeSetReader {
    // Required methods
    fn account_block_changeset(
        &self,
        block_number: u64,
    ) -> Result<Vec<AccountBeforeTx>, ProviderError>;
    fn get_account_before_block(
        &self,
        block_number: u64,
        address: Address,
    ) -> Result<Option<AccountBeforeTx>, ProviderError>;
    fn account_changesets_range(
        &self,
        range: impl RangeBounds<u64>,
    ) -> Result<Vec<(u64, AccountBeforeTx)>, ProviderError>;
    fn account_changeset_count(&self) -> Result<usize, ProviderError>;
}
Available on crate feature storage-api only.
Expand description

AccountChange reader

Required Methods§

Source

fn account_block_changeset( &self, block_number: u64, ) -> Result<Vec<AccountBeforeTx>, ProviderError>

Iterate over account changesets and return the account state from before this block.

Source

fn get_account_before_block( &self, block_number: u64, address: Address, ) -> Result<Option<AccountBeforeTx>, ProviderError>

Search the block’s changesets for the given address, and return the result.

Returns None if the account was not changed in this block.

Source

fn account_changesets_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<(u64, AccountBeforeTx)>, ProviderError>

Get all account changesets in a range of blocks.

Accepts any range type that implements RangeBounds<BlockNumber>, including:

  • Range<BlockNumber> (e.g., 0..100)
  • RangeInclusive<BlockNumber> (e.g., 0..=99)
  • RangeFrom<BlockNumber> (e.g., 0..) - iterates until exhausted

If there is no start bound, 0 is used as the start block.

Returns a vector of (block_number, changeset) pairs.

Source

fn account_changeset_count(&self) -> Result<usize, ProviderError>

Get the total count of all account changes.

Returns the total number of account changes across all 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§

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl<C, N> ChangeSetReader for NoopProvider<C, N>
where C: Send + Sync, N: NodePrimitives,

Source§

impl<N> ChangeSetReader for BlockchainProvider<N>

Source§

impl<N> ChangeSetReader for StaticFileProvider<N>
where N: NodePrimitives,

Source§

impl<T, ChainSpec> ChangeSetReader for MockEthProvider<T, ChainSpec>
where T: NodePrimitives, ChainSpec: Send + Sync,

Source§

impl<TX, N> ChangeSetReader for DatabaseProvider<TX, N>
where TX: DbTx, N: NodeTypes,