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

bump parachain host api to v11 for polkadot and kusama #348

Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion integration-tests/emulated/chains/relays/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use emulated_integration_tests_common::{

// Kusama declaration
decl_test_relay_chains! {
#[api_version(10)]
#[api_version(11)]
pub struct Kusama {
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::{

// Polkadot declaration
decl_test_relay_chains! {
#[api_version(10)]
#[api_version(11)]
pub struct Polkadot {
genesis = genesis::genesis(),
on_init = (),
Expand Down
22 changes: 18 additions & 4 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use frame_support::weights::constants::{WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIM
use pallet_nis::WithMaximumOf;
use polkadot_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 @@ -42,7 +42,11 @@ use polkadot_runtime_common::{
U256ToBalance,
};
use scale_info::TypeInfo;
use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*};
use sp_std::{
cmp::Ordering,
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
prelude::*,
};

use runtime_parachains::{
assigner_coretime as parachains_assigner_coretime,
Expand Down Expand Up @@ -1208,7 +1212,8 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) | RuntimeCall::Utility(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::FastUnstake(..) |
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
Expand Down Expand Up @@ -2169,7 +2174,7 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(10)]
#[api_version(11)]
impl polkadot_primitives::runtime_api::ParachainHost<Block> for Runtime {
fn validators() -> Vec<ValidatorId> {
parachains_runtime_api_impl::validators::<Runtime>()
Expand Down Expand Up @@ -2215,6 +2220,7 @@ sp_api::impl_runtime_apis! {
}

fn candidate_pending_availability(para_id: ParaId) -> Option<CommittedCandidateReceipt<Hash>> {
#[allow(deprecated)]
parachains_runtime_api_impl::candidate_pending_availability::<Runtime>(para_id)
}

Expand Down Expand Up @@ -2324,6 +2330,14 @@ sp_api::impl_runtime_apis! {
fn approval_voting_params() -> ApprovalVotingParams {
parachains_runtime_api_impl::approval_voting_params::<Runtime>()
}

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

fn candidates_pending_availability(para_id: ParaId) -> Vec<CommittedCandidateReceipt<Hash>> {
parachains_vstaging_api_impl::candidates_pending_availability::<Runtime>(para_id)
}
}

impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
Expand Down
22 changes: 18 additions & 4 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use pallet_session::historical as session_historical;
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use polkadot_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 @@ -95,7 +95,11 @@ use sp_runtime::{
RuntimeAppPublic, RuntimeDebug,
};
use sp_staking::SessionIndex;
use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*};
use sp_std::{
cmp::Ordering,
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 @@ -1242,7 +1246,8 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) | RuntimeCall::Utility(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::FastUnstake(..) |
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
Expand Down Expand Up @@ -2089,7 +2094,7 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(10)]
#[api_version(11)]
impl polkadot_primitives::runtime_api::ParachainHost<Block> for Runtime {
fn validators() -> Vec<ValidatorId> {
parachains_runtime_api_impl::validators::<Runtime>()
Expand Down Expand Up @@ -2135,6 +2140,7 @@ sp_api::impl_runtime_apis! {
}

fn candidate_pending_availability(para_id: ParaId) -> Option<CommittedCandidateReceipt<Hash>> {
#[allow(deprecated)]
parachains_runtime_api_impl::candidate_pending_availability::<Runtime>(para_id)
}

Expand Down Expand Up @@ -2244,6 +2250,14 @@ sp_api::impl_runtime_apis! {
fn approval_voting_params() -> ApprovalVotingParams {
parachains_runtime_api_impl::approval_voting_params::<Runtime>()
}

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

fn candidates_pending_availability(para_id: ParaId) -> Vec<CommittedCandidateReceipt<Hash>> {
parachains_vstaging_api_impl::candidates_pending_availability::<Runtime>(para_id)
}
}

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