mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 23:57:56 +00:00
Wasm executor should provide stubs for unknown externs (wasmi) (#4550)
Related to #4456
This commit is contained in:
@@ -191,10 +191,11 @@ pub fn create_wasm_runtime_with_code(
|
||||
heap_pages: u64,
|
||||
code: &[u8],
|
||||
host_functions: Vec<&'static dyn Function>,
|
||||
allow_missing_imports: bool,
|
||||
) -> Result<Box<dyn WasmRuntime>, WasmError> {
|
||||
match wasm_method {
|
||||
WasmExecutionMethod::Interpreted =>
|
||||
sc_executor_wasmi::create_instance(code, heap_pages, host_functions)
|
||||
sc_executor_wasmi::create_instance(code, heap_pages, host_functions, allow_missing_imports)
|
||||
.map(|runtime| -> Box<dyn WasmRuntime> { Box::new(runtime) }),
|
||||
#[cfg(feature = "wasmtime")]
|
||||
WasmExecutionMethod::Compiled =>
|
||||
@@ -212,7 +213,7 @@ fn create_versioned_wasm_runtime<E: Externalities>(
|
||||
let code = ext
|
||||
.original_storage(well_known_keys::CODE)
|
||||
.ok_or(WasmError::CodeNotFound)?;
|
||||
let mut runtime = create_wasm_runtime_with_code(wasm_method, heap_pages, &code, host_functions)?;
|
||||
let mut runtime = create_wasm_runtime_with_code(wasm_method, heap_pages, &code, host_functions, false)?;
|
||||
|
||||
// Call to determine runtime version.
|
||||
let version_result = {
|
||||
|
||||
Reference in New Issue
Block a user