[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:
Tomasz Drwięga
2019-12-16 13:36:49 +01:00
committed by Gavin Wood
parent f14d98a439
commit 8778ca7dc8
485 changed files with 4023 additions and 4005 deletions
+6 -6
View File
@@ -5,14 +5,14 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
balances = { package = "pallet-balances", path = "../balances", default-features = false }
pallet-balances = { path = "../balances", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
sp-std = { path = "../../primitives/std", default-features = false }
serde = { version = "1.0.101", optional = true }
sp-runtime = { path = "../../primitives/runtime", default-features = false }
sp-staking = { path = "../../primitives/staking", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
frame-support = { path = "../support", default-features = false }
frame-system = { path = "../system", default-features = false }
[dev-dependencies]
sp-io = { path = "../../primitives/io" }
@@ -21,12 +21,12 @@ sp-core = { path = "../../primitives/core" }
[features]
default = ["std"]
std = [
"balances/std",
"pallet-balances/std",
"codec/std",
"sp-std/std",
"serde",
"sp-runtime/std",
"sp-staking/std",
"support/std",
"system/std",
"frame-support/std",
"frame-system/std",
]
+5 -4
View File
@@ -25,7 +25,7 @@ mod mock;
mod tests;
use sp_std::vec::Vec;
use support::{
use frame_support::{
decl_module, decl_event, decl_storage, Parameter,
};
use sp_runtime::traits::Hash;
@@ -33,17 +33,18 @@ use sp_staking::{
offence::{Offence, ReportOffence, Kind, OnOffenceHandler, OffenceDetails},
};
use codec::{Encode, Decode};
use frame_system as system;
/// A binary blob which represents a SCALE codec-encoded `O::TimeSlot`.
type OpaqueTimeSlot = Vec<u8>;
/// A type alias for a report identifier.
type ReportIdOf<T> = <T as system::Trait>::Hash;
type ReportIdOf<T> = <T as frame_system::Trait>::Hash;
/// Offences trait
pub trait Trait: system::Trait {
pub trait Trait: frame_system::Trait {
/// The overarching event type.
type Event: From<Event> + Into<<Self as system::Trait>::Event>;
type Event: From<Event> + Into<<Self as frame_system::Trait>::Event>;
/// Full identification of the validator.
type IdentificationTuple: Parameter + Ord;
/// A handler called for every offence report.
+5 -5
View File
@@ -29,11 +29,11 @@ use sp_staking::{
use sp_runtime::testing::Header;
use sp_runtime::traits::{IdentityLookup, BlakeTwo256};
use sp_core::H256;
use support::{
use frame_support::{
impl_outer_origin, impl_outer_event, parameter_types, StorageMap, StorageDoubleMap,
weights::Weight,
};
use {sp_io, system};
use frame_system as system;
impl_outer_origin!{
pub enum Origin for Runtime {}
@@ -72,7 +72,7 @@ parameter_types! {
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::one();
}
impl system::Trait for Runtime {
impl frame_system::Trait for Runtime {
type Origin = Origin;
type Index = u64;
type BlockNumber = u64;
@@ -107,13 +107,13 @@ impl_outer_event! {
}
pub fn new_test_ext() -> sp_io::TestExternalities {
let t = system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
let t = frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
t.into()
}
/// Offences module.
pub type Offences = Module<Runtime>;
pub type System = system::Module<Runtime>;
pub type System = frame_system::Module<Runtime>;
pub const KIND: [u8; 16] = *b"test_report_1234";
+1 -1
View File
@@ -24,7 +24,7 @@ use crate::mock::{
offence_reports,
};
use sp_runtime::Perbill;
use system::{EventRecord, Phase};
use frame_system::{EventRecord, Phase};
#[test]
fn should_report_an_authority_and_trigger_on_offence() {