Skip to content

Commit

Permalink
Rococo/Westend: publish claim_queue Runtime API (paritytech#4005)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
  • Loading branch information
sandreim authored and dharjeezy committed Apr 9, 2024
1 parent 7411714 commit a441643
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use emulated_integration_tests_common::{

// Rococo declaration
decl_test_relay_chains! {
#[api_version(10)]
#[api_version(11)]
pub struct Rococo {
genesis = genesis::genesis(),
on_init = (),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use emulated_integration_tests_common::{

// Westend declaration
decl_test_relay_chains! {
#[api_version(10)]
#[api_version(11)]
pub struct Westend {
genesis = genesis::genesis(),
on_init = (),
Expand Down
18 changes: 14 additions & 4 deletions polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use pallet_nis::WithMaximumOf;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use primitives::{
slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent,
CandidateHash, CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams,
CandidateHash, CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment,
NodeFeatures, Nonce, OccupiedCoreAssumption, PersistedValidationData, ScrapedOnChainVotes,
SessionInfo, Signature, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex,
Expand All @@ -54,13 +54,19 @@ use runtime_parachains::{
inclusion::{AggregateMessageOrigin, UmpQueueId},
initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent,
runtime_api_impl::v10 as parachains_runtime_api_impl,
runtime_api_impl::{
v10 as parachains_runtime_api_impl, vstaging as vstaging_parachains_runtime_api_impl,
},
scheduler as parachains_scheduler, session_info as parachains_session_info,
shared as parachains_shared,
};
use scale_info::TypeInfo;
use sp_genesis_builder::PresetId;
use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*};
use sp_std::{
cmp::Ordering,
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
prelude::*,
};

use frame_support::{
construct_runtime, derive_impl,
Expand Down Expand Up @@ -1734,7 +1740,7 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(10)]
#[api_version(11)]
impl primitives::runtime_api::ParachainHost<Block> for Runtime {
fn validators() -> Vec<ValidatorId> {
parachains_runtime_api_impl::validators::<Runtime>()
Expand Down Expand Up @@ -1889,6 +1895,10 @@ sp_api::impl_runtime_apis! {
fn node_features() -> NodeFeatures {
parachains_runtime_api_impl::node_features::<Runtime>()
}

fn claim_queue() -> BTreeMap<CoreIndex, VecDeque<ParaId>> {
vstaging_parachains_runtime_api_impl::claim_queue::<Runtime>()
}
}

#[api_version(3)]
Expand Down
17 changes: 13 additions & 4 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use pallet_transaction_payment::{FeeDetails, FungibleAdapter, RuntimeDispatchInf
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use primitives::{
slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent,
CandidateHash, CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams,
CandidateHash, CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment,
NodeFeatures, Nonce, OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement,
ScrapedOnChainVotes, SessionInfo, Signature, ValidationCode, ValidationCodeHash, ValidatorId,
Expand All @@ -73,7 +73,9 @@ use runtime_parachains::{
inclusion::{AggregateMessageOrigin, UmpQueueId},
initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points,
runtime_api_impl::v10 as parachains_runtime_api_impl,
runtime_api_impl::{
v10 as parachains_runtime_api_impl, vstaging as vstaging_parachains_runtime_api_impl,
},
scheduler as parachains_scheduler, session_info as parachains_session_info,
shared as parachains_shared,
};
Expand All @@ -91,7 +93,10 @@ use sp_runtime::{
ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill,
};
use sp_staking::SessionIndex;
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
use sp_std::{
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
prelude::*,
};
#[cfg(any(feature = "std", test))]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
Expand Down Expand Up @@ -1794,7 +1799,7 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(10)]
#[api_version(11)]
impl primitives::runtime_api::ParachainHost<Block> for Runtime {
fn validators() -> Vec<ValidatorId> {
parachains_runtime_api_impl::validators::<Runtime>()
Expand Down Expand Up @@ -1949,6 +1954,10 @@ sp_api::impl_runtime_apis! {
fn node_features() -> NodeFeatures {
parachains_runtime_api_impl::node_features::<Runtime>()
}

fn claim_queue() -> BTreeMap<CoreIndex, VecDeque<ParaId>> {
vstaging_parachains_runtime_api_impl::claim_queue::<Runtime>()
}
}

impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
Expand Down

0 comments on commit a441643

Please sign in to comment.