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
+9 -8
View File
@@ -22,7 +22,7 @@ use runtime::{
Balance, Block, BlockHashCount, GenesisConfig, Runtime, RuntimeCall, Signature, SignedExtra,
SignedPayload, UncheckedExtrinsic, VERSION,
};
use sc_executor::{WasmExecutionMethod, WasmExecutor};
use sc_executor::{HeapAllocStrategy, WasmExecutionMethod, WasmExecutor};
use sc_executor_common::runtime_blob::RuntimeBlob;
use sc_service::client;
use sp_blockchain::HeaderBackend;
@@ -181,13 +181,14 @@ pub fn validate_block(
let mut ext = TestExternalities::default();
let mut ext_ext = ext.ext();
let executor = WasmExecutor::<sp_io::SubstrateHostFunctions>::new(
WasmExecutionMethod::Interpreted,
Some(1024),
1,
None,
2,
);
let heap_pages = HeapAllocStrategy::Static { extra_pages: 1024 };
let executor = WasmExecutor::<sp_io::SubstrateHostFunctions>::builder()
.with_execution_method(WasmExecutionMethod::Interpreted)
.with_max_runtime_instances(1)
.with_runtime_cache_size(2)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.build();
executor
.uncached_call(