mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 03:17:56 +00:00
Simplify NativeExecutionDispatch and remove the native_executor_instance! macro (#9562)
* Remove the `native_executor_instance!` macro * Add comment to test runner ex * Fix comments
This commit is contained in:
@@ -27,7 +27,6 @@ use sc_client_db::{
|
||||
use sc_consensus::{
|
||||
BlockCheckParams, BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult,
|
||||
};
|
||||
use sc_executor::native_executor_instance;
|
||||
use sc_service::client::{self, new_in_mem, Client, LocalCallExecutor};
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_consensus::{BlockOrigin, BlockStatus, Error as ConsensusError, SelectChain};
|
||||
@@ -63,11 +62,19 @@ mod light;
|
||||
|
||||
const TEST_ENGINE_ID: ConsensusEngineId = *b"TEST";
|
||||
|
||||
native_executor_instance!(
|
||||
Executor,
|
||||
substrate_test_runtime_client::runtime::api::dispatch,
|
||||
substrate_test_runtime_client::runtime::native_version,
|
||||
);
|
||||
pub struct Executor;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for Executor {
|
||||
type ExtendHostFunctions = ();
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
substrate_test_runtime_client::runtime::api::dispatch(method, data)
|
||||
}
|
||||
|
||||
fn native_version() -> sc_executor::NativeVersion {
|
||||
substrate_test_runtime_client::runtime::native_version()
|
||||
}
|
||||
}
|
||||
|
||||
fn executor() -> sc_executor::NativeExecutor<Executor> {
|
||||
sc_executor::NativeExecutor::new(sc_executor::WasmExecutionMethod::Interpreted, None, 8)
|
||||
|
||||
Reference in New Issue
Block a user