Trait phron_finality::sync::ChainStatus
source · pub trait ChainStatus<B, J>: Clone + Send + Sync + 'staticwhere
J: Justification,
B: Block<UnverifiedHeader = <<J as Justification>::Header as Header>::Unverified>,{
type Error: Display;
// Required methods
fn status_of(&self, id: BlockId) -> Result<BlockStatus<J>, Self::Error>;
fn block(&self, id: BlockId) -> Result<Option<B>, Self::Error>;
fn finalized_at(
&self,
number: u32
) -> Result<FinalizationStatus<J>, Self::Error>;
fn best_block(&self) -> Result<J::Header, Self::Error>;
fn top_finalized(&self) -> Result<J, Self::Error>;
fn children(&self, id: BlockId) -> Result<Vec<J::Header>, Self::Error>;
}
Expand description
The knowledge about the chain status.
Required Associated Types§
Required Methods§
sourcefn status_of(&self, id: BlockId) -> Result<BlockStatus<J>, Self::Error>
fn status_of(&self, id: BlockId) -> Result<BlockStatus<J>, Self::Error>
The status of the block.
sourcefn finalized_at(
&self,
number: u32
) -> Result<FinalizationStatus<J>, Self::Error>
fn finalized_at( &self, number: u32 ) -> Result<FinalizationStatus<J>, Self::Error>
The justification at this block number, if we have it otherwise just block id if the block is finalized without justification. Should return NotFinalized variant if the request is above the top finalized.
sourcefn best_block(&self) -> Result<J::Header, Self::Error>
fn best_block(&self) -> Result<J::Header, Self::Error>
The header of the best block.
sourcefn top_finalized(&self) -> Result<J, Self::Error>
fn top_finalized(&self) -> Result<J, Self::Error>
The justification of the top finalized block.
Object Safety§
This trait is not object safe.