Companion for #13302 (#2357)

* primitives/core: Derive scale_info::TypeInfo for runtime APIs

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* parachains: Derive scale_info::TypeInfo for FungiblesAccessError

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* parachains: Fix `TypeInfo` import path

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* update lockfile for {"polkadot", "substrate"}

* Adjust testing for the new API

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Adjust deprecated methods

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
Alexandru Vasile
2023-04-11 17:23:39 +03:00
committed by GitHub
parent b0715f9bd9
commit 03763dd077
9 changed files with 331 additions and 289 deletions
+15 -6
View File
@@ -21,6 +21,7 @@
pub mod chain_spec;
mod genesis;
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
use std::{
future::Future,
net::{IpAddr, Ipv4Addr, SocketAddr},
@@ -184,12 +185,20 @@ pub fn new_partial(
>,
sc_service::Error,
> {
let executor = sc_executor::NativeElseWasmExecutor::<RuntimeExecutor>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
config.runtime_cache_size,
);
let heap_pages = config
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
let wasm = WasmExecutor::builder()
.with_execution_method(config.wasm_method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.build();
let executor =
sc_executor::NativeElseWasmExecutor::<RuntimeExecutor>::new_with_wasm_executor(wasm);
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(config, None, executor)?;