referrerpolicy=no-referrer-when-downgrade
cumulus_test_client

Type Alias ParachainBlockData

Source
pub type ParachainBlockData = ParachainBlockData<Block>;

Aliased Type§

enum ParachainBlockData {
    V0 {
        block: [Block<Header<u32, BlakeTwo256>, UncheckedExtrinsic<MultiAddress<AccountId32, ()>, RuntimeCall, MultiSignature, StorageWeightReclaim<Runtime, (CheckNonZeroSender<Runtime>, CheckSpecVersion<Runtime>, CheckGenesis<Runtime>, CheckMortality<Runtime>, CheckNonce<Runtime>, CheckWeight<Runtime>, ChargeTransactionPayment<Runtime>)>>>; 1],
        proof: CompactProof,
    },
    V1 {
        blocks: Vec<Block<Header<u32, BlakeTwo256>, UncheckedExtrinsic<MultiAddress<AccountId32, ()>, RuntimeCall, MultiSignature, StorageWeightReclaim<Runtime, (CheckNonZeroSender<Runtime>, CheckSpecVersion<Runtime>, CheckGenesis<Runtime>, CheckMortality<Runtime>, CheckNonce<Runtime>, CheckWeight<Runtime>, ChargeTransactionPayment<Runtime>)>>>>,
        proof: CompactProof,
    },
}

Variants§

Implementations

Source§

impl<Block> ParachainBlockData<Block>
where Block: Block,

Source

pub fn new(blocks: Vec<Block>, proof: CompactProof) -> ParachainBlockData<Block>

Creates a new instance of Self.

Source

pub fn blocks(&self) -> &[Block]

Returns references to the stored blocks.

Source

pub fn blocks_mut(&mut self) -> &mut [Block]

Returns mutable references to the stored blocks.

Source

pub fn into_blocks(self) -> Vec<Block>

Returns the stored blocks.

Source

pub fn proof(&self) -> &CompactProof

Returns a reference to the stored proof.

Source

pub fn into_inner(self) -> (Vec<Block>, CompactProof)

Deconstruct into the inner parts.

Source

pub fn log_size_info(&self)

Log the size of the individual components (header, extrinsics, storage proof) as info.

Source

pub fn as_v0(&self) -> Option<ParachainBlockData<Block>>

Converts into ParachainBlockData::V0.

Returns None if there is not exactly one block.

Trait Implementations

Source§

impl<Block> Clone for ParachainBlockData<Block>
where Block: Clone + Block,

Source§

fn clone(&self) -> ParachainBlockData<Block>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Block> Decode for ParachainBlockData<Block>
where Block: Block,

Source§

fn decode<I>(input: &mut I) -> Result<ParachainBlockData<Block>, Error>
where I: Input,

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl<Block> Encode for ParachainBlockData<Block>
where Block: Block,

Source§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<T>(&self, dest: &mut T)
where T: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more