Skip to content

Commit 62372d0

Browse files
authored
feat: allow missing host functions in cql.wasm (#6)
1 parent 606538d commit 62372d0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/chainql-core/src/wasm.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ use sc_executor::{RuntimeVersionOf, WasmExecutor};
1111
use sp_core::blake2_256;
1212
use sp_core::traits::{CodeExecutor, RuntimeCode, WrappedRuntimeCode};
1313

14-
type HostFunctions = (sp_io::SubstrateHostFunctions, cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions);
14+
type HostFunctions = (
15+
sp_io::SubstrateHostFunctions,
16+
cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions,
17+
);
1518

1619
use crate::Hex;
1720

@@ -37,7 +40,9 @@ impl RuntimeContainer {
3740
pub fn new(code: Vec<u8>, cache_path: Option<&Path>) -> Self {
3841
let mut executor = <WasmExecutor<HostFunctions>>::builder()
3942
// chainql is single-threaded
40-
.with_max_runtime_instances(1);
43+
.with_max_runtime_instances(1)
44+
// allow to work with runtimes with custom set of host functions
45+
.with_allow_missing_host_functions(true);
4146
if let Some(cache_path) = cache_path {
4247
executor = executor.with_cache_path(cache_path);
4348
};

0 commit comments

Comments
 (0)