[][src]Trait sc_client_api::client::BlockBackend

pub trait BlockBackend<Block: BlockT> {
    fn block_body(
        &self,
        id: &BlockId<Block>
    ) -> Result<Option<Vec<<Block as BlockT>::Extrinsic>>>;
fn block(&self, id: &BlockId<Block>) -> Result<Option<SignedBlock<Block>>>;
fn block_status(&self, id: &BlockId<Block>) -> Result<BlockStatus>;
fn justification(
        &self,
        id: &BlockId<Block>
    ) -> Result<Option<Justification>>;
fn block_hash(
        &self,
        number: NumberFor<Block>
    ) -> Result<Option<Block::Hash>>; }

Interface for fetching block data.

Required methods

fn block_body(
    &self,
    id: &BlockId<Block>
) -> Result<Option<Vec<<Block as BlockT>::Extrinsic>>>

Get block body by ID. Returns None if the body is not stored.

fn block(&self, id: &BlockId<Block>) -> Result<Option<SignedBlock<Block>>>

Get full block by id.

fn block_status(&self, id: &BlockId<Block>) -> Result<BlockStatus>

Get block status.

fn justification(&self, id: &BlockId<Block>) -> Result<Option<Justification>>

Get block justification set by id.

fn block_hash(&self, number: NumberFor<Block>) -> Result<Option<Block::Hash>>

Get block hash by number.

Loading content...

Implementors

Loading content...