[][src]Trait sp_runtime::traits::BlockIdTo

pub trait BlockIdTo<Block: Block> {
    type Error: Debug;
    fn to_hash(
        &self,
        block_id: &BlockId<Block>
    ) -> Result<Option<Block::Hash>, Self::Error>;
fn to_number(
        &self,
        block_id: &BlockId<Block>
    ) -> Result<Option<NumberFor<Block>>, Self::Error>; }

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

Associated Types

type Error: Debug

The error type that will be returned by the functions.

Loading content...

Required methods

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

Convert the given block_id to the corresponding block hash.

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

Convert the given block_id to the corresponding block number.

Loading content...

Implementors

Loading content...