Trait sc_client_api::client::BlockBackend
source · [−]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>>;
fn extrinsic(
&self,
hash: &Block::Hash
) -> Result<Option<<Block as BlockT>::Extrinsic>>;
fn have_extrinsic(&self, hash: &Block::Hash) -> Result<bool> { ... }
}
Expand description
Interface for fetching block data.
Required methods
Get block body by ID. Returns None
if the body is not stored.
Get full block by id.
fn block_status(&self, id: &BlockId<Block>) -> Result<BlockStatus>
fn block_status(&self, id: &BlockId<Block>) -> Result<BlockStatus>
Get block status.
fn justification(&self, id: &BlockId<Block>) -> Result<Option<Justification>>
fn justification(&self, id: &BlockId<Block>) -> Result<Option<Justification>>
Get block justification set by id.
Get block hash by number.
Provided methods
fn have_extrinsic(&self, hash: &Block::Hash) -> Result<bool>
fn have_extrinsic(&self, hash: &Block::Hash) -> Result<bool>
Check if extrinsic exists.