Make test-client generic over runtime (#2824)

* Make test-client generic over runtime.

* Make sure genesis storage is constructed correctly.

* Use prelude in tests.

* Add an example of how to use test-client with node/runtime.

* Bump version.

* Rename test-clients.
This commit is contained in:
Tomasz Drwięga
2019-06-11 21:54:34 +02:00
committed by Bastian Köcher
parent cae324598f
commit ad2d958248
36 changed files with 497 additions and 342 deletions
@@ -17,7 +17,7 @@
//! Testing block import logic.
use consensus::import_queue::{import_single_block, BasicQueue, BlockImportError, BlockImportResult};
use test_client::{self, TestClient};
use test_client::{self, prelude::*};
use test_client::runtime::{Block, Hash};
use runtime_primitives::generic::BlockId;
use super::*;
@@ -26,12 +26,7 @@ struct TestLink {}
impl Link<Block> for TestLink {}
fn prepare_good_block() -> (client::Client<
test_client::Backend,
test_client::Executor,
Block,
test_client::runtime::RuntimeApi,
>, Hash, u64, PeerId, IncomingBlock<Block>) {
fn prepare_good_block() -> (TestClient, Hash, u64, PeerId, IncomingBlock<Block>) {
let client = test_client::new();
let block = client.new_block(Default::default()).unwrap().bake().unwrap();
client.import(BlockOrigin::File, block).unwrap();