mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +00:00
Finish migration to v2 primitives (#5037)
* remove v0 primitives from polkadot-primitives * first pass: remove v0 * fix fallout in erasure-coding * remove v1 primitives, consolidate to v2 * the great import update * update runtime_api_impl_v1 to v2 as well * guide: add `Version` request for runtime API * add version query to runtime API * reintroduce OldV1SessionInfo in a limited way
This commit is contained in:
committed by
GitHub
parent
3394cbb142
commit
49f7e5cce4
@@ -32,7 +32,7 @@ use frame_support::{pallet_prelude::*, traits::Currency};
|
||||
use frame_system::pallet_prelude::*;
|
||||
pub use pallet::*;
|
||||
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
|
||||
use primitives::v1::Id as ParaId;
|
||||
use primitives::v2::Id as ParaId;
|
||||
use runtime_parachains::{
|
||||
configuration,
|
||||
paras::{self},
|
||||
@@ -546,7 +546,7 @@ mod tests {
|
||||
use frame_support::{assert_noop, assert_ok, parameter_types};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_balances;
|
||||
use primitives::v1::{BlockNumber, Header};
|
||||
use primitives::v2::{BlockNumber, Header};
|
||||
use runtime_parachains::{
|
||||
configuration as parachains_configuration, paras as parachains_paras,
|
||||
shared as parachains_shared,
|
||||
|
||||
@@ -30,7 +30,7 @@ use frame_support::{
|
||||
};
|
||||
pub use pallet::*;
|
||||
use parity_scale_codec::Decode;
|
||||
use primitives::v1::Id as ParaId;
|
||||
use primitives::v2::Id as ParaId;
|
||||
use sp_runtime::traits::{CheckedSub, One, Saturating, Zero};
|
||||
use sp_std::{mem::swap, prelude::*};
|
||||
|
||||
@@ -658,7 +658,7 @@ mod tests {
|
||||
};
|
||||
use frame_system::{EnsureRoot, EnsureSignedBy};
|
||||
use pallet_balances;
|
||||
use primitives::v1::{BlockNumber, Header, Id as ParaId};
|
||||
use primitives::v2::{BlockNumber, Header, Id as ParaId};
|
||||
use sp_core::H256;
|
||||
use sp_runtime::traits::{BlakeTwo256, IdentityLookup};
|
||||
use std::{cell::RefCell, collections::BTreeMap};
|
||||
|
||||
@@ -23,7 +23,7 @@ use frame_support::{
|
||||
};
|
||||
pub use pallet::*;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v1::ValidityError;
|
||||
use primitives::v2::ValidityError;
|
||||
use scale_info::TypeInfo;
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{self, Deserialize, Deserializer, Serialize, Serializer};
|
||||
|
||||
@@ -68,7 +68,7 @@ use frame_support::{
|
||||
};
|
||||
pub use pallet::*;
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v1::Id as ParaId;
|
||||
use primitives::v2::Id as ParaId;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{
|
||||
traits::{
|
||||
@@ -847,7 +847,7 @@ mod tests {
|
||||
assert_noop, assert_ok, parameter_types,
|
||||
traits::{OnFinalize, OnInitialize},
|
||||
};
|
||||
use primitives::v1::Id as ParaId;
|
||||
use primitives::v2::Id as ParaId;
|
||||
use sp_core::H256;
|
||||
use std::{cell::RefCell, collections::BTreeMap, sync::Arc};
|
||||
// The testing primitives are very useful for avoiding having to work with signatures
|
||||
|
||||
@@ -24,8 +24,8 @@ pub struct ToAuthor<R>(sp_std::marker::PhantomData<R>);
|
||||
impl<R> OnUnbalanced<NegativeImbalance<R>> for ToAuthor<R>
|
||||
where
|
||||
R: pallet_balances::Config + pallet_authorship::Config,
|
||||
<R as frame_system::Config>::AccountId: From<primitives::v1::AccountId>,
|
||||
<R as frame_system::Config>::AccountId: Into<primitives::v1::AccountId>,
|
||||
<R as frame_system::Config>::AccountId: From<primitives::v2::AccountId>,
|
||||
<R as frame_system::Config>::AccountId: Into<primitives::v2::AccountId>,
|
||||
<R as frame_system::Config>::Event: From<pallet_balances::Event<R>>,
|
||||
{
|
||||
fn on_nonzero_unbalanced(amount: NegativeImbalance<R>) {
|
||||
@@ -40,8 +40,8 @@ impl<R> OnUnbalanced<NegativeImbalance<R>> for DealWithFees<R>
|
||||
where
|
||||
R: pallet_balances::Config + pallet_treasury::Config + pallet_authorship::Config,
|
||||
pallet_treasury::Pallet<R>: OnUnbalanced<NegativeImbalance<R>>,
|
||||
<R as frame_system::Config>::AccountId: From<primitives::v1::AccountId>,
|
||||
<R as frame_system::Config>::AccountId: Into<primitives::v1::AccountId>,
|
||||
<R as frame_system::Config>::AccountId: From<primitives::v2::AccountId>,
|
||||
<R as frame_system::Config>::AccountId: Into<primitives::v2::AccountId>,
|
||||
<R as frame_system::Config>::Event: From<pallet_balances::Event<R>>,
|
||||
{
|
||||
fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance<R>>) {
|
||||
@@ -64,7 +64,7 @@ mod tests {
|
||||
use super::*;
|
||||
use frame_support::{parameter_types, traits::FindAuthor, weights::DispatchClass, PalletId};
|
||||
use frame_system::limits;
|
||||
use primitives::v1::AccountId;
|
||||
use primitives::v2::AccountId;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
testing::Header,
|
||||
|
||||
@@ -30,7 +30,7 @@ use frame_support::{
|
||||
use frame_support_test::TestRandomness;
|
||||
use frame_system::EnsureRoot;
|
||||
use parity_scale_codec::Encode;
|
||||
use primitives::v1::{
|
||||
use primitives::v2::{
|
||||
BlockNumber, HeadData, Header, Id as ParaId, ValidationCode, LOWEST_PUBLIC_ID,
|
||||
};
|
||||
use runtime_parachains::{
|
||||
|
||||
@@ -47,7 +47,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_system::limits;
|
||||
use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
|
||||
use primitives::v1::{AssignmentId, BlockNumber, ValidatorId};
|
||||
use primitives::v2::{AssignmentId, BlockNumber, ValidatorId};
|
||||
use sp_runtime::{FixedPointNumber, Perbill, Perquintill};
|
||||
use static_assertions::const_assert;
|
||||
|
||||
@@ -123,7 +123,7 @@ pub type SlowAdjustingFeeUpdate<R> =
|
||||
///
|
||||
/// This must only be used as long as the balance type is `u128`.
|
||||
pub type CurrencyToVote = frame_support::traits::U128CurrencyToVote;
|
||||
static_assertions::assert_eq_size!(primitives::v1::Balance, u128);
|
||||
static_assertions::assert_eq_size!(primitives::v2::Balance, u128);
|
||||
|
||||
/// A placeholder since there is currently no provided session key handler for parachain validator
|
||||
/// keys.
|
||||
|
||||
@@ -22,7 +22,7 @@ use frame_support::{
|
||||
weights::Weight,
|
||||
};
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use primitives::v1::{HeadData, Id as ParaId, ValidationCode};
|
||||
use primitives::v2::{HeadData, Id as ParaId, ValidationCode};
|
||||
use sp_runtime::{traits::SaturatedConversion, Permill};
|
||||
use std::{cell::RefCell, collections::HashMap};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ use frame_support::{
|
||||
traits::{Currency, Get, ReservableCurrency},
|
||||
};
|
||||
use frame_system::{self, ensure_root, ensure_signed};
|
||||
use primitives::v1::{HeadData, Id as ParaId, ValidationCode, LOWEST_PUBLIC_ID};
|
||||
use primitives::v2::{HeadData, Id as ParaId, ValidationCode, LOWEST_PUBLIC_ID};
|
||||
use runtime_parachains::{
|
||||
configuration, ensure_parachain,
|
||||
paras::{self, ParaGenesisArgs},
|
||||
@@ -599,7 +599,7 @@ mod tests {
|
||||
};
|
||||
use frame_system::limits;
|
||||
use pallet_balances::Error as BalancesError;
|
||||
use primitives::v1::{Balance, BlockNumber, Header};
|
||||
use primitives::v2::{Balance, BlockNumber, Header};
|
||||
use runtime_parachains::{configuration, origin, shared};
|
||||
use sp_core::H256;
|
||||
use sp_io::TestExternalities;
|
||||
|
||||
@@ -20,7 +20,7 @@ use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
pub use pallet::*;
|
||||
use parity_scale_codec::Encode;
|
||||
use primitives::v1::Id as ParaId;
|
||||
use primitives::v2::Id as ParaId;
|
||||
use runtime_parachains::{
|
||||
configuration, dmp, hrmp,
|
||||
paras::{self, ParaGenesisArgs},
|
||||
|
||||
@@ -29,7 +29,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_system::pallet_prelude::*;
|
||||
pub use pallet::*;
|
||||
use primitives::v1::Id as ParaId;
|
||||
use primitives::v2::Id as ParaId;
|
||||
use sp_runtime::traits::{CheckedConversion, CheckedSub, Saturating, Zero};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
@@ -502,7 +502,7 @@ mod tests {
|
||||
use frame_support::{assert_noop, assert_ok, parameter_types};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_balances;
|
||||
use primitives::v1::{BlockNumber, Header};
|
||||
use primitives::v2::{BlockNumber, Header};
|
||||
use sp_core::H256;
|
||||
use sp_runtime::traits::{BlakeTwo256, IdentityLookup};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ use frame_support::{
|
||||
dispatch::DispatchResult,
|
||||
traits::{Currency, ReservableCurrency},
|
||||
};
|
||||
use primitives::v1::{HeadData, Id as ParaId, ValidationCode};
|
||||
use primitives::v2::{HeadData, Id as ParaId, ValidationCode};
|
||||
use sp_std::vec::*;
|
||||
|
||||
/// Parachain registration API.
|
||||
|
||||
Reference in New Issue
Block a user