Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rococo/Westend: publish claim_queue Runtime API #4005

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading