mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 19:31:02 +00:00
[big refactor] Remove crate aliasing. (#4395)
* Rename: Phase 1. * Unify codec. * Fixing: Phase 2 * Fixing: Phase 3. * Fixing: Phase 4. * Fixing: Phase 5. * Fixing: Phase 6. * Fixing: Phase 7. * Fixing: Phase 8. Tests * Fixing: Phase 9. Tests!!! * Fixing: Phase 10. Moar tests! * Finally done! * More fixes. * Rename primitives:: to sp_core:: * Apply renames in finality-grandpa. * Fix benches. * Fix benches 2. * Revert node-template. * Fix frame-system in our modules.
This commit is contained in:
committed by
Gavin Wood
parent
f14d98a439
commit
8778ca7dc8
@@ -5,20 +5,20 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
app-crypto = { package = "sp-application-crypto", path = "../../primitives/application-crypto", default-features = false }
|
||||
sp-application-crypto = { path = "../../primitives/application-crypto", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
|
||||
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
|
||||
sp-inherents = { path = "../../primitives/inherents", default-features = false }
|
||||
sp-core = { path = "../../primitives/core", default-features = false }
|
||||
sp-std = { path = "../../primitives/std", default-features = false }
|
||||
serde = { version = "1.0.101", optional = true }
|
||||
session = { package = "pallet-session", path = "../session", default-features = false }
|
||||
pallet-session = { path = "../session", default-features = false }
|
||||
sp-runtime = { path = "../../primitives/runtime", default-features = false }
|
||||
sp-io ={ path = "../../primitives/io", default-features = false }
|
||||
support = { package = "frame-support", path = "../support", default-features = false }
|
||||
frame-support = { path = "../support", default-features = false }
|
||||
sp-consensus-aura = { path = "../../primitives/consensus/aura", default-features = false}
|
||||
system = { package = "frame-system", path = "../system", default-features = false }
|
||||
sp-timestamp = { package = "sp-timestamp", path = "../../primitives/timestamp", default-features = false }
|
||||
pallet-timestamp = { package = "pallet-timestamp", path = "../timestamp", default-features = false }
|
||||
frame-system = { path = "../system", default-features = false }
|
||||
sp-timestamp = { path = "../../primitives/timestamp", default-features = false }
|
||||
pallet-timestamp = { path = "../timestamp", default-features = false }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -28,17 +28,17 @@ parking_lot = "0.9.0"
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"app-crypto/std",
|
||||
"sp-application-crypto/std",
|
||||
"codec/std",
|
||||
"inherents/std",
|
||||
"sp-inherents/std",
|
||||
"sp-io/std",
|
||||
"primitives/std",
|
||||
"sp-core/std",
|
||||
"sp-std/std",
|
||||
"serde",
|
||||
"sp-runtime/std",
|
||||
"support/std",
|
||||
"frame-support/std",
|
||||
"sp-consensus-aura/std",
|
||||
"system/std",
|
||||
"frame-system/std",
|
||||
"sp-timestamp/std",
|
||||
"pallet-timestamp/std",
|
||||
]
|
||||
|
||||
@@ -49,7 +49,7 @@ use pallet_timestamp;
|
||||
|
||||
use sp_std::{result, prelude::*};
|
||||
use codec::{Encode, Decode};
|
||||
use support::{
|
||||
use frame_support::{
|
||||
decl_storage, decl_module, Parameter, traits::{Get, FindAuthor},
|
||||
ConsensusEngineId,
|
||||
};
|
||||
@@ -58,7 +58,7 @@ use sp_runtime::{
|
||||
traits::{SaturatedConversion, Saturating, Zero, Member, IsMember}, generic::DigestItem,
|
||||
};
|
||||
use sp_timestamp::OnTimestampSet;
|
||||
use inherents::{InherentIdentifier, InherentData, ProvideInherent, MakeFatalError};
|
||||
use sp_inherents::{InherentIdentifier, InherentData, ProvideInherent, MakeFatalError};
|
||||
use sp_consensus_aura::{
|
||||
AURA_ENGINE_ID, ConsensusLog, AuthorityIndex,
|
||||
inherents::{INHERENT_IDENTIFIER, AuraInherentData},
|
||||
@@ -98,7 +98,7 @@ impl<T: Trait> Module<T> {
|
||||
AURA_ENGINE_ID,
|
||||
ConsensusLog::AuthoritiesChange(new).encode()
|
||||
);
|
||||
<system::Module<T>>::deposit_log(log.into());
|
||||
<frame_system::Module<T>>::deposit_log(log.into());
|
||||
}
|
||||
|
||||
fn initialize_authorities(authorities: &[T::AuthorityId]) {
|
||||
@@ -113,7 +113,7 @@ impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
|
||||
type Public = T::AuthorityId;
|
||||
}
|
||||
|
||||
impl<T: Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
type Key = T::AuthorityId;
|
||||
|
||||
fn on_genesis_session<'a, I: 'a>(validators: I)
|
||||
@@ -142,7 +142,7 @@ impl<T: Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
ConsensusLog::<T::AuthorityId>::OnDisabled(i as AuthorityIndex).encode(),
|
||||
);
|
||||
|
||||
<system::Module<T>>::deposit_log(log.into());
|
||||
<frame_system::Module<T>>::deposit_log(log.into());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ impl<T: Trait> OnTimestampSet<T::Moment> for Module<T> {
|
||||
|
||||
impl<T: Trait> ProvideInherent for Module<T> {
|
||||
type Call = pallet_timestamp::Call<T>;
|
||||
type Error = MakeFatalError<inherents::Error>;
|
||||
type Error = MakeFatalError<sp_inherents::Error>;
|
||||
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER;
|
||||
|
||||
fn create_inherent(_: &InherentData) -> Option<Self::Call> {
|
||||
@@ -227,7 +227,7 @@ impl<T: Trait> ProvideInherent for Module<T> {
|
||||
if timestamp_based_slot == seal_slot {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(inherents::Error::from("timestamp set in block doesn't match slot in seal").into())
|
||||
Err(sp_inherents::Error::from("timestamp set in block doesn't match slot in seal").into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ use sp_runtime::{
|
||||
traits::IdentityLookup, Perbill,
|
||||
testing::{Header, UintAuthorityId},
|
||||
};
|
||||
use support::{impl_outer_origin, parameter_types, weights::Weight};
|
||||
use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
|
||||
use sp_io;
|
||||
use primitives::H256;
|
||||
use sp_core::H256;
|
||||
|
||||
impl_outer_origin!{
|
||||
pub enum Origin for Test {}
|
||||
pub enum Origin for Test where system = frame_system {}
|
||||
}
|
||||
|
||||
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
|
||||
@@ -44,7 +44,7 @@ parameter_types! {
|
||||
pub const MinimumPeriod: u64 = 1;
|
||||
}
|
||||
|
||||
impl system::Trait for Test {
|
||||
impl frame_system::Trait for Test {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
@@ -73,7 +73,7 @@ impl Trait for Test {
|
||||
}
|
||||
|
||||
pub fn new_test_ext(authorities: Vec<u64>) -> sp_io::TestExternalities {
|
||||
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
GenesisConfig::<Test>{
|
||||
authorities: authorities.into_iter().map(|a| UintAuthorityId(a).to_public_key()).collect(),
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user