Skip to main content

ChainStateBlockReader

Trait ChainStateBlockReader 

Source
pub trait ChainStateBlockReader: Send {
    // Required methods
    fn last_finalized_block_number(&self) -> Result<Option<u64>, ProviderError>;
    fn last_safe_block_number(&self) -> Result<Option<u64>, ProviderError>;
}
Available on crate feature storage-api only.
Expand description

Functionality to read the last known chain blocks from the database.

Required Methods§

Source

fn last_finalized_block_number(&self) -> Result<Option<u64>, ProviderError>

Returns the last finalized block number.

If no finalized block has been written yet, this returns None.

Source

fn last_safe_block_number(&self) -> Result<Option<u64>, ProviderError>

Returns the last safe block number.

If no safe block has been written yet, this returns None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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