/// FIXME: run_to_session(n) only runs to the last block of session n-1, so Session::index() will
/// return n-1. To actually run to session n, create an additional block afterwards using `run_block()`.
/// After this function returns, the current block number will be `n`, and the block will be "open",
/// meaning that on_initialize has been executed, but on_finalize has not. To execute on_finalize as
/// well, for example to test a runtime api, manually call `end_block` after this, run the test, and
// Initial state is expecting a call to start() with block number 1, so old state should be
let mock_inherent_data: Option<cumulus_primitives_core::relay_chain::vstaging::InherentData> =
// list of registered para ids: para_id, genesis_data, boot_nodes, block_credits, session_credits
pub fn origin_of(account_id: AccountId) -> <Runtime as frame_system::Config>::RuntimeOrigin {
/// This function is different in solochains: instead of creating a storage proof and calling the
/// `set_latest_author_data` inherent with that proof as argument, this writes to storage directly.
pub fn block_credits_to_required_balance(number_of_blocks: u32, para_id: ParaId) -> Balance {
fn take_new_inherent_data() -> Option<cumulus_primitives_core::relay_chain::vstaging::InherentData>
let enabled: Option<bool> = frame_support::storage::unhashed::get(b"ParasInherentEnabled");
pub fn set_new_inherent_data(data: cumulus_primitives_core::relay_chain::vstaging::InherentData) {
pub fn set_paras_inherent(data: cumulus_primitives_core::relay_chain::vstaging::InherentData) {
/// Create an `AvailabilityBitfield` where `concluding` is a map where each key is a core index
fn availability_bitvec(concluding_cores: &BTreeSet<u32>, cores: usize) -> AvailabilityBitfield {
/// Add `CandidatePendingAvailability` and `CandidateCommitments` to the relevant storage items.
/// heavy code paths in `enact_candidate`. But enact_candidates does return a weight which will
/// `backed_and_concluding_paras.len() + dispute_sessions.len() + backed_in_inherent_paras` must
let pair = TPublic::Pair::from_string(&secret_uri, None).expect("static values are valid; qed");