mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 23:57:56 +00:00
Cursed implementation of allowing missing imports on wasmtime (#4730)
* Quick and dirty impl. * Clean up * Check the signatures. * Fix tests. * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Ignore non function members. Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
e4f3e85585
commit
2421576f91
@@ -191,15 +191,15 @@ pub fn create_wasm_runtime_with_code(
|
||||
heap_pages: u64,
|
||||
code: &[u8],
|
||||
host_functions: Vec<&'static dyn Function>,
|
||||
allow_missing_imports: bool,
|
||||
allow_missing_func_imports: bool,
|
||||
) -> Result<Box<dyn WasmRuntime>, WasmError> {
|
||||
match wasm_method {
|
||||
WasmExecutionMethod::Interpreted =>
|
||||
sc_executor_wasmi::create_instance(code, heap_pages, host_functions, allow_missing_imports)
|
||||
sc_executor_wasmi::create_instance(code, heap_pages, host_functions, allow_missing_func_imports)
|
||||
.map(|runtime| -> Box<dyn WasmRuntime> { Box::new(runtime) }),
|
||||
#[cfg(feature = "wasmtime")]
|
||||
WasmExecutionMethod::Compiled =>
|
||||
sc_executor_wasmtime::create_instance(code, heap_pages, host_functions)
|
||||
sc_executor_wasmtime::create_instance(code, heap_pages, host_functions, allow_missing_func_imports)
|
||||
.map(|runtime| -> Box<dyn WasmRuntime> { Box::new(runtime) }),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user