[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
+8 -8
View File
@@ -5,16 +5,16 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
client-api = { package = "sc-client-api", path = "../../client/api" }
client = { package = "sc-client", path = "../../client/" }
client-db = { package = "sc-client-db", path = "../../client//db", features = ["test-helpers"] }
consensus = { package = "sp-consensus", path = "../../primitives/consensus/common" }
executor = { package = "sc-executor", path = "../../client/executor" }
sc-client-api = { path = "../../client/api" }
sc-client = { path = "../../client/" }
sc-client-db = { path = "../../client/db", features = ["test-helpers"] }
sp-consensus = { path = "../../primitives/consensus/common" }
sc-executor = { path = "../../client/executor" }
futures = "0.3.1"
hash-db = "0.15.2"
keyring = { package = "sp-keyring", path = "../../primitives/keyring" }
sp-keyring = { path = "../../primitives/keyring" }
codec = { package = "parity-scale-codec", version = "1.0.0" }
primitives = { package = "sp-core", path = "../../primitives/core" }
sp-core = { path = "../../primitives/core" }
sp-runtime = { path = "../../primitives/runtime" }
sp-blockchain = { path = "../../primitives/blockchain" }
state_machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
sp-state-machine = { path = "../../primitives/state-machine" }
@@ -16,9 +16,9 @@
//! Client extension for tests.
use client::{self, Client};
use client_api::backend::Finalizer;
use consensus::{
use sc_client::{self, Client};
use sc_client_api::backend::Finalizer;
use sp_consensus::{
BlockImportParams, BlockImport, BlockOrigin, Error as ConsensusError,
ForkChoiceStrategy,
};
@@ -26,7 +26,7 @@ use hash_db::Hasher;
use sp_runtime::Justification;
use sp_runtime::traits::{Block as BlockT};
use sp_runtime::generic::BlockId;
use primitives::Blake2Hasher;
use sp_core::Blake2Hasher;
use codec::alloc::collections::hash_map::HashMap;
/// Extension trait for a test client.
@@ -64,8 +64,8 @@ pub trait ClientExt<Block: BlockT>: Sized {
impl<B, E, RA, Block> ClientExt<Block> for Client<B, E, Block, RA>
where
B: client_api::backend::Backend<Block, Blake2Hasher>,
E: client::CallExecutor<Block, Blake2Hasher>,
B: sc_client_api::backend::Backend<Block, Blake2Hasher>,
E: sc_client::CallExecutor<Block, Blake2Hasher>,
for<'r> &'r Self: BlockImport<Block, Error=ConsensusError>,
Block: BlockT<Hash=<Blake2Hasher as Hasher>::Out>,
{
+26 -25
View File
@@ -20,31 +20,32 @@
pub mod client_ext;
pub use client::{blockchain, self};
pub use client_api::execution_extensions::{ExecutionStrategies, ExecutionExtensions};
pub use client_db::{Backend, self};
pub use client_ext::ClientExt;
pub use consensus;
pub use executor::{NativeExecutor, WasmExecutionMethod, self};
pub use keyring::{
pub use sc_client::{blockchain, self};
pub use sc_client_api::execution_extensions::{ExecutionStrategies, ExecutionExtensions};
pub use sc_client_db::{Backend, self};
pub use sp_consensus;
pub use sc_executor::{NativeExecutor, WasmExecutionMethod, self};
pub use sp_keyring::{
AccountKeyring,
ed25519::Keyring as Ed25519Keyring,
sr25519::Keyring as Sr25519Keyring,
};
pub use primitives::{Blake2Hasher, traits::BareCryptoStorePtr};
pub use sp_core::{Blake2Hasher, traits::BareCryptoStorePtr};
pub use sp_runtime::{Storage, StorageChild};
pub use state_machine::ExecutionStrategy;
pub use sp_state_machine::ExecutionStrategy;
pub use self::client_ext::ClientExt;
use std::sync::Arc;
use std::collections::HashMap;
use hash_db::Hasher;
use primitives::storage::{well_known_keys, ChildInfo};
use sp_core::storage::{well_known_keys, ChildInfo};
use sp_runtime::traits::Block as BlockT;
use client::LocalCallExecutor;
use sc_client::LocalCallExecutor;
/// Test client light database backend.
pub type LightBackend<Block> = client::light::backend::Backend<
client_db::light::LightStorage<Block>,
pub type LightBackend<Block> = sc_client::light::backend::Backend<
sc_client_db::light::LightStorage<Block>,
Blake2Hasher,
>;
@@ -168,16 +169,16 @@ impl<Executor, Backend, G: GenesisInit> TestClientBuilder<Executor, Backend, G>
self,
executor: Executor,
) -> (
client::Client<
sc_client::Client<
Backend,
Executor,
Block,
RuntimeApi,
>,
client::LongestChain<Backend, Block>,
sc_client::LongestChain<Backend, Block>,
) where
Executor: client::CallExecutor<Block, Blake2Hasher>,
Backend: client_api::backend::Backend<Block, Blake2Hasher>,
Executor: sc_client::CallExecutor<Block, Blake2Hasher>,
Backend: sc_client_api::backend::Backend<Block, Blake2Hasher>,
Block: BlockT<Hash=<Blake2Hasher as Hasher>::Out>,
{
@@ -198,7 +199,7 @@ impl<Executor, Backend, G: GenesisInit> TestClientBuilder<Executor, Backend, G>
storage
};
let client = client::Client::new(
let client = sc_client::Client::new(
self.backend.clone(),
executor,
storage,
@@ -209,14 +210,14 @@ impl<Executor, Backend, G: GenesisInit> TestClientBuilder<Executor, Backend, G>
)
).expect("Creates new client");
let longest_chain = client::LongestChain::new(self.backend);
let longest_chain = sc_client::LongestChain::new(self.backend);
(client, longest_chain)
}
}
impl<E, Backend, G: GenesisInit> TestClientBuilder<
client::LocalCallExecutor<Backend, NativeExecutor<E>>,
sc_client::LocalCallExecutor<Backend, NativeExecutor<E>>,
Backend,
G,
> {
@@ -225,17 +226,17 @@ impl<E, Backend, G: GenesisInit> TestClientBuilder<
self,
executor: I,
) -> (
client::Client<
sc_client::Client<
Backend,
client::LocalCallExecutor<Backend, NativeExecutor<E>>,
sc_client::LocalCallExecutor<Backend, NativeExecutor<E>>,
Block,
RuntimeApi
>,
client::LongestChain<Backend, Block>,
sc_client::LongestChain<Backend, Block>,
) where
I: Into<Option<NativeExecutor<E>>>,
E: executor::NativeExecutionDispatch,
Backend: client_api::backend::Backend<Block, Blake2Hasher>,
E: sc_executor::NativeExecutionDispatch,
Backend: sc_client_api::backend::Backend<Block, Blake2Hasher>,
Block: BlockT<Hash=<Blake2Hasher as Hasher>::Out>,
{
let executor = executor.into().unwrap_or_else(||