[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
+22 -22
View File
@@ -30,42 +30,42 @@ use sc_network::FinalityProofProvider;
use sp_blockchain::{
Result as ClientResult, well_known_cache_keys::{self, Id as CacheKeyId},
};
use client_api::{
use sc_client_api::{
ClientInfo, BlockchainEvents, BlockImportNotification,
FinalityNotifications, ImportNotifications,
FinalityNotification,
backend::{AuxStore, Backend, Finalizer}
};
use block_builder::BlockBuilder;
use client::LongestChain;
use sc_block_builder::BlockBuilder;
use sc_client::LongestChain;
use sc_network::config::Roles;
use consensus::block_validation::DefaultBlockAnnounceValidator;
use consensus::import_queue::BasicQueue;
use consensus::import_queue::{
use sp_consensus::block_validation::DefaultBlockAnnounceValidator;
use sp_consensus::import_queue::BasicQueue;
use sp_consensus::import_queue::{
BoxBlockImport, BoxJustificationImport, Verifier, BoxFinalityProofImport,
};
use consensus::block_import::{BlockImport, ImportResult};
use consensus::Error as ConsensusError;
use consensus::{BlockOrigin, ForkChoiceStrategy, BlockImportParams, BlockCheckParams, JustificationImport};
use sp_consensus::block_import::{BlockImport, ImportResult};
use sp_consensus::Error as ConsensusError;
use sp_consensus::{BlockOrigin, ForkChoiceStrategy, BlockImportParams, BlockCheckParams, JustificationImport};
use futures::prelude::*;
use futures03::{StreamExt as _, TryStreamExt as _};
use sc_network::{NetworkWorker, NetworkService, ReportHandle, config::ProtocolId};
use sc_network::config::{NetworkConfiguration, TransportConfig, BoxFinalityProofRequestBuilder};
use libp2p::PeerId;
use parking_lot::Mutex;
use primitives::H256;
use sp_core::H256;
use sc_network::{Context, ProtocolConfig};
use sp_runtime::generic::{BlockId, OpaqueDigestItemId};
use sp_runtime::traits::{Block as BlockT, Header, NumberFor};
use sp_runtime::Justification;
use sc_network::TransactionPool;
use sc_network::specialization::NetworkSpecialization;
use test_client::{self, AccountKeyring};
use substrate_test_runtime_client::{self, AccountKeyring};
pub use test_client::runtime::{Block, Extrinsic, Hash, Transfer};
pub use test_client::{TestClient, TestClientBuilder, TestClientBuilderExt};
pub use substrate_test_runtime_client::runtime::{Block, Extrinsic, Hash, Transfer};
pub use substrate_test_runtime_client::{TestClient, TestClientBuilder, TestClientBuilderExt};
type AuthorityId = babe_primitives::AuthorityId;
type AuthorityId = sp_consensus_babe::AuthorityId;
/// A Verifier that accepts all blocks and passes them on with the configured
/// finality to be imported.
@@ -129,14 +129,14 @@ impl NetworkSpecialization<Block> for DummySpecialization {
}
pub type PeersFullClient =
client::Client<test_client::Backend, test_client::Executor, Block, test_client::runtime::RuntimeApi>;
sc_client::Client<substrate_test_runtime_client::Backend, substrate_test_runtime_client::Executor, Block, substrate_test_runtime_client::runtime::RuntimeApi>;
pub type PeersLightClient =
client::Client<test_client::LightBackend, test_client::LightExecutor, Block, test_client::runtime::RuntimeApi>;
sc_client::Client<substrate_test_runtime_client::LightBackend, substrate_test_runtime_client::LightExecutor, Block, substrate_test_runtime_client::runtime::RuntimeApi>;
#[derive(Clone)]
pub enum PeersClient {
Full(Arc<PeersFullClient>, Arc<test_client::Backend>),
Light(Arc<PeersLightClient>, Arc<test_client::LightBackend>),
Full(Arc<PeersFullClient>, Arc<substrate_test_runtime_client::Backend>),
Light(Arc<PeersLightClient>, Arc<substrate_test_runtime_client::LightBackend>),
}
impl PeersClient {
@@ -218,8 +218,8 @@ pub struct Peer<D, S: NetworkSpecialization<Block>> {
/// We keep a copy of the block_import so that we can invoke it for locally-generated blocks,
/// instead of going through the import queue.
block_import: Box<dyn BlockImport<Block, Error = ConsensusError>>,
select_chain: Option<LongestChain<test_client::Backend, Block>>,
backend: Option<Arc<test_client::Backend>>,
select_chain: Option<LongestChain<substrate_test_runtime_client::Backend, Block>>,
backend: Option<Arc<substrate_test_runtime_client::Backend>>,
network: NetworkWorker<Block, S, <Block as BlockT>::Hash>,
imported_blocks_stream: Box<dyn Stream<Item = BlockImportNotification<Block>, Error = ()> + Send>,
finality_notification_stream: Box<dyn Stream<Item = FinalityNotification<Block>, Error = ()> + Send>,
@@ -237,7 +237,7 @@ impl<D, S: NetworkSpecialization<Block>> Peer<D, S> {
}
// Returns a clone of the local SelectChain, only available on full nodes
pub fn select_chain(&self) -> Option<LongestChain<test_client::Backend, Block>> {
pub fn select_chain(&self) -> Option<LongestChain<substrate_test_runtime_client::Backend, Block>> {
self.select_chain.clone()
}
@@ -608,7 +608,7 @@ pub trait TestNetFactory: Sized {
let mut config = config.clone();
config.roles = Roles::LIGHT;
let (c, backend) = test_client::new_light();
let (c, backend) = substrate_test_runtime_client::new_light();
let client = Arc::new(c);
let (
block_import,