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§
sourcefn init_block_builder(
&self,
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
relay_sproof_builder: RelayStateSproofBuilder,
) -> BlockBuilderAndSupportData<'_>
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.
sourcefn init_block_builder_at(
&self,
at: Hash,
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<'_>
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.
sourcefn init_block_builder_with_timestamp(
&self,
at: Hash,
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
relay_sproof_builder: RelayStateSproofBuilder,
timestamp: u64,
) -> BlockBuilderAndSupportData<'_>
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.