mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +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
@@ -28,7 +28,7 @@ inherents = { package = "substrate-inherents", path = "../inherents", default-fe
|
||||
sr-api-macros = { path = "../sr-api-macros" }
|
||||
|
||||
[dev-dependencies]
|
||||
test-client = { package = "substrate-test-client", path = "../test-client" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../test-runtime/client" }
|
||||
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
|
||||
|
||||
[features]
|
||||
|
||||
@@ -25,7 +25,7 @@ consensus_common = { package = "substrate-consensus-common", path = "../../conse
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-keyring = { path = "../../keyring" }
|
||||
test-client = { package = "substrate-test-client", path = "../../test-client" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../test-runtime/client" }
|
||||
env_logger = { version = "0.6" }
|
||||
|
||||
[features]
|
||||
|
||||
@@ -1709,8 +1709,9 @@ pub(crate) mod tests {
|
||||
use runtime_primitives::generic::DigestItem;
|
||||
use consensus::{BlockOrigin, SelectChain};
|
||||
use test_client::{
|
||||
TestClient, AccountKeyring, client::backend::Backend as TestBackend, TestClientBuilder,
|
||||
BlockBuilderExt, runtime::{self, Block, Transfer, RuntimeApi, TestAPI}
|
||||
prelude::*,
|
||||
client::backend::Backend as TestBackend,
|
||||
runtime::{self, Block, Transfer, RuntimeApi, TestAPI},
|
||||
};
|
||||
|
||||
/// Returns tuple, consisting of:
|
||||
|
||||
@@ -473,7 +473,7 @@ pub fn check_execution_proof<Header, E, H>(
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use consensus::BlockOrigin;
|
||||
use test_client::{self, runtime::{Block, Header}, runtime::RuntimeApi, TestClient};
|
||||
use test_client::{self, runtime::Header, ClientExt, TestClient};
|
||||
use executor::NativeExecutionDispatch;
|
||||
use crate::backend::{Backend, NewBlockState};
|
||||
use crate::in_mem::Backend as InMemBackend;
|
||||
@@ -482,13 +482,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn execution_proof_is_generated_and_checked() {
|
||||
type TestClient = test_client::client::Client<
|
||||
test_client::Backend,
|
||||
test_client::Executor,
|
||||
Block,
|
||||
RuntimeApi
|
||||
>;
|
||||
|
||||
fn execute(remote_client: &TestClient, at: u64, method: &'static str) -> (Vec<u8>, Vec<u8>) {
|
||||
let remote_block_id = BlockId::Number(at);
|
||||
let remote_root = remote_client.state_at(&remote_block_id)
|
||||
|
||||
@@ -491,7 +491,7 @@ pub mod tests {
|
||||
use executor::{self, NativeExecutionDispatch};
|
||||
use crate::error::Error as ClientError;
|
||||
use test_client::{
|
||||
self, TestClient, blockchain::HeaderBackend, AccountKeyring,
|
||||
self, ClientExt, blockchain::HeaderBackend, AccountKeyring,
|
||||
runtime::{self, Hash, Block, Header, Extrinsic}
|
||||
};
|
||||
use consensus::BlockOrigin;
|
||||
|
||||
Reference in New Issue
Block a user