mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 07:25:44 +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:
@@ -40,12 +40,22 @@ type BlockImport<B, BE, C, SC> = BabeBlockImport<B, C, GrandpaBlockImport<BE, B,
|
||||
type Block = polkadot_primitives::v1::Block;
|
||||
type SelectChain = sc_consensus::LongestChain<TFullBackend<Block>, Block>;
|
||||
|
||||
sc_executor::native_executor_instance!(
|
||||
pub Executor,
|
||||
polkadot_runtime::api::dispatch,
|
||||
polkadot_runtime::native_version,
|
||||
(benchmarking::benchmarking::HostFunctions, SignatureVerificationOverride),
|
||||
);
|
||||
/// Declare an instance of the native executor named `Executor`. Include the wasm binary as the
|
||||
/// equivalent wasm code.
|
||||
pub struct Executor;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for Executor {
|
||||
type ExtendHostFunctions =
|
||||
(benchmarking::benchmarking::HostFunctions, SignatureVerificationOverride);
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
polkadot_runtime::api::dispatch(method, data)
|
||||
}
|
||||
|
||||
fn native_version() -> sc_executor::NativeVersion {
|
||||
polkadot_runtime::native_version()
|
||||
}
|
||||
}
|
||||
|
||||
/// `ChainInfo` implementation.
|
||||
pub struct PolkadotChainInfo;
|
||||
|
||||
Reference in New Issue
Block a user