[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
+29 -28
View File
@@ -6,31 +6,32 @@ edition = "2018"
[dependencies]
aura = { package = "pallet-aura", path = "../../../frame/aura", default-features = false }
aura-primitives = { package = "sp-consensus-aura", path = "../../../primitives/consensus/aura", default-features = false }
balances = { package = "pallet-balances", path = "../../../frame/balances", default-features = false }
block-builder-api = { package = "sp-block-builder", path = "../../../primitives/block-builder", default-features = false}
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
executive = { package = "frame-executive", path = "../../../frame/executive", default-features = false }
frame-support = { path = "../../../frame/support", default-features = false }
grandpa = { package = "pallet-grandpa", path = "../../../frame/grandpa", default-features = false }
indices = { package = "pallet-indices", path = "../../../frame/indices", default-features = false }
inherents = { package = "sp-inherents", path = "../../../primitives/inherents", default-features = false}
offchain-primitives = { package = "sp-offchain", path = "../../../primitives/offchain", default-features = false }
primitives = { package = "sp-core", path = "../../../primitives/core", default-features = false }
randomness-collective-flip = { package = "pallet-randomness-collective-flip", path = "../../../frame/randomness-collective-flip", default-features = false }
sp-std = { path = "../../../primitives/std", default-features = false }
sp-io = { path = "../../../primitives/io", default-features = false }
safe-mix = { version = "1.0.0", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
sp-api = { path = "../../../primitives/api", default-features = false }
sp-runtime = { path = "../../../primitives/runtime", default-features = false }
sp-session = { path = "../../../primitives/session", default-features = false }
sudo = { package = "pallet-sudo", path = "../../../frame/sudo", default-features = false }
support = { package = "frame-support", path = "../../../frame/support", default-features = false }
system = { package = "frame-system", path = "../../../frame/system", default-features = false }
timestamp = { package = "pallet-timestamp", path = "../../../frame/timestamp", default-features = false }
transaction-payment = { package = "pallet-transaction-payment", path = "../../../frame/transaction-payment", default-features = false }
sp-transaction-pool = { package = "sp-transaction-pool", path = "../../../primitives/transaction-pool", default-features = false }
version = { package = "sp-version", path = "../../../primitives/version", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
frame-executive = { path = "../../../frame/executive", default-features = false }
safe-mix = { version = "1.0.0", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
sp-api = { path = "../../../primitives/api", default-features = false }
sp-block-builder = { path = "../../../primitives/block-builder", default-features = false}
sp-consensus-aura = { path = "../../../primitives/consensus/aura", default-features = false }
sp-core = { path = "../../../primitives/core", default-features = false }
sp-inherents = { path = "../../../primitives/inherents", default-features = false}
sp-io = { path = "../../../primitives/io", default-features = false }
sp-offchain = { path = "../../../primitives/offchain", default-features = false }
sp-runtime = { path = "../../../primitives/runtime", default-features = false }
sp-session = { path = "../../../primitives/session", default-features = false }
sp-std = { path = "../../../primitives/std", default-features = false }
sp-transaction-pool = { path = "../../../primitives/transaction-pool", default-features = false }
sp-version = { path = "../../../primitives/version", default-features = false }
[build-dependencies]
wasm-builder-runner = { package = "substrate-wasm-builder-runner", path = "../../../utils/wasm-builder-runner", version = "1.0.4" }
@@ -38,30 +39,30 @@ wasm-builder-runner = { package = "substrate-wasm-builder-runner", path = "../..
[features]
default = ["std"]
std = [
"aura-primitives/std",
"aura/std",
"balances/std",
"block-builder-api/std",
"codec/std",
"executive/std",
"frame-executive/std",
"frame-support/std",
"grandpa/std",
"indices/std",
"inherents/std",
"offchain-primitives/std",
"primitives/std",
"randomness-collective-flip/std",
"sp-std/std",
"sp-io/std",
"safe-mix/std",
"serde",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-inherents/std",
"sp-io/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"sudo/std",
"support/std",
"system/std",
"timestamp/std",
"transaction-payment/std",
"sp-transaction-pool/std",
"version/std",
]
+13 -13
View File
@@ -9,7 +9,7 @@
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
use sp_std::prelude::*;
use primitives::OpaqueMetadata;
use sp_core::OpaqueMetadata;
use sp_runtime::{
ApplyExtrinsicResult, transaction_validity::TransactionValidity, generic, create_runtime_str,
impl_opaque_keys, MultiSignature
@@ -18,12 +18,12 @@ use sp_runtime::traits::{
NumberFor, BlakeTwo256, Block as BlockT, StaticLookup, Verify, ConvertInto, IdentifyAccount
};
use sp_api::impl_runtime_apis;
use aura_primitives::sr25519::AuthorityId as AuraId;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use grandpa::AuthorityList as GrandpaAuthorityList;
use grandpa::fg_primitives;
use version::RuntimeVersion;
use sp_version::RuntimeVersion;
#[cfg(feature = "std")]
use version::NativeVersion;
use sp_version::NativeVersion;
// A few exports that help ease life for downstream crates.
#[cfg(any(feature = "std", test))]
@@ -31,7 +31,7 @@ pub use sp_runtime::BuildStorage;
pub use timestamp::Call as TimestampCall;
pub use balances::Call as BalancesCall;
pub use sp_runtime::{Permill, Perbill};
pub use support::{
pub use frame_support::{
StorageValue, construct_runtime, parameter_types,
traits::Randomness,
weights::Weight,
@@ -58,7 +58,7 @@ pub type Balance = u128;
pub type Index = u32;
/// A hash of some data used by the chain.
pub type Hash = primitives::H256;
pub type Hash = sp_core::H256;
/// Digest item type.
pub type DigestItem = generic::DigestItem<Hash>;
@@ -280,7 +280,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
pub type Executive = frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
@@ -303,7 +303,7 @@ impl_runtime_apis! {
}
}
impl block_builder_api::BlockBuilder<Block> for Runtime {
impl sp_block_builder::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
Executive::apply_extrinsic(extrinsic)
}
@@ -312,14 +312,14 @@ impl_runtime_apis! {
Executive::finalize_block()
}
fn inherent_extrinsics(data: inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
data.create_extrinsics()
}
fn check_inherents(
block: Block,
data: inherents::InherentData,
) -> inherents::CheckInherentsResult {
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
}
@@ -334,13 +334,13 @@ impl_runtime_apis! {
}
}
impl offchain_primitives::OffchainWorkerApi<Block> for Runtime {
impl sp_offchain::OffchainWorkerApi<Block> for Runtime {
fn offchain_worker(number: NumberFor<Block>) {
Executive::offchain_worker(number)
}
}
impl aura_primitives::AuraApi<Block, AuraId> for Runtime {
impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> u64 {
Aura::slot_duration()
}
@@ -8,7 +8,7 @@
/// For more guidance on Substrate modules, see the example module
/// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs
use support::{decl_module, decl_storage, decl_event, dispatch};
use frame_support::{decl_module, decl_storage, decl_event, dispatch};
use system::ensure_signed;
/// The module's configuration trait.
@@ -69,8 +69,8 @@ decl_event!(
mod tests {
use super::*;
use primitives::H256;
use support::{impl_outer_origin, assert_ok, parameter_types, weights::Weight};
use sp_core::H256;
use frame_support::{impl_outer_origin, assert_ok, parameter_types, weights::Weight};
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup}, testing::Header, Perbill,
};