mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
refactor(sc-executor): use wasm executor builder instead of old apis (#13740)
* refactor: use builder api for all executors * improve a lot * remove unused args * cleanup deps * fix inconsistency about heap alloc * add `heap_pages` back to try-runtime * fix * chore: reduce duplicated code for sc-service-test * cleanup code * fmt * improve test executor * improve * use #[deprecated] * set runtime_cache_size: 4 * fix and improve * refactor builder * fix * fix bench * fix tests * fix warnings * fix warnings * fix * fix * update by suggestions * update name
This commit is contained in:
@@ -29,6 +29,7 @@ use substrate_test_runtime_client::{
|
||||
use codec::Encode;
|
||||
use sc_block_builder::BlockBuilderProvider;
|
||||
use sp_consensus::SelectChain;
|
||||
use substrate_test_runtime_client::sc_executor::WasmExecutor;
|
||||
|
||||
fn calling_function_with_strat(strat: ExecutionStrategy) {
|
||||
let client = TestClientBuilder::new().set_execution_strategy(strat).build();
|
||||
@@ -178,11 +179,8 @@ fn record_proof_works() {
|
||||
|
||||
// Use the proof backend to execute `execute_block`.
|
||||
let mut overlay = Default::default();
|
||||
let executor = NativeElseWasmExecutor::<LocalExecutorDispatch>::new(
|
||||
WasmExecutionMethod::Interpreted,
|
||||
None,
|
||||
8,
|
||||
2,
|
||||
let executor = NativeElseWasmExecutor::<LocalExecutorDispatch>::new_with_wasm_executor(
|
||||
WasmExecutor::builder().build(),
|
||||
);
|
||||
execution_proof_check_on_trie_backend(
|
||||
&backend,
|
||||
|
||||
@@ -42,7 +42,8 @@ fn call_wasm_method_with_result<HF: HostFunctionsT>(
|
||||
|
||||
let executor = sc_executor::WasmExecutor::<
|
||||
ExtendedHostFunctions<sp_io::SubstrateHostFunctions, HF>,
|
||||
>::new(sc_executor::WasmExecutionMethod::Interpreted, Some(8), 8, None, 2);
|
||||
>::builder()
|
||||
.build();
|
||||
|
||||
let (result, allocation_stats) = executor.uncached_call_with_allocation_stats(
|
||||
RuntimeBlob::uncompress_if_needed(binary).expect("Failed to parse binary"),
|
||||
|
||||
Reference in New Issue
Block a user