referrerpolicy=no-referrer-when-downgrade

Trait cumulus_test_client::InitBlockBuilder

source ·
pub trait InitBlockBuilder {
    // Required methods
    fn init_block_builder(
        &self,
        validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
        relay_sproof_builder: RelayStateSproofBuilder,
    ) -> BlockBuilderAndSupportData<'_>;
    fn init_block_builder_at(
        &self,
        at: Hash,
        validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
        relay_sproof_builder: RelayStateSproofBuilder,
    ) -> BlockBuilderAndSupportData<'_>;
    fn init_block_builder_with_timestamp(
        &self,
        at: Hash,
        validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
        relay_sproof_builder: RelayStateSproofBuilder,
        timestamp: u64,
    ) -> BlockBuilderAndSupportData<'_>;
}
Expand description

An extension for the Cumulus test client to init a block builder.

Required Methods§

source

fn init_block_builder( &self, validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>, relay_sproof_builder: RelayStateSproofBuilder, ) -> BlockBuilderAndSupportData<'_>

Init a specific block builder that works for the test runtime.

This will automatically create and push the inherents for you to make the block valid for the test runtime.

You can use the relay chain state sproof builder to arrange required relay chain state or just use a default one. The relay chain slot in the storage proof will be adjusted to align with the parachain slot to pass validation.

Returns the block builder and validation data for further usage.

source

fn init_block_builder_at( &self, at: Hash, validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>, relay_sproof_builder: RelayStateSproofBuilder, ) -> BlockBuilderAndSupportData<'_>

Init a specific block builder at a specific block that works for the test runtime.

Same as InitBlockBuilder::init_block_builder besides that it takes a Hash to say which should be the parent block of the block that is being build.

source

fn init_block_builder_with_timestamp( &self, at: Hash, validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>, relay_sproof_builder: RelayStateSproofBuilder, timestamp: u64, ) -> BlockBuilderAndSupportData<'_>

Init a specific block builder that works for the test runtime.

Same as InitBlockBuilder::init_block_builder besides that it takes a Hash to say which should be the parent block of the block that is being build and it will use the given timestamp as input for the timestamp inherent.

Implementors§