mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +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
@@ -895,6 +895,21 @@ mod tests {
|
||||
assert!(t.storage_changes_root(GENESIS_HASH.into()).unwrap().is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_import_block_with_test_client() {
|
||||
use test_client::{ClientExt, TestClientBuilder, consensus::BlockOrigin};
|
||||
|
||||
let client = TestClientBuilder::default()
|
||||
.build_with_native_executor::<Block, node_runtime::RuntimeApi, _>(executor())
|
||||
.0;
|
||||
|
||||
let block1 = changes_trie_block();
|
||||
let block_data = block1.0;
|
||||
let block = Block::decode(&mut &block_data[..]).unwrap();
|
||||
|
||||
client.import(BlockOrigin::Own, block).unwrap();
|
||||
}
|
||||
|
||||
#[cfg(feature = "benchmarks")]
|
||||
mod benches {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user