pub trait CheckAssociatedRelayNumber {
// Required method
fn check_associated_relay_number(
current: RelayChainBlockNumber,
previous: RelayChainBlockNumber
);
}
Expand description
Something that can check the associated relay block number.
Each Parachain block is built in the context of a relay chain block, this trait allows us to validate the given relay chain block number. With async backing it is legal to build multiple Parachain blocks per relay chain parent. With this trait it is possible for the Parachain to ensure that still only one Parachain block is build per relay chain parent.
By default RelayNumberStrictlyIncreases
and AnyRelayNumber
are provided.
Required Methods§
sourcefn check_associated_relay_number(
current: RelayChainBlockNumber,
previous: RelayChainBlockNumber
)
fn check_associated_relay_number( current: RelayChainBlockNumber, previous: RelayChainBlockNumber )
Check the current relay number versus the previous relay number.
The implementation should panic when there is something wrong.