mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +00:00
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:
committed by
Bastian Köcher
parent
cae324598f
commit
ad2d958248
@@ -30,16 +30,16 @@ peerset = { package = "substrate-peerset", path = "../../core/peerset" }
|
||||
tokio-timer = "0.2.11"
|
||||
tokio = { version = "0.1.11", optional = true }
|
||||
keyring = { package = "substrate-keyring", path = "../../core/keyring", optional = true }
|
||||
test_client = { package = "substrate-test-client", path = "../../core/test-client", optional = true }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../core/test-runtime/client", optional = true }
|
||||
void = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = { version = "0.6" }
|
||||
keyring = { package = "substrate-keyring", path = "../../core/keyring" }
|
||||
test_client = { package = "substrate-test-client", path = "../../core/test-client" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../core/test-runtime/client" }
|
||||
consensus = { package = "substrate-consensus-common", path = "../../core/consensus/common", features = ["test-helpers"] }
|
||||
tokio = "0.1.11"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
test-helpers = ["keyring", "test_client", "consensus/test-helpers", "tokio"]
|
||||
test-helpers = ["keyring", "test-client", "consensus/test-helpers", "tokio"]
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user