mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 19:51:02 +00:00
Re-export current primitives in crate root (#6487)
* Re-export current primitives in crate root * Add missing exports * restart CI
This commit is contained in:
@@ -22,7 +22,7 @@ use crate::{
|
||||
};
|
||||
use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
|
||||
use frame_support::pallet_prelude::*;
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
collator_signature_payload, AvailabilityBitfield, BackedCandidate, CandidateCommitments,
|
||||
CandidateDescriptor, CandidateHash, CollatorId, CollatorSignature, CommittedCandidateReceipt,
|
||||
CompactStatement, CoreIndex, CoreOccupied, DisputeStatement, DisputeStatementSet, GroupIndex,
|
||||
|
||||
@@ -22,7 +22,7 @@ use crate::shared;
|
||||
use frame_support::{pallet_prelude::*, weights::constants::WEIGHT_REF_TIME_PER_MILLIS};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v2::{Balance, SessionIndex, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE, MAX_POV_SIZE};
|
||||
use primitives::{Balance, SessionIndex, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE, MAX_POV_SIZE};
|
||||
use sp_runtime::traits::Zero;
|
||||
use sp_std::prelude::*;
|
||||
|
||||
@@ -1148,7 +1148,7 @@ pub mod pallet {
|
||||
fn integrity_test() {
|
||||
assert_eq!(
|
||||
&ActiveConfig::<T>::hashed_key(),
|
||||
primitives::v2::well_known_keys::ACTIVE_CONFIG,
|
||||
primitives::well_known_keys::ACTIVE_CONFIG,
|
||||
"`well_known_keys::ACTIVE_CONFIG` doesn't match key of `ActiveConfig`! Make sure that the name of the\
|
||||
configuration pallet is `Configuration` in the runtime!",
|
||||
);
|
||||
|
||||
@@ -31,7 +31,7 @@ pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(4);
|
||||
pub mod v4 {
|
||||
use super::*;
|
||||
use frame_support::{traits::OnRuntimeUpgrade, weights::constants::WEIGHT_REF_TIME_PER_MILLIS};
|
||||
use primitives::v2::{Balance, SessionIndex};
|
||||
use primitives::{Balance, SessionIndex};
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use sp_std::prelude::*;
|
||||
|
||||
@@ -272,9 +272,8 @@ mod tests {
|
||||
// doesn't need to be read and also leaving it as one line allows to easily copy it.
|
||||
let raw_config = hex_literal::hex!["0000a000005000000a00000000c8000000c800000a0000000a000000100e0000580200000000500000c800000700e8764817020040011e00000000000000005039278c0400000000000000000000005039278c0400000000000000000000e8030000009001001e00000000000000009001008070000000000000000000000a0000000a0000000a00000001000000010500000001c8000000060000005802000002000000580200000200000059000000000000001e000000280000000700c817a80402004001000200000014000000"];
|
||||
|
||||
let v3 =
|
||||
v4::OldHostConfiguration::<primitives::v2::BlockNumber>::decode(&mut &raw_config[..])
|
||||
.unwrap();
|
||||
let v3 = v4::OldHostConfiguration::<primitives::BlockNumber>::decode(&mut &raw_config[..])
|
||||
.unwrap();
|
||||
|
||||
// We check only a sample of the values here. If we missed any fields or messed up data types
|
||||
// that would skew all the fields coming after.
|
||||
@@ -297,7 +296,7 @@ mod tests {
|
||||
// We specify only the picked fields and the rest should be provided by the `Default`
|
||||
// implementation. That implementation is copied over between the two types and should work
|
||||
// fine.
|
||||
let v3 = v4::OldHostConfiguration::<primitives::v2::BlockNumber> {
|
||||
let v3 = v4::OldHostConfiguration::<primitives::BlockNumber> {
|
||||
ump_max_individual_weight: Weight::from_parts(0x71616e6f6e0au64, 0x71616e6f6e0au64),
|
||||
needed_approvals: 69,
|
||||
thread_availability_period: 55,
|
||||
|
||||
@@ -533,7 +533,7 @@ fn verify_externally_accessible() {
|
||||
// This test verifies that the value can be accessed through the well known keys and the
|
||||
// host configuration decodes into the abridged version.
|
||||
|
||||
use primitives::v2::{well_known_keys, AbridgedHostConfiguration};
|
||||
use primitives::{well_known_keys, AbridgedHostConfiguration};
|
||||
|
||||
new_test_ext(Default::default()).execute_with(|| {
|
||||
let ground_truth = HostConfiguration::default();
|
||||
|
||||
@@ -21,7 +21,7 @@ use bitvec::{bitvec, order::Lsb0 as BitOrderLsb0};
|
||||
use frame_support::{ensure, traits::Get, weights::Weight};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
byzantine_threshold, supermajority_threshold, ApprovalVote, CandidateHash,
|
||||
CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet, CompactStatement, ConsensusLog,
|
||||
DisputeState, DisputeStatement, DisputeStatementSet, ExplicitDisputeStatement,
|
||||
|
||||
@@ -51,7 +51,7 @@ use frame_support::{
|
||||
};
|
||||
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v2::{CandidateHash, SessionIndex, ValidatorId, ValidatorIndex};
|
||||
use primitives::{CandidateHash, SessionIndex, ValidatorId, ValidatorIndex};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{
|
||||
traits::Convert,
|
||||
@@ -488,7 +488,7 @@ pub mod pallet {
|
||||
ensure_none(origin)?;
|
||||
|
||||
// check the membership proof to extract the offender's id
|
||||
let key = (primitives::v2::PARACHAIN_KEY_TYPE_ID, dispute_proof.validator_id.clone());
|
||||
let key = (primitives::PARACHAIN_KEY_TYPE_ID, dispute_proof.validator_id.clone());
|
||||
let offender = T::KeyOwnerProofSystem::check_proof(key, key_owner_proof)
|
||||
.ok_or(Error::<T>::InvalidKeyOwnershipProof)?;
|
||||
|
||||
@@ -640,7 +640,7 @@ fn is_known_offence<T: Config>(
|
||||
key_owner_proof: &T::KeyOwnerProof,
|
||||
) -> Result<(), TransactionValidityError> {
|
||||
// check the membership proof to extract the offender's id
|
||||
let key = (primitives::v2::PARACHAIN_KEY_TYPE_ID, dispute_proof.validator_id.clone());
|
||||
let key = (primitives::PARACHAIN_KEY_TYPE_ID, dispute_proof.validator_id.clone());
|
||||
|
||||
let offender = T::KeyOwnerProofSystem::check_proof(key, key_owner_proof.clone())
|
||||
.ok_or(InvalidTransaction::BadProof)?;
|
||||
|
||||
@@ -21,7 +21,7 @@ use frame_benchmarking::{benchmarks, whitelist_account};
|
||||
use frame_support::traits::{OnFinalize, OnInitialize};
|
||||
use frame_system::RawOrigin;
|
||||
use pallet_staking::testing_utils::create_validators;
|
||||
use primitives::v2::{Hash, PARACHAIN_KEY_TYPE_ID};
|
||||
use primitives::{Hash, PARACHAIN_KEY_TYPE_ID};
|
||||
use sp_runtime::traits::{One, StaticLookup};
|
||||
use sp_session::MembershipProof;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ use frame_support::{
|
||||
assert_err, assert_noop, assert_ok,
|
||||
traits::{OnFinalize, OnInitialize},
|
||||
};
|
||||
use primitives::v2::BlockNumber;
|
||||
use primitives::BlockNumber;
|
||||
use sp_core::{crypto::CryptoType, Pair};
|
||||
|
||||
fn filter_dispute_set(stmts: MultiDisputeStatementSet) -> CheckedMultiDisputeStatementSet {
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::{
|
||||
initializer,
|
||||
};
|
||||
use frame_support::pallet_prelude::*;
|
||||
use primitives::v2::{DownwardMessage, Hash, Id as ParaId, InboundDownwardMessage};
|
||||
use primitives::{DownwardMessage, Hash, Id as ParaId, InboundDownwardMessage};
|
||||
use sp_runtime::traits::{BlakeTwo256, Hash as HashT, SaturatedConversion};
|
||||
use sp_std::{fmt, prelude::*};
|
||||
use xcm::latest::SendError;
|
||||
|
||||
@@ -18,7 +18,7 @@ use super::*;
|
||||
use crate::mock::{new_test_ext, Configuration, Dmp, MockGenesisConfig, Paras, System};
|
||||
use hex_literal::hex;
|
||||
use parity_scale_codec::Encode;
|
||||
use primitives::v2::BlockNumber;
|
||||
use primitives::BlockNumber;
|
||||
|
||||
pub(crate) fn run_to_block(to: BlockNumber, new_session: Option<Vec<BlockNumber>>) {
|
||||
while System::block_number() < to {
|
||||
@@ -184,7 +184,7 @@ fn queue_downward_message_critical() {
|
||||
#[test]
|
||||
fn verify_dmq_mqc_head_is_externally_accessible() {
|
||||
use hex_literal::hex;
|
||||
use primitives::v2::well_known_keys;
|
||||
use primitives::well_known_keys;
|
||||
|
||||
let a = ParaId::from(2020);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::{
|
||||
use frame_support::{pallet_prelude::*, traits::ReservableCurrency};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
Balance, Hash, HrmpChannelId, Id as ParaId, InboundHrmpMessage, OutboundHrmpMessage,
|
||||
SessionIndex,
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::{
|
||||
paras::ParaKind,
|
||||
};
|
||||
use frame_support::{assert_noop, assert_ok, traits::Currency as _};
|
||||
use primitives::v2::BlockNumber;
|
||||
use primitives::BlockNumber;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
fn run_to_block(to: BlockNumber, new_session: Option<Vec<BlockNumber>>) {
|
||||
@@ -418,7 +418,7 @@ fn check_sent_messages() {
|
||||
|
||||
#[test]
|
||||
fn verify_externally_accessible() {
|
||||
use primitives::v2::{well_known_keys, AbridgedHrmpChannel};
|
||||
use primitives::{well_known_keys, AbridgedHrmpChannel};
|
||||
|
||||
let para_a = 20.into();
|
||||
let para_b = 21.into();
|
||||
|
||||
@@ -27,7 +27,7 @@ use crate::{
|
||||
use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
|
||||
use frame_support::pallet_prelude::*;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
AvailabilityBitfield, BackedCandidate, CandidateCommitments, CandidateDescriptor,
|
||||
CandidateHash, CandidateReceipt, CommittedCandidateReceipt, CoreIndex, GroupIndex, Hash,
|
||||
HeadData, Id as ParaId, SigningContext, UncheckedSignedAvailabilityBitfields, ValidatorId,
|
||||
@@ -574,7 +574,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
// check the signatures in the backing and that it is a majority.
|
||||
{
|
||||
let maybe_amount_validated = primitives::v2::check_candidate_backing(
|
||||
let maybe_amount_validated = primitives::check_candidate_backing(
|
||||
&backed_candidate,
|
||||
&signing_context,
|
||||
group_vals.len(),
|
||||
@@ -691,7 +691,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// Run the acceptance criteria checks on the given candidate commitments.
|
||||
pub(crate) fn check_validation_outputs_for_runtime_api(
|
||||
para_id: ParaId,
|
||||
validation_outputs: primitives::v2::CandidateCommitments,
|
||||
validation_outputs: primitives::CandidateCommitments,
|
||||
) -> bool {
|
||||
// This function is meant to be called from the runtime APIs against the relay-parent, hence
|
||||
// `relay_parent_number` is equal to `now`.
|
||||
@@ -1037,11 +1037,11 @@ impl<T: Config> CandidateCheckContext<T> {
|
||||
&self,
|
||||
para_id: ParaId,
|
||||
head_data: &HeadData,
|
||||
new_validation_code: &Option<primitives::v2::ValidationCode>,
|
||||
new_validation_code: &Option<primitives::ValidationCode>,
|
||||
processed_downward_messages: u32,
|
||||
upward_messages: &[primitives::v2::UpwardMessage],
|
||||
upward_messages: &[primitives::UpwardMessage],
|
||||
hrmp_watermark: T::BlockNumber,
|
||||
horizontal_messages: &[primitives::v2::OutboundHrmpMessage<ParaId>],
|
||||
horizontal_messages: &[primitives::OutboundHrmpMessage<ParaId>],
|
||||
) -> Result<(), AcceptanceCheckErr<T::BlockNumber>> {
|
||||
ensure!(
|
||||
head_data.0.len() <= self.config.max_head_data_size as _,
|
||||
|
||||
@@ -30,7 +30,7 @@ use assert_matches::assert_matches;
|
||||
use frame_support::assert_noop;
|
||||
use futures::executor::block_on;
|
||||
use keyring::Sr25519Keyring;
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
BlockNumber, CandidateCommitments, CandidateDescriptor, CollatorId,
|
||||
CompactStatement as Statement, Hash, SignedAvailabilityBitfield, SignedStatement,
|
||||
UncheckedSignedAvailabilityBitfield, ValidationCode, ValidatorId, ValidityAttestation,
|
||||
@@ -91,7 +91,7 @@ pub(crate) fn collator_sign_candidate(
|
||||
) {
|
||||
candidate.descriptor.collator = collator.public().into();
|
||||
|
||||
let payload = primitives::v2::collator_signature_payload(
|
||||
let payload = primitives::collator_signature_payload(
|
||||
&candidate.descriptor.relay_parent,
|
||||
&candidate.descriptor.para_id,
|
||||
&candidate.descriptor.persisted_validation_data_hash,
|
||||
@@ -146,7 +146,7 @@ pub(crate) async fn back_candidate(
|
||||
let backed = BackedCandidate { candidate, validity_votes, validator_indices };
|
||||
|
||||
let successfully_backed =
|
||||
primitives::v2::check_candidate_backing(&backed, signing_context, group.len(), |i| {
|
||||
primitives::check_candidate_backing(&backed, signing_context, group.len(), |i| {
|
||||
Some(validators[group[i].0 as usize].public().into())
|
||||
})
|
||||
.ok()
|
||||
|
||||
@@ -30,7 +30,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_system::limits::BlockWeights;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v2::{BlockNumber, ConsensusLog, SessionIndex, ValidatorId};
|
||||
use primitives::{BlockNumber, ConsensusLog, SessionIndex, ValidatorId};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_std::prelude::*;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use super::*;
|
||||
use frame_benchmarking::benchmarks;
|
||||
use frame_system::RawOrigin;
|
||||
use primitives::v2::ConsensusLog;
|
||||
use primitives::ConsensusLog;
|
||||
use sp_runtime::DigestItem;
|
||||
|
||||
// Random large number for the digest
|
||||
|
||||
@@ -18,7 +18,7 @@ use super::*;
|
||||
use crate::mock::{
|
||||
new_test_ext, Configuration, Dmp, Initializer, MockGenesisConfig, Paras, SessionInfo, System,
|
||||
};
|
||||
use primitives::v2::{HeadData, Id as ParaId};
|
||||
use primitives::{HeadData, Id as ParaId};
|
||||
use test_helpers::dummy_validation_code;
|
||||
|
||||
use crate::paras::ParaKind;
|
||||
|
||||
@@ -50,7 +50,7 @@ mod mock;
|
||||
|
||||
pub use origin::{ensure_parachain, Origin};
|
||||
pub use paras::ParaLifecycle;
|
||||
use primitives::v2::{HeadData, Id as ParaId, ValidationCode};
|
||||
use primitives::{HeadData, Id as ParaId, ValidationCode};
|
||||
use sp_runtime::DispatchResult;
|
||||
|
||||
/// Schedule a para to be initialized at the start of the next session with the given genesis data.
|
||||
@@ -66,7 +66,7 @@ pub fn schedule_para_initialize<T: paras::Config>(
|
||||
/// Schedule a para to be cleaned up at the start of the next session.
|
||||
///
|
||||
/// See [`paras::Pallet::schedule_para_cleanup`] for more details.
|
||||
pub fn schedule_para_cleanup<T: paras::Config>(id: primitives::v2::Id) -> Result<(), ()> {
|
||||
pub fn schedule_para_cleanup<T: paras::Config>(id: primitives::Id) -> Result<(), ()> {
|
||||
<paras::Pallet<T>>::schedule_para_cleanup(id).map_err(|_| ())
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Runtime declaration of the parachain metrics.
|
||||
|
||||
use polkadot_runtime_metrics::{Counter, CounterVec};
|
||||
use primitives::v2::metric_definitions::{
|
||||
use primitives::metric_definitions::{
|
||||
PARACHAIN_CREATE_INHERENT_BITFIELDS_SIGNATURE_CHECKS,
|
||||
PARACHAIN_INHERENT_DATA_BITFIELDS_PROCESSED, PARACHAIN_INHERENT_DATA_CANDIDATES_PROCESSED,
|
||||
PARACHAIN_INHERENT_DATA_DISPUTE_SETS_INCLUDED, PARACHAIN_INHERENT_DATA_DISPUTE_SETS_PROCESSED,
|
||||
|
||||
@@ -30,7 +30,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_support_test::TestRandomness;
|
||||
use parity_scale_codec::Decode;
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
AuthorityDiscoveryId, Balance, BlockNumber, CandidateHash, Header, Moment, SessionIndex,
|
||||
UpwardMessage, ValidatorIndex,
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Declaration of the parachain specific origin and a pallet that hosts it.
|
||||
|
||||
use primitives::v2::Id as ParaId;
|
||||
use primitives::Id as ParaId;
|
||||
use sp_runtime::traits::BadOrigin;
|
||||
use sp_std::result;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use super::*;
|
||||
use crate::configuration::HostConfiguration;
|
||||
use frame_benchmarking::benchmarks;
|
||||
use frame_system::RawOrigin;
|
||||
use primitives::v2::{HeadData, Id as ParaId, ValidationCode, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE};
|
||||
use primitives::{HeadData, Id as ParaId, ValidationCode, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE};
|
||||
use sp_runtime::traits::{One, Saturating};
|
||||
|
||||
mod pvf_check;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use crate::{configuration, paras::*, shared::Pallet as ParasShared};
|
||||
use frame_system::RawOrigin;
|
||||
use primitives::v2::{HeadData, Id as ParaId, ValidationCode, ValidatorId, ValidatorIndex};
|
||||
use primitives::{HeadData, Id as ParaId, ValidationCode, ValidatorId, ValidatorIndex};
|
||||
use sp_application_crypto::RuntimeAppPublic;
|
||||
|
||||
// Constants for the benchmarking
|
||||
@@ -179,7 +179,7 @@ where
|
||||
{
|
||||
let validators = ParasShared::<T>::active_validator_keys();
|
||||
|
||||
let required_votes = primitives::v2::supermajority_threshold(validators.len());
|
||||
let required_votes = primitives::supermajority_threshold(validators.len());
|
||||
(0..required_votes).map(move |validator_index| {
|
||||
let stmt = PvfCheckStatement {
|
||||
accept: vote_outcome == VoteOutcome::Accept,
|
||||
|
||||
@@ -111,7 +111,7 @@ use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
|
||||
use frame_support::{pallet_prelude::*, traits::EstimateNextSessionRotation};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
ConsensusLog, HeadData, Id as ParaId, PvfCheckStatement, SessionIndex, UpgradeGoAhead,
|
||||
UpgradeRestriction, ValidationCode, ValidationCodeHash, ValidatorSignature,
|
||||
};
|
||||
@@ -452,7 +452,7 @@ impl<BlockNumber> PvfCheckActiveVoteState<BlockNumber> {
|
||||
|
||||
/// Returns `None` if the quorum is not reached, or the direction of the decision.
|
||||
fn quorum(&self, n_validators: usize) -> Option<PvfCheckOutcome> {
|
||||
let q_threshold = primitives::v2::supermajority_threshold(n_validators);
|
||||
let q_threshold = primitives::supermajority_threshold(n_validators);
|
||||
// NOTE: counting the reject votes is deliberately placed first. This is to err on the safe.
|
||||
if self.votes_reject.count_ones() >= q_threshold {
|
||||
Some(PvfCheckOutcome::Rejected)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use super::*;
|
||||
use frame_support::{assert_err, assert_ok, assert_storage_noop};
|
||||
use keyring::Sr25519Keyring;
|
||||
use primitives::v2::{BlockNumber, ValidatorId, PARACHAIN_KEY_TYPE_ID};
|
||||
use primitives::{BlockNumber, ValidatorId, PARACHAIN_KEY_TYPE_ID};
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
|
||||
use std::sync::Arc;
|
||||
@@ -114,10 +114,7 @@ fn check_code_is_not_stored(validation_code: &ValidationCode) {
|
||||
/// An utility for checking that certain events were deposited.
|
||||
struct EventValidator {
|
||||
events: Vec<
|
||||
frame_system::EventRecord<
|
||||
<Test as frame_system::Config>::RuntimeEvent,
|
||||
primitives::v2::Hash,
|
||||
>,
|
||||
frame_system::EventRecord<<Test as frame_system::Config>::RuntimeEvent, primitives::Hash>,
|
||||
>,
|
||||
}
|
||||
|
||||
@@ -1694,7 +1691,7 @@ fn add_trusted_validation_code_enacts_existing_pvf_vote() {
|
||||
|
||||
#[test]
|
||||
fn verify_upgrade_go_ahead_signal_is_externally_accessible() {
|
||||
use primitives::v2::well_known_keys;
|
||||
use primitives::well_known_keys;
|
||||
|
||||
let a = ParaId::from(2020);
|
||||
|
||||
@@ -1710,7 +1707,7 @@ fn verify_upgrade_go_ahead_signal_is_externally_accessible() {
|
||||
|
||||
#[test]
|
||||
fn verify_upgrade_restriction_signal_is_externally_accessible() {
|
||||
use primitives::v2::well_known_keys;
|
||||
use primitives::well_known_keys;
|
||||
|
||||
let a = ParaId::from(2020);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use pallet_babe::{self, ParentBlockRandomness};
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
BackedCandidate, CandidateHash, CandidateReceipt, CheckedDisputeStatementSet,
|
||||
CheckedMultiDisputeStatementSet, CoreIndex, DisputeStatementSet,
|
||||
InherentData as ParachainsInherentData, MultiDisputeStatementSet, ScrapedOnChainVotes,
|
||||
|
||||
@@ -139,7 +139,7 @@ mod enter {
|
||||
#[test]
|
||||
fn test_session_is_tracked_in_on_chain_scraping() {
|
||||
use crate::disputes::run_to_block;
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
DisputeStatement, DisputeStatementSet, ExplicitDisputeStatement,
|
||||
InvalidDisputeStatementKind, ValidDisputeStatementKind,
|
||||
};
|
||||
@@ -859,8 +859,8 @@ mod enter {
|
||||
}
|
||||
}
|
||||
|
||||
fn default_header() -> primitives::v2::Header {
|
||||
primitives::v2::Header {
|
||||
fn default_header() -> primitives::Header {
|
||||
primitives::Header {
|
||||
parent_hash: Default::default(),
|
||||
number: 0,
|
||||
state_root: Default::default(),
|
||||
@@ -876,7 +876,7 @@ mod sanitizers {
|
||||
back_candidate, collator_sign_candidate, BackingKind, TestCandidateBuilder,
|
||||
};
|
||||
use bitvec::order::Lsb0;
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
AvailabilityBitfield, GroupIndex, Hash, Id as ParaId, SignedAvailabilityBitfield,
|
||||
ValidatorIndex,
|
||||
};
|
||||
@@ -885,7 +885,7 @@ mod sanitizers {
|
||||
use crate::mock::Test;
|
||||
use futures::executor::block_on;
|
||||
use keyring::Sr25519Keyring;
|
||||
use primitives::v2::PARACHAIN_KEY_TYPE_ID;
|
||||
use primitives::PARACHAIN_KEY_TYPE_ID;
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use crate::{session_info, shared};
|
||||
use frame_support::traits::{Defensive, ValidatorSet};
|
||||
use primitives::v2::{SessionIndex, ValidatorIndex};
|
||||
use primitives::{SessionIndex, ValidatorIndex};
|
||||
use sp_std::collections::btree_set::BTreeSet;
|
||||
|
||||
/// The amount of era points given by backing a candidate that is included.
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::{
|
||||
configuration, dmp, hrmp, inclusion, initializer, paras, paras_inherent, scheduler,
|
||||
session_info, shared,
|
||||
};
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
AuthorityDiscoveryId, CandidateEvent, CommittedCandidateReceipt, CoreIndex, CoreOccupied,
|
||||
CoreState, GroupIndex, GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage,
|
||||
InboundHrmpMessage, OccupiedCore, OccupiedCoreAssumption, PersistedValidationData,
|
||||
@@ -256,7 +256,7 @@ pub fn assumed_validation_data<T: initializer::Config>(
|
||||
/// Implementation for the `check_validation_outputs` function of the runtime API.
|
||||
pub fn check_validation_outputs<T: initializer::Config>(
|
||||
para_id: ParaId,
|
||||
outputs: primitives::v2::CandidateCommitments,
|
||||
outputs: primitives::CandidateCommitments,
|
||||
) -> bool {
|
||||
<inclusion::Pallet<T>>::check_validation_outputs_for_runtime_api(para_id, outputs)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Put implementations of functions from staging APIs here.
|
||||
|
||||
use crate::disputes;
|
||||
use primitives::v2::{CandidateHash, DisputeState, SessionIndex};
|
||||
use primitives::{CandidateHash, DisputeState, SessionIndex};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
/// Implementation for `get_session_disputes` function from the runtime API
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
//! over time.
|
||||
|
||||
use frame_support::pallet_prelude::*;
|
||||
use primitives::v2::{
|
||||
use primitives::{
|
||||
CollatorId, CoreIndex, CoreOccupied, GroupIndex, GroupRotationInfo, Id as ParaId,
|
||||
ParathreadClaim, ParathreadEntry, ScheduledCore, ValidatorIndex,
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ use super::*;
|
||||
|
||||
use frame_support::assert_ok;
|
||||
use keyring::Sr25519Keyring;
|
||||
use primitives::v2::{BlockNumber, CollatorId, SessionIndex, ValidatorId};
|
||||
use primitives::{BlockNumber, CollatorId, SessionIndex, ValidatorId};
|
||||
|
||||
use crate::{
|
||||
configuration::HostConfiguration,
|
||||
|
||||
@@ -27,7 +27,7 @@ use frame_support::{
|
||||
pallet_prelude::*,
|
||||
traits::{OneSessionHandler, ValidatorSet, ValidatorSetWithIdentification},
|
||||
};
|
||||
use primitives::v2::{AssignmentId, AuthorityDiscoveryId, SessionIndex, SessionInfo};
|
||||
use primitives::{AssignmentId, AuthorityDiscoveryId, SessionIndex, SessionInfo};
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::{
|
||||
util::take_active_subset,
|
||||
};
|
||||
use keyring::Sr25519Keyring;
|
||||
use primitives::v2::{BlockNumber, ValidatorId, ValidatorIndex};
|
||||
use primitives::{BlockNumber, ValidatorId, ValidatorIndex};
|
||||
|
||||
fn run_to_block(
|
||||
to: BlockNumber,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
//! dependent on any of the other pallets.
|
||||
|
||||
use frame_support::pallet_prelude::*;
|
||||
use primitives::v2::{SessionIndex, ValidatorId, ValidatorIndex};
|
||||
use primitives::{SessionIndex, ValidatorId, ValidatorIndex};
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
use rand::{seq::SliceRandom, SeedableRng};
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::{
|
||||
};
|
||||
use frame_support::{pallet_prelude::*, traits::EnsureOrigin};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use primitives::v2::{Id as ParaId, UpwardMessage};
|
||||
use primitives::{Id as ParaId, UpwardMessage};
|
||||
use sp_std::{collections::btree_map::BTreeMap, fmt, marker::PhantomData, mem, prelude::*};
|
||||
use xcm::latest::Outcome;
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ fn verify_relay_dispatch_queue_size_is_externally_accessible() {
|
||||
// keys and is decodable into a (u32, u32).
|
||||
|
||||
use parity_scale_codec::Decode as _;
|
||||
use primitives::v2::well_known_keys;
|
||||
use primitives::well_known_keys;
|
||||
|
||||
let a = ParaId::from(228);
|
||||
let msg = vec![1, 2, 3];
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Utilities that don't belong to any particular module but may draw
|
||||
//! on all modules.
|
||||
|
||||
use primitives::v2::{Id as ParaId, PersistedValidationData, ValidatorIndex};
|
||||
use primitives::{Id as ParaId, PersistedValidationData, ValidatorIndex};
|
||||
use sp_std::{collections::btree_set::BTreeSet, vec::Vec};
|
||||
|
||||
use crate::{configuration, hrmp, paras};
|
||||
@@ -103,7 +103,7 @@ mod tests {
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
use crate::util::{split_active_subset, take_active_subset};
|
||||
use primitives::v2::ValidatorIndex;
|
||||
use primitives::ValidatorIndex;
|
||||
|
||||
#[test]
|
||||
fn take_active_subset_is_compatible_with_split_active_subset() {
|
||||
|
||||
Reference in New Issue
Block a user