Trait pallet_grandpa_finality_verifier::chain::Chain

source ·
pub trait Chain {
    type BlockNumber: Parameter + Member + MaybeSerializeDeserialize + Hash + Copy + Default + MaybeDisplay + AtLeast32BitUnsigned + FromStr + AsPrimitive<usize> + Saturating;
    type Hash: Parameter + Member + MaybeSerializeDeserialize + Hash + Ord + Copy + MaybeDisplay + Default + SimpleBitOps + AsRef<[u8]> + AsMut<[u8]>;
    type Header: Parameter + HeaderT<Number = Self::BlockNumber, Hash = Self::Hash> + MaybeSerializeDeserialize;
    type Hasher: HashT<Output = Self::Hash>;

    // Provided methods
    fn decode_block<T: Config>(
        block: &[u8],
    ) -> Result<SignedBlock<Self::Header>, Error<T>> { ... }
    fn decode_header<T: Config>(header: &[u8]) -> Result<Self::Header, Error<T>> { ... }
    fn decode_grandpa_justifications<T: Config>(
        justifications: &[u8],
    ) -> Result<GrandpaJustification<Self::Header>, Error<T>> { ... }
    fn decode_block_number_and_hash<T: Config>(
        pair: (Vec<u8>, Vec<u8>),
    ) -> Result<(Self::BlockNumber, Self::Hash), Error<T>> { ... }
    fn decode_block_number<T: Config>(
        number: &[u8],
    ) -> Result<Self::BlockNumber, Error<T>> { ... }
    fn decode_block_hash<T: Config>(hash: &[u8]) -> Result<Self::Hash, Error<T>> { ... }
}
Expand description

Minimal Substrate-based chain representation that may be used from no_std environment.

Required Associated Types§

source

type BlockNumber: Parameter + Member + MaybeSerializeDeserialize + Hash + Copy + Default + MaybeDisplay + AtLeast32BitUnsigned + FromStr + AsPrimitive<usize> + Saturating

A type that fulfills the abstract idea of what a Substrate block number is.

source

type Hash: Parameter + Member + MaybeSerializeDeserialize + Hash + Ord + Copy + MaybeDisplay + Default + SimpleBitOps + AsRef<[u8]> + AsMut<[u8]>

A type that fulfills the abstract idea of what a Substrate hash is.

source

type Header: Parameter + HeaderT<Number = Self::BlockNumber, Hash = Self::Hash> + MaybeSerializeDeserialize

A type that fulfills the abstract idea of what a Substrate header is.

source

type Hasher: HashT<Output = Self::Hash>

A type that fulfills the abstract idea of what a Substrate hasher (a type that produces hashes) is.

Provided Methods§

source

fn decode_block<T: Config>( block: &[u8], ) -> Result<SignedBlock<Self::Header>, Error<T>>

source

fn decode_header<T: Config>(header: &[u8]) -> Result<Self::Header, Error<T>>

source

fn decode_grandpa_justifications<T: Config>( justifications: &[u8], ) -> Result<GrandpaJustification<Self::Header>, Error<T>>

source

fn decode_block_number_and_hash<T: Config>( pair: (Vec<u8>, Vec<u8>), ) -> Result<(Self::BlockNumber, Self::Hash), Error<T>>

source

fn decode_block_number<T: Config>( number: &[u8], ) -> Result<Self::BlockNumber, Error<T>>

source

fn decode_block_hash<T: Config>(hash: &[u8]) -> Result<Self::Hash, Error<T>>

Object Safety§

This trait is not object safe.

Implementors§