mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 03:11:01 +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:
@@ -35,7 +35,6 @@ use polkadot_test_runtime::{
|
||||
};
|
||||
use sc_chain_spec::ChainSpec;
|
||||
use sc_client_api::execution_extensions::ExecutionStrategies;
|
||||
use sc_executor::native_executor_instance;
|
||||
use sc_network::{
|
||||
config::{NetworkConfiguration, TransportConfig},
|
||||
multiaddr,
|
||||
@@ -55,12 +54,21 @@ use substrate_test_client::{
|
||||
BlockchainEventsExt, RpcHandlersExt, RpcTransactionError, RpcTransactionOutput,
|
||||
};
|
||||
|
||||
native_executor_instance!(
|
||||
pub PolkadotTestExecutor,
|
||||
polkadot_test_runtime::api::dispatch,
|
||||
polkadot_test_runtime::native_version,
|
||||
frame_benchmarking::benchmarking::HostFunctions,
|
||||
);
|
||||
/// Declare an instance of the native executor named `PolkadotTestExecutor`. Include the wasm binary as the
|
||||
/// equivalent wasm code.
|
||||
pub struct PolkadotTestExecutor;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for PolkadotTestExecutor {
|
||||
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
polkadot_test_runtime::api::dispatch(method, data)
|
||||
}
|
||||
|
||||
fn native_version() -> sc_executor::NativeVersion {
|
||||
polkadot_test_runtime::native_version()
|
||||
}
|
||||
}
|
||||
|
||||
/// The client type being used by the test service.
|
||||
pub type Client = FullClient<polkadot_test_runtime::RuntimeApi, PolkadotTestExecutor>;
|
||||
|
||||
Reference in New Issue
Block a user