[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
@@ -16,17 +16,17 @@
//! Testing block import logic.
use consensus::ImportedAux;
use consensus::import_queue::{
use sp_consensus::ImportedAux;
use sp_consensus::import_queue::{
import_single_block, BasicQueue, BlockImportError, BlockImportResult, IncomingBlock,
};
use test_client::{self, prelude::*};
use test_client::runtime::{Block, Hash};
use substrate_test_runtime_client::{self, prelude::*};
use substrate_test_runtime_client::runtime::{Block, Hash};
use sp_runtime::generic::BlockId;
use super::*;
fn prepare_good_block() -> (TestClient, Hash, u64, PeerId, IncomingBlock<Block>) {
let client = test_client::new();
let client = substrate_test_runtime_client::new();
let block = client.new_block(Default::default()).unwrap().bake().unwrap();
client.import(BlockOrigin::File, block).unwrap();
@@ -52,7 +52,7 @@ fn import_single_good_block_works() {
let mut expected_aux = ImportedAux::default();
expected_aux.is_new_best = true;
match import_single_block(&mut test_client::new(), BlockOrigin::File, block, &mut PassThroughVerifier(true)) {
match import_single_block(&mut substrate_test_runtime_client::new(), BlockOrigin::File, block, &mut PassThroughVerifier(true)) {
Ok(BlockImportResult::ImportedUnknown(ref num, ref aux, ref org))
if *num == number && *aux == expected_aux && *org == Some(peer_id) => {}
r @ _ => panic!("{:?}", r)
@@ -72,7 +72,7 @@ fn import_single_good_known_block_is_ignored() {
fn import_single_good_block_without_header_fails() {
let (_, _, _, peer_id, mut block) = prepare_good_block();
block.header = None;
match import_single_block(&mut test_client::new(), BlockOrigin::File, block, &mut PassThroughVerifier(true)) {
match import_single_block(&mut substrate_test_runtime_client::new(), BlockOrigin::File, block, &mut PassThroughVerifier(true)) {
Err(BlockImportError::IncompleteHeader(ref org)) if *org == Some(peer_id) => {}
_ => panic!()
}
@@ -83,7 +83,7 @@ fn async_import_queue_drops() {
// Perform this test multiple times since it exhibits non-deterministic behavior.
for _ in 0..100 {
let verifier = PassThroughVerifier(true);
let queue = BasicQueue::new(verifier, Box::new(test_client::new()), None, None);
let queue = BasicQueue::new(verifier, Box::new(substrate_test_runtime_client::new()), None, None);
drop(queue);
}
}