referrerpolicy=no-referrer-when-downgrade

Trait polkadot_service::runtime_traits::BlockIdTo

source ·
pub trait BlockIdTo<Block>
where Block: Block,
{ type Error: Error; // Required methods fn to_hash( &self, block_id: &BlockId<Block>, ) -> Result<Option<<Block as Block>::Hash>, Self::Error>; fn to_number( &self, block_id: &BlockId<Block>, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Self::Error>; }
Expand description

Something that can convert a BlockId to a number or a hash.

Required Associated Types§

source

type Error: Error

The error type that will be returned by the functions.

Required Methods§

source

fn to_hash( &self, block_id: &BlockId<Block>, ) -> Result<Option<<Block as Block>::Hash>, Self::Error>

Convert the given block_id to the corresponding block hash.

source

fn to_number( &self, block_id: &BlockId<Block>, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Self::Error>

Convert the given block_id to the corresponding block number.

Implementations on Foreign Types§

source§

impl<B, E, Block, RA> BlockIdTo<Block> for Client<B, E, Block, RA>
where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: Block, RA: Send + Sync,

§

type Error = Error

source§

fn to_hash( &self, block_id: &BlockId<Block>, ) -> Result<Option<<Block as Block>::Hash>, Error>

source§

fn to_number( &self, block_id: &BlockId<Block>, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>

Implementors§