mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 23:57:56 +00:00
substrate-node: NativeElseWasmExecutor is no longer used (#2521)
This PR removes `NativeElseWasmExecutor` usage from substrate node. Instead [`WasmExecutor<(sp_io::SubstrateHostFunctions, sp_statement_store::runtime_api::HostFunctions)>`](https://github.com/paritytech/polkadot-sdk/blob/49a41ab3bb3f630c20e5b24cec8d92382404631c/substrate/bin/node/executor/src/lib.rs#L26) is used. Related to #2358. --------- Co-authored-by: Davide Galassi <davxy@datawok.net>
This commit is contained in:
committed by
GitHub
parent
1d5d4a4840
commit
39d6c95c0d
@@ -23,7 +23,7 @@ use sp_runtime::BuildStorage;
|
||||
pub use substrate_test_client::*;
|
||||
|
||||
/// Call executor for `kitchensink-runtime` `TestClient`.
|
||||
pub type ExecutorDispatch = sc_executor::NativeElseWasmExecutor<node_executor::ExecutorDispatch>;
|
||||
use node_cli::service::RuntimeExecutor;
|
||||
|
||||
/// Default backend type.
|
||||
pub type Backend = sc_client_db::Backend<node_primitives::Block>;
|
||||
@@ -31,7 +31,7 @@ pub type Backend = sc_client_db::Backend<node_primitives::Block>;
|
||||
/// Test client type.
|
||||
pub type Client = client::Client<
|
||||
Backend,
|
||||
client::LocalCallExecutor<node_primitives::Block, Backend, ExecutorDispatch>,
|
||||
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
|
||||
node_primitives::Block,
|
||||
kitchensink_runtime::RuntimeApi,
|
||||
>;
|
||||
@@ -63,7 +63,7 @@ pub trait TestClientBuilderExt: Sized {
|
||||
impl TestClientBuilderExt
|
||||
for substrate_test_client::TestClientBuilder<
|
||||
node_primitives::Block,
|
||||
client::LocalCallExecutor<node_primitives::Block, Backend, ExecutorDispatch>,
|
||||
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
|
||||
Backend,
|
||||
GenesisParameters,
|
||||
>
|
||||
@@ -71,8 +71,17 @@ impl TestClientBuilderExt
|
||||
fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
fn build(self) -> Client {
|
||||
self.build_with_native_executor(None).0
|
||||
let executor = RuntimeExecutor::builder().build();
|
||||
use sc_service::client::LocalCallExecutor;
|
||||
use std::sync::Arc;
|
||||
let executor = LocalCallExecutor::new(
|
||||
self.backend().clone(),
|
||||
executor.clone(),
|
||||
Default::default(),
|
||||
ExecutionExtensions::new(None, Arc::new(executor)),
|
||||
)
|
||||
.expect("Creates LocalCallExecutor");
|
||||
self.build_with_executor(executor).0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user