Skip to content
Snippets Groups Projects

Resolve "Allow native Runtime execution"

Merged Cédric Moreau requested to merge 214-allow-native-runtime-execution into master
1 file
+ 28
0
Compare changes
  • Side-by-side
  • Inline
+ 28
0
@@ -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
Loading