node-template: Do not provide benchmarking host functions by default (#10005)

This commit is contained in:
Bastian Köcher
2021-10-12 06:12:29 +02:00
committed by GitHub
parent 582ac8f932
commit 8f8b08871f
@@ -16,7 +16,12 @@ use std::{sync::Arc, time::Duration};
pub struct ExecutorDispatch;
impl sc_executor::NativeExecutionDispatch for ExecutorDispatch {
/// Only enable the benchmarking host functions when we actually want to benchmark.
#[cfg(feature = "runtime-benchmarks")]
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
/// Otherwise we only use the default Substrate host functions.
#[cfg(not(feature = "runtime-benchmarks"))]
type ExtendHostFunctions = ();
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
node_template_runtime::api::dispatch(method, data)