Trait sc_client_api::client::BlockBackend [−][src]
pub trait BlockBackend<Block: BlockT> {
fn block_body(
&self,
id: &BlockId<Block>
) -> Result<Option<Vec<<Block as BlockT>::Extrinsic>>>;
fn block_indexed_body(
&self,
id: &BlockId<Block>
) -> Result<Option<Vec<Vec<u8>>>>;
fn block(&self, id: &BlockId<Block>) -> Result<Option<SignedBlock<Block>>>;
fn block_status(&self, id: &BlockId<Block>) -> Result<BlockStatus>;
fn justifications(
&self,
id: &BlockId<Block>
) -> Result<Option<Justifications>>;
fn block_hash(
&self,
number: NumberFor<Block>
) -> Result<Option<Block::Hash>>;
fn indexed_transaction(&self, hash: &Block::Hash) -> Result<Option<Vec<u8>>>;
fn has_indexed_transaction(&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 all indexed transactions for a block, including renewed transactions.
Note that this will only fetch transactions
that are indexed by the runtime with storage_index_transaction
.
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 justifications(&self, id: &BlockId<Block>) -> Result<Option<Justifications>>
fn justifications(&self, id: &BlockId<Block>) -> Result<Option<Justifications>>
Get block justifications for the block with the given id.
Get block hash by number.
Provided methods
fn has_indexed_transaction(&self, hash: &Block::Hash) -> Result<bool>
fn has_indexed_transaction(&self, hash: &Block::Hash) -> Result<bool>
Check if transaction index exists.