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