pub trait ChainStatus<B, J>: Clone + Send + Sync + 'static
where 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§

source

fn status_of(&self, id: BlockId) -> Result<BlockStatus<J>, Self::Error>

The status of the block.

source

fn block(&self, id: BlockId) -> Result<Option<B>, Self::Error>

Export a copy of the block.

source

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.

source

fn best_block(&self) -> Result<J::Header, Self::Error>

The header of the best block.

source

fn top_finalized(&self) -> Result<J, Self::Error>

The justification of the top finalized block.

source

fn children(&self, id: BlockId) -> Result<Vec<J::Header>, Self::Error>

Children of the specified block.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ChainStatus<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic>, Justification> for SubstrateChainStatus

§

type Error = Error