Companion for Substrate#10394 (#4471)

* Align PVF executor to changes in Substrate

* Update to the newest `substrate`
This commit is contained in:
Koute
2021-12-14 18:47:10 +09:00
committed by GitHub
parent 32bb94afff
commit c328d1e63b
2 changed files with 168 additions and 168 deletions
+1 -3
View File
@@ -22,7 +22,6 @@ use sc_executor_common::{
};
use sc_executor_wasmtime::{Config, DeterministicStackLimit, Semantics};
use sp_core::storage::{ChildInfo, TrackedStorageKey};
use sp_wasm_interface::HostFunctions as _;
use std::any::{Any, TypeId};
const CONFIG: Config = Config {
@@ -114,10 +113,9 @@ pub unsafe fn execute(
let mut ext = ValidationExternalities(extensions);
sc_executor::with_externalities_safe(&mut ext, || {
let runtime = sc_executor_wasmtime::create_runtime_from_artifact(
let runtime = sc_executor_wasmtime::create_runtime_from_artifact::<HostFunctions>(
compiled_artifact,
CONFIG,
HostFunctions::host_functions(),
)?;
runtime.new_instance()?.call(InvokeMethod::Export("validate_block"), params)
})?