mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
Wasm executor should provide stubs for unknown externs (wasmi) (#4550)
Related to #4456
This commit is contained in:
@@ -67,12 +67,14 @@ pub fn call_in_wasm<E: Externalities, HF: sp_wasm_interface::HostFunctions>(
|
||||
ext: &mut E,
|
||||
code: &[u8],
|
||||
heap_pages: u64,
|
||||
allow_missing_imports: bool,
|
||||
) -> error::Result<Vec<u8>> {
|
||||
let mut instance = wasm_runtime::create_wasm_runtime_with_code(
|
||||
execution_method,
|
||||
heap_pages,
|
||||
code,
|
||||
HF::host_functions(),
|
||||
allow_missing_imports,
|
||||
)?;
|
||||
instance.call(ext, function, call_data)
|
||||
}
|
||||
@@ -103,6 +105,7 @@ mod tests {
|
||||
&mut ext,
|
||||
&WASM_BINARY,
|
||||
8,
|
||||
true,
|
||||
).unwrap();
|
||||
assert_eq!(res, vec![0u8; 0]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user