mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Companion PR for 'Simplify NativeExecutionDispatch and remove the native_executor_instance!' (9562) (#3643)
* Companion PR * Add test executors * Change comment to doc comment * Update node/test/service/src/lib.rs * Improve comments * update Substrate Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
use rialto_runtime::{self, opaque::Block, RuntimeApi};
|
||||
use sc_client_api::{ExecutorProvider, RemoteBackend};
|
||||
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
|
||||
use sc_executor::native_executor_instance;
|
||||
pub use sc_executor::NativeExecutor;
|
||||
|
||||
use sc_keystore::LocalKeystore;
|
||||
@@ -44,12 +43,19 @@ use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
// Our native executor instance.
|
||||
native_executor_instance!(
|
||||
pub Executor,
|
||||
rialto_runtime::api::dispatch,
|
||||
rialto_runtime::native_version,
|
||||
frame_benchmarking::benchmarking::HostFunctions,
|
||||
);
|
||||
pub struct Executor;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for Executor {
|
||||
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
rialto_runtime::api::dispatch(method, data)
|
||||
}
|
||||
|
||||
fn native_version() -> sc_executor::NativeVersion {
|
||||
rialto_runtime::native_version()
|
||||
}
|
||||
}
|
||||
|
||||
type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
|
||||
type FullBackend = sc_service::TFullBackend<Block>;
|
||||
|
||||
Reference in New Issue
Block a user