mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
fix for latest substrate crate renaming (#641)
* rename crates as appropriate * Rename to use master - easy to revert, but shows it's working * Bump runtime version * Bump version * Bump Substrate again
This commit is contained in:
committed by
Gavin Wood
parent
0c1ef33541
commit
7832ad93cd
@@ -24,8 +24,8 @@ use codec::{Encode, Decode};
|
||||
use frame_support::{decl_storage, decl_module, ensure, dispatch::Result, traits::Get};
|
||||
|
||||
use primitives::{Hash, parachain::{AttestedCandidate, CandidateReceipt, Id as ParaId}};
|
||||
use sr_primitives::RuntimeDebug;
|
||||
use sr_staking_primitives::SessionIndex;
|
||||
use sp_runtime::RuntimeDebug;
|
||||
use sp_staking::SessionIndex;
|
||||
|
||||
use inherents::{ProvideInherent, InherentData, MakeFatalError, InherentIdentifier};
|
||||
use system::ensure_none;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Module to process claims from Ethereum addresses.
|
||||
|
||||
use rstd::prelude::*;
|
||||
use sr_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover};
|
||||
use sp_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover};
|
||||
use frame_support::{decl_event, decl_storage, decl_module};
|
||||
use frame_support::weights::SimpleDispatchInfo;
|
||||
use frame_support::traits::{Currency, Get};
|
||||
@@ -26,8 +26,8 @@ use codec::{Encode, Decode};
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{self, Serialize, Deserialize, Serializer, Deserializer};
|
||||
#[cfg(feature = "std")]
|
||||
use sr_primitives::traits::Zero;
|
||||
use sr_primitives::{
|
||||
use sp_runtime::traits::Zero;
|
||||
use sp_runtime::{
|
||||
RuntimeDebug, transaction_validity::{
|
||||
TransactionLongevity, TransactionValidity, ValidTransaction, InvalidTransaction
|
||||
},
|
||||
@@ -200,7 +200,7 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
|
||||
#[allow(deprecated)] // Allow `ValidateUnsigned`
|
||||
impl<T: Trait> sr_primitives::traits::ValidateUnsigned for Module<T> {
|
||||
impl<T: Trait> sp_runtime::traits::ValidateUnsigned for Module<T> {
|
||||
type Call = Call<T>;
|
||||
|
||||
fn validate_unsigned(call: &Self::Call) -> TransactionValidity {
|
||||
@@ -244,11 +244,11 @@ mod tests {
|
||||
use hex_literal::hex;
|
||||
use super::*;
|
||||
|
||||
use substrate_primitives::H256;
|
||||
use sp_core::H256;
|
||||
use codec::Encode;
|
||||
// The testing primitives are very useful for avoiding having to work with signatures
|
||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
|
||||
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use balances;
|
||||
use frame_support::{impl_outer_origin, assert_ok, assert_err, assert_noop, parameter_types};
|
||||
|
||||
@@ -339,7 +339,7 @@ mod tests {
|
||||
|
||||
// This function basically just builds a genesis storage key/value store according to
|
||||
// our desired mockup.
|
||||
fn new_test_ext() -> sr_io::TestExternalities {
|
||||
fn new_test_ext() -> sp_io::TestExternalities {
|
||||
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
// We use default for brevity, but you can configure as desired if needed.
|
||||
balances::GenesisConfig::<Test>::default().assimilate_storage(&mut t).unwrap();
|
||||
@@ -442,7 +442,7 @@ mod tests {
|
||||
#[test]
|
||||
fn validate_unsigned_works() {
|
||||
#![allow(deprecated)] // Allow `ValidateUnsigned`
|
||||
use sr_primitives::traits::ValidateUnsigned;
|
||||
use sp_runtime::traits::ValidateUnsigned;
|
||||
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(
|
||||
|
||||
@@ -50,7 +50,7 @@ pub mod time {
|
||||
|
||||
/// Fee-related.
|
||||
pub mod fee {
|
||||
pub use sr_primitives::Perbill;
|
||||
pub use sp_runtime::Perbill;
|
||||
|
||||
/// The block saturation level. Fees will be updates based on this value.
|
||||
pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);
|
||||
|
||||
@@ -72,14 +72,14 @@ use frame_support::{
|
||||
}
|
||||
};
|
||||
use system::ensure_signed;
|
||||
use sr_primitives::{ModuleId,
|
||||
use sp_runtime::{ModuleId,
|
||||
traits::{AccountIdConversion, Hash, Saturating, Zero, CheckedAdd}
|
||||
};
|
||||
use frame_support::weights::SimpleDispatchInfo;
|
||||
use crate::slots;
|
||||
use codec::{Encode, Decode};
|
||||
use rstd::vec::Vec;
|
||||
use substrate_primitives::storage::well_known_keys::CHILD_STORAGE_KEY_PREFIX;
|
||||
use sp_core::storage::well_known_keys::CHILD_STORAGE_KEY_PREFIX;
|
||||
use primitives::parachain::Id as ParaId;
|
||||
|
||||
const MODULE_ID: ModuleId = ModuleId(*b"py/cfund");
|
||||
@@ -491,11 +491,11 @@ mod tests {
|
||||
|
||||
use std::{collections::HashMap, cell::RefCell};
|
||||
use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types};
|
||||
use substrate_primitives::H256;
|
||||
use sp_core::H256;
|
||||
use primitives::parachain::{Info as ParaInfo, Id as ParaId};
|
||||
// The testing primitives are very useful for avoiding having to work with signatures
|
||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
Perbill, Permill, testing::Header,
|
||||
traits::{BlakeTwo256, OnInitialize, OnFinalize, IdentityLookup},
|
||||
};
|
||||
@@ -643,7 +643,7 @@ mod tests {
|
||||
|
||||
// This function basically just builds a genesis storage key/value store according to
|
||||
// our desired mockup.
|
||||
fn new_test_ext() -> sr_io::TestExternalities {
|
||||
fn new_test_ext() -> sp_io::TestExternalities {
|
||||
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
balances::GenesisConfig::<Test>{
|
||||
balances: vec![(1, 1000), (2, 2000), (3, 3000), (4, 4000)],
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
//! Auxillary struct/enums for polkadot runtime.
|
||||
|
||||
use primitives::Balance;
|
||||
use sr_primitives::traits::{Convert, Saturating};
|
||||
use sr_primitives::{Fixed64, Perbill};
|
||||
use sp_runtime::traits::{Convert, Saturating};
|
||||
use sp_runtime::{Fixed64, Perbill};
|
||||
use frame_support::weights::Weight;
|
||||
use frame_support::traits::{OnUnbalanced, Currency, Get};
|
||||
use crate::{Balances, System, Authorship, MaximumBlockWeight, NegativeImbalance};
|
||||
|
||||
+11
-11
@@ -29,13 +29,13 @@ mod slots;
|
||||
mod crowdfund;
|
||||
|
||||
use rstd::prelude::*;
|
||||
use substrate_primitives::u32_trait::{_1, _2, _3, _4, _5};
|
||||
use sp_core::u32_trait::{_1, _2, _3, _4, _5};
|
||||
use codec::{Encode, Decode};
|
||||
use primitives::{
|
||||
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
|
||||
parachain::{self, ActiveParas}, ValidityError,
|
||||
};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
ApplyExtrinsicResult, Permill, Perbill, RuntimeDebug,
|
||||
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
||||
@@ -46,8 +46,8 @@ use version::RuntimeVersion;
|
||||
use grandpa::{AuthorityId as GrandpaId, fg_primitives};
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use version::NativeVersion;
|
||||
use substrate_primitives::OpaqueMetadata;
|
||||
use sr_staking_primitives::SessionIndex;
|
||||
use sp_core::OpaqueMetadata;
|
||||
use sp_staking::SessionIndex;
|
||||
use frame_support::{
|
||||
parameter_types, construct_runtime, traits::{SplitTwoWays, Currency, Randomness},
|
||||
weights::{Weight, DispatchInfo},
|
||||
@@ -60,7 +60,7 @@ use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
|
||||
#[cfg(feature = "std")]
|
||||
pub use staking::StakerStatus;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
pub use sr_primitives::BuildStorage;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
pub use timestamp::Call as TimestampCall;
|
||||
pub use balances::Call as BalancesCall;
|
||||
pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER};
|
||||
@@ -97,7 +97,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: create_runtime_str!("kusama"),
|
||||
impl_name: create_runtime_str!("parity-kusama"),
|
||||
authoring_version: 2,
|
||||
spec_version: 1022,
|
||||
spec_version: 1023,
|
||||
impl_version: 0,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
@@ -641,8 +641,8 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
|
||||
sr_api::impl_runtime_apis! {
|
||||
impl sr_api::Core<Block> for Runtime {
|
||||
sp_api::impl_runtime_apis! {
|
||||
impl sp_api::Core<Block> for Runtime {
|
||||
fn version() -> RuntimeVersion {
|
||||
VERSION
|
||||
}
|
||||
@@ -656,7 +656,7 @@ sr_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl sr_api::Metadata<Block> for Runtime {
|
||||
impl sp_api::Metadata<Block> for Runtime {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
Runtime::metadata().into()
|
||||
}
|
||||
@@ -694,7 +694,7 @@ sr_api::impl_runtime_apis! {
|
||||
}
|
||||
|
||||
impl offchain_primitives::OffchainWorkerApi<Block> for Runtime {
|
||||
fn offchain_worker(number: sr_primitives::traits::NumberFor<Block>) {
|
||||
fn offchain_worker(number: sp_runtime::traits::NumberFor<Block>) {
|
||||
Executive::offchain_worker(number)
|
||||
}
|
||||
}
|
||||
@@ -752,7 +752,7 @@ sr_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl substrate_session::SessionKeys<Block> for Runtime {
|
||||
impl sp_sesssion::SessionKeys<Block> for Runtime {
|
||||
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
|
||||
SessionKeys::generate(seed)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ use rstd::result;
|
||||
use rstd::collections::btree_map::BTreeMap;
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
use sr_primitives::traits::{
|
||||
use sp_runtime::traits::{
|
||||
Hash as HashT, BlakeTwo256, Saturating, One, Zero, Dispatchable,
|
||||
AccountIdConversion,
|
||||
};
|
||||
@@ -455,7 +455,7 @@ impl<T: Trait> Module<T> {
|
||||
// same.
|
||||
ordered_needs_dispatch.insert(i, id);
|
||||
} else {
|
||||
sr_primitives::print("ordered_needs_dispatch contains id?!");
|
||||
sp_runtime::print("ordered_needs_dispatch contains id?!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -657,7 +657,7 @@ impl<T: Trait> Module<T> {
|
||||
) -> rstd::result::Result<IncludedBlocks<T>, &'static str>
|
||||
{
|
||||
use primitives::parachain::ValidityAttestation;
|
||||
use sr_primitives::traits::AppVerify;
|
||||
use sp_runtime::traits::AppVerify;
|
||||
|
||||
// returns groups of slices that have the same chain ID.
|
||||
// assumes the inner slice is sorted by id.
|
||||
@@ -841,7 +841,7 @@ impl<T: Trait> Module<T> {
|
||||
*/
|
||||
}
|
||||
|
||||
impl<T: Trait> sr_primitives::BoundToRuntimeAppPublic for Module<T> {
|
||||
impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
|
||||
type Public = ValidatorId;
|
||||
}
|
||||
|
||||
@@ -901,10 +901,10 @@ mod tests {
|
||||
use super::*;
|
||||
use super::Call as ParachainsCall;
|
||||
use bitvec::{bitvec, vec::BitVec};
|
||||
use sr_io::TestExternalities;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use substrate_trie::NodeCodec;
|
||||
use sr_primitives::{
|
||||
use sp_io::TestExternalities;
|
||||
use sp_core::{H256, Blake2Hasher};
|
||||
use sp_trie::NodeCodec;
|
||||
use sp_runtime::{
|
||||
Perbill, curve::PiecewiseLinear, testing::{UintAuthorityId, Header},
|
||||
traits::{BlakeTwo256, IdentityLookup, OnInitialize, OnFinalize},
|
||||
};
|
||||
@@ -1038,7 +1038,7 @@ mod tests {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const SessionsPerEra: sr_staking_primitives::SessionIndex = 6;
|
||||
pub const SessionsPerEra: sp_staking::SessionIndex = 6;
|
||||
pub const BondingDuration: staking::EraIndex = 28;
|
||||
pub const SlashDeferDuration: staking::EraIndex = 7;
|
||||
pub const AttestationPeriod: BlockNumber = 100;
|
||||
|
||||
@@ -23,7 +23,7 @@ use rstd::{prelude::*, result};
|
||||
use rstd::marker::PhantomData;
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
transaction_validity::{TransactionValidityError, ValidTransaction, TransactionValidity},
|
||||
traits::{Hash as HashT, SignedExtension}
|
||||
};
|
||||
@@ -39,7 +39,7 @@ use primitives::parachain::{
|
||||
Retriable
|
||||
};
|
||||
use crate::parachains;
|
||||
use sr_primitives::transaction_validity::InvalidTransaction;
|
||||
use sp_runtime::transaction_validity::InvalidTransaction;
|
||||
|
||||
/// Parachain registration API.
|
||||
pub trait Registrar<AccountId> {
|
||||
@@ -178,7 +178,7 @@ decl_storage! {
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
fn build<T: Trait>(config: &GenesisConfig<T>) {
|
||||
use sr_primitives::traits::Zero;
|
||||
use sp_runtime::traits::Zero;
|
||||
|
||||
let mut p = config.parachains.clone();
|
||||
p.sort_unstable_by_key(|&(ref id, _, _)| *id);
|
||||
@@ -574,9 +574,9 @@ impl<T: Trait + Send + Sync> SignedExtension for LimitParathreadCommits<T> where
|
||||
mod tests {
|
||||
use super::*;
|
||||
use bitvec::vec::BitVec;
|
||||
use sr_io::TestExternalities;
|
||||
use substrate_primitives::{H256, Pair};
|
||||
use sr_primitives::{
|
||||
use sp_io::TestExternalities;
|
||||
use sp_core::{H256, Pair};
|
||||
use sp_runtime::{
|
||||
traits::{
|
||||
BlakeTwo256, IdentityLookup, OnInitialize, OnFinalize, Dispatchable,
|
||||
AccountIdConversion,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! represent all sub ranges between 0 and 3 inclusive.
|
||||
|
||||
use rstd::{result, ops::Add, convert::{TryFrom, TryInto}};
|
||||
use sr_primitives::traits::CheckedSub;
|
||||
use sp_runtime::traits::CheckedSub;
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
/// Total number of possible sub ranges of slots.
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
//! information for commissioning and decommissioning them.
|
||||
|
||||
use rstd::{prelude::*, mem::swap, convert::TryInto};
|
||||
use sr_primitives::traits::{
|
||||
use sp_runtime::traits::{
|
||||
CheckedSub, StaticLookup, Zero, One, CheckedConversion, Hash, AccountIdConversion,
|
||||
};
|
||||
use frame_support::weights::SimpleDispatchInfo;
|
||||
@@ -820,8 +820,8 @@ mod tests {
|
||||
use super::*;
|
||||
use std::{result::Result, collections::HashMap, cell::RefCell};
|
||||
|
||||
use substrate_primitives::H256;
|
||||
use sr_primitives::{
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
Perbill, testing::Header,
|
||||
traits::{BlakeTwo256, Hash, IdentityLookup, OnInitialize, OnFinalize},
|
||||
};
|
||||
@@ -948,7 +948,7 @@ mod tests {
|
||||
|
||||
// This function basically just builds a genesis storage key/value store according to
|
||||
// our desired mock up.
|
||||
fn new_test_ext() -> sr_io::TestExternalities {
|
||||
fn new_test_ext() -> sp_io::TestExternalities {
|
||||
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
balances::GenesisConfig::<Test>{
|
||||
balances: vec![(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)],
|
||||
|
||||
Reference in New Issue
Block a user