pub trait ForkChoiceSubscriptions: Send + Sync {
// Required methods
fn subscribe_safe_block(&self) -> ForkChoiceNotifications;
fn subscribe_finalized_block(&self) -> ForkChoiceNotifications;
// Provided methods
fn safe_block_stream(&self) -> ForkChoiceStream<SealedHeader> { ... }
fn finalized_block_stream(&self) -> ForkChoiceStream<SealedHeader> { ... }
}
Expand description
A trait that allows to register to fork choice related events and get notified when a new fork choice is available.
Required Methods§
Sourcefn subscribe_safe_block(&self) -> ForkChoiceNotifications
fn subscribe_safe_block(&self) -> ForkChoiceNotifications
Get notified when a new safe block of the chain is selected.
Sourcefn subscribe_finalized_block(&self) -> ForkChoiceNotifications
fn subscribe_finalized_block(&self) -> ForkChoiceNotifications
Get notified when a new finalized block of the chain is selected.
Provided Methods§
Sourcefn safe_block_stream(&self) -> ForkChoiceStream<SealedHeader>
fn safe_block_stream(&self) -> ForkChoiceStream<SealedHeader>
Convenience method to get a stream of the new safe blocks of the chain.
Sourcefn finalized_block_stream(&self) -> ForkChoiceStream<SealedHeader>
fn finalized_block_stream(&self) -> ForkChoiceStream<SealedHeader>
Convenience method to get a stream of the new finalized blocks of the chain.