referrerpolicy=no-referrer-when-downgrade

Trait sc_client_api::client::BlockchainEvents

source ·
pub trait BlockchainEvents<Block: BlockT> {
    // Required methods
    fn import_notification_stream(&self) -> ImportNotifications<Block>;
    fn every_import_notification_stream(&self) -> ImportNotifications<Block>;
    fn finality_notification_stream(&self) -> FinalityNotifications<Block>;
    fn storage_changes_notification_stream(
        &self,
        filter_keys: Option<&[StorageKey]>,
        child_filter_keys: Option<&[(StorageKey, Option<Vec<StorageKey>>)]>,
    ) -> Result<StorageEventStream<Block::Hash>>;
}
Expand description

A source of blockchain events.

Required Methods§

source

fn import_notification_stream(&self) -> ImportNotifications<Block>

Get block import event stream.

Not guaranteed to be fired for every imported block. Use every_import_notification_stream() if you want a notification of every imported block regardless.

The events for this notification stream are emitted:

  • During initial sync process: if there is a re-org while importing blocks. See here for the rationale behind this.
  • After initial sync process: on every imported block, regardless of whether it is the new best block or not, causes a re-org or not.
source

fn every_import_notification_stream(&self) -> ImportNotifications<Block>

Get a stream of every imported block.

source

fn finality_notification_stream(&self) -> FinalityNotifications<Block>

Get a stream of finality notifications. Not guaranteed to be fired for every finalized block.

source

fn storage_changes_notification_stream( &self, filter_keys: Option<&[StorageKey]>, child_filter_keys: Option<&[(StorageKey, Option<Vec<StorageKey>>)]>, ) -> Result<StorageEventStream<Block::Hash>>

Get storage changes event stream.

Passing None as filter_keys subscribes to all storage changes.

Implementors§