[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
+4 -4
View File
@@ -8,12 +8,12 @@ edition = "2018"
serde = { version = "1.0.101", optional = true, features = ["derive"] }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
sp-core = { path = "../../primitives/core", default-features = false }
sp-std = { path = "../../primitives/std", default-features = false }
sp-io ={ path = "../../primitives/io", default-features = false }
sp-runtime = { path = "../../primitives/runtime", default-features = false }
sp-version = { path = "../../primitives/version", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
frame-support = { path = "../support", default-features = false }
impl-trait-for-tuples = "0.1.3"
[dev-dependencies]
@@ -25,10 +25,10 @@ std = [
"serde",
"safe-mix/std",
"codec/std",
"primitives/std",
"sp-core/std",
"sp-std/std",
"sp-io/std",
"support/std",
"frame-support/std",
"sp-runtime/std",
"sp-version/std",
]
+3 -3
View File
@@ -16,8 +16,8 @@
use criterion::{Criterion, criterion_group, criterion_main, black_box};
use frame_system as system;
use support::{decl_module, decl_event, impl_outer_origin, impl_outer_event, weights::Weight};
use primitives::H256;
use frame_support::{decl_module, decl_event, impl_outer_origin, impl_outer_event, weights::Weight};
use sp_core::H256;
use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
mod module {
@@ -50,7 +50,7 @@ impl_outer_event! {
}
}
support::parameter_types! {
frame_support::parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = 4 * 1024 * 1024;
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
+8 -8
View File
@@ -68,7 +68,7 @@
//! ### Example - Get extrinsic count and parent hash for the current block
//!
//! ```
//! use support::{decl_module, dispatch};
//! use frame_support::{decl_module, dispatch};
//! use frame_system::{self as system, ensure_signed};
//!
//! pub trait Trait: system::Trait {}
@@ -110,8 +110,8 @@ use sp_runtime::{
},
};
use primitives::storage::well_known_keys;
use support::{
use sp_core::storage::well_known_keys;
use frame_support::{
decl_module, decl_event, decl_storage, decl_error, storage, Parameter,
traits::{Contains, Get},
weights::{Weight, DispatchInfo, DispatchClass, SimpleDispatchInfo},
@@ -122,7 +122,7 @@ use codec::{Encode, Decode};
use sp_io::TestExternalities;
#[cfg(any(feature = "std", test))]
use primitives::ChangesTrieConfiguration;
use sp_core::ChangesTrieConfiguration;
pub mod offchain;
@@ -416,7 +416,7 @@ decl_storage! {
}
add_extra_genesis {
config(changes_trie_config): Option<ChangesTrieConfiguration>;
#[serde(with = "primitives::bytes")]
#[serde(with = "sp_core::bytes")]
config(code): Vec<u8>;
build(|config: &GenesisConfig| {
@@ -703,7 +703,7 @@ impl<T: Trait> Module<T> {
/// Get the basic externalities for this module, useful for tests.
#[cfg(any(feature = "std", test))]
pub fn externalities() -> TestExternalities {
TestExternalities::new(primitives::storage::Storage {
TestExternalities::new(sp_core::storage::Storage {
top: map![
<BlockHash<T>>::hashed_key_for(T::BlockNumber::zero()) => [69u8; 32].encode(),
<Number<T>>::hashed_key().to_vec() => T::BlockNumber::one().encode(),
@@ -1141,9 +1141,9 @@ impl<T: Trait> Lookup for ChainContext<T> {
#[cfg(test)]
mod tests {
use super::*;
use primitives::H256;
use sp_core::H256;
use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::Header, DispatchError};
use support::{impl_outer_origin, parameter_types};
use frame_support::{impl_outer_origin, parameter_types};
impl_outer_origin! {
pub enum Origin for Test where system = super {}