mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Statically register host WASM functions (#10394)
* Statically register host WASM functions * Fix `substrate-test-client` compilation * Move `ExtendedHostFunctions` to `sp-wasm-interface` * Fix `sp-runtime-interface` tests' compilation * Fix `sc-executor-wasmtime` tests' compilation * Use `runtime_interface` macro in `test-runner` * Fix `sc-executor` tests' compilation * Reformatting/`rustfmt` * Add an extra comment regarding the `H` generic arg in `create_runtime` * Even more `rustfmt` * Depend on `wasmtime` without default features in `sp-wasm-interface` * Bump version of `sp-wasm-interface` to 4.0.1 * Bump `sp-wasm-interface` in `Cargo.lock` too * Bump all of the `sp-wasm-interface` requirements to 4.0.1 Maybe this will appease cargo-unleash? * Revert "Bump all of the `sp-wasm-interface` requirements to 4.0.1" This reverts commit 0f7ccf8e0f371542861121b145ab87af6541ac30. * Make `cargo-unleash` happy (maybe) * Use `cargo-unleash` to bump the crates' versions * Align to review comments
This commit is contained in:
@@ -24,7 +24,7 @@ use sp_runtime_interface_test_wasm::{test_api::HostFunctions, wasm_binary_unwrap
|
||||
use sp_runtime_interface_test_wasm_deprecated::wasm_binary_unwrap as wasm_binary_deprecated_unwrap;
|
||||
|
||||
use sc_executor_common::runtime_blob::RuntimeBlob;
|
||||
use sp_wasm_interface::HostFunctions as HostFunctionsT;
|
||||
use sp_wasm_interface::{ExtendedHostFunctions, HostFunctions as HostFunctionsT};
|
||||
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
@@ -39,17 +39,11 @@ fn call_wasm_method_with_result<HF: HostFunctionsT>(
|
||||
) -> Result<TestExternalities, String> {
|
||||
let mut ext = TestExternalities::default();
|
||||
let mut ext_ext = ext.ext();
|
||||
let mut host_functions = HF::host_functions();
|
||||
host_functions.extend(sp_io::SubstrateHostFunctions::host_functions());
|
||||
|
||||
let executor = sc_executor::WasmExecutor::new(
|
||||
sc_executor::WasmExecutionMethod::Interpreted,
|
||||
Some(8),
|
||||
host_functions,
|
||||
8,
|
||||
None,
|
||||
2,
|
||||
);
|
||||
let executor = sc_executor::WasmExecutor::<
|
||||
ExtendedHostFunctions<sp_io::SubstrateHostFunctions, HF>,
|
||||
>::new(sc_executor::WasmExecutionMethod::Interpreted, Some(8), 8, None, 2);
|
||||
|
||||
executor
|
||||
.uncached_call(
|
||||
RuntimeBlob::uncompress_if_needed(binary).expect("Failed to parse binary"),
|
||||
|
||||
Reference in New Issue
Block a user