Macro sc_executor::native_executor_instance [−][src]
Implements a NativeExecutionDispatch
for provided parameters.
Example
sc_executor::native_executor_instance!( pub MyExecutor, substrate_test_runtime::api::dispatch, substrate_test_runtime::native_version, );
With custom host functions
When you want to use custom runtime interfaces from within your runtime, you need to make the executor aware of the host functions for these interfaces.
#[runtime_interface] trait MyInterface { fn say_hello_world(data: &str) { println!("Hello world from: {}", data); } } sc_executor::native_executor_instance!( pub MyExecutor, substrate_test_runtime::api::dispatch, substrate_test_runtime::native_version, my_interface::HostFunctions, );
When you have multiple interfaces, you can give the host functions as a tuple e.g.:
(my_interface::HostFunctions, my_interface2::HostFunctions)