Skip to content
Snippets Groups Projects
Commit 4ff38677 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

fix(#214): also allow this feature for gtest and g1

parent a086d74a
No related branches found
No related tags found
1 merge request!255Resolve "Allow native Runtime execution"
Pipeline #36459 passed
......@@ -89,7 +89,9 @@ pub mod gdev_executor {
#[allow(dead_code)]
#[cfg(feature = "g1")]
pub mod g1_executor {
use crate::service::HostFunctions;
pub use g1_runtime;
use sc_executor::sp_wasm_interface::{Function, HostFunctionRegistry};
pub struct G1Executor;
impl sc_executor::NativeExecutionDispatch for G1Executor {
......@@ -103,12 +105,26 @@ pub mod g1_executor {
g1_runtime::native_version()
}
}
impl sc_executor::sp_wasm_interface::HostFunctions for G1Executor {
fn host_functions() -> Vec<&'static dyn Function> {
HostFunctions::host_functions()
}
fn register_static<T>(registry: &mut T) -> Result<(), T::Error>
where
T: HostFunctionRegistry,
{
HostFunctions::register_static(registry)
}
}
}
#[allow(dead_code)]
#[cfg(feature = "gtest")]
pub mod gtest_executor {
use crate::service::HostFunctions;
pub use gtest_runtime;
use sc_executor::sp_wasm_interface::{Function, HostFunctionRegistry};
pub struct GTestExecutor;
impl sc_executor::NativeExecutionDispatch for GTestExecutor {
......@@ -122,6 +138,18 @@ pub mod gtest_executor {
gtest_runtime::native_version()
}
}
impl sc_executor::sp_wasm_interface::HostFunctions for GTestExecutor {
fn host_functions() -> Vec<&'static dyn Function> {
HostFunctions::host_functions()
}
fn register_static<T>(registry: &mut T) -> Result<(), T::Error>
where
T: HostFunctionRegistry,
{
HostFunctions::register_static(registry)
}
}
}
///
/// The minimum period of blocks on which justifications will be
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment