mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
* 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:
Generated
+273
-258
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,9 @@ use cumulus_relay_chain_interface::RelayChainInterface;
|
|||||||
// Substrate Imports
|
// Substrate Imports
|
||||||
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||||
use sc_consensus::ImportQueue;
|
use sc_consensus::ImportQueue;
|
||||||
use sc_executor::NativeElseWasmExecutor;
|
use sc_executor::{
|
||||||
|
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
|
||||||
|
};
|
||||||
use sc_network::NetworkBlock;
|
use sc_network::NetworkBlock;
|
||||||
use sc_network_sync::SyncingService;
|
use sc_network_sync::SyncingService;
|
||||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||||
@@ -81,12 +83,19 @@ pub fn new_partial(
|
|||||||
})
|
})
|
||||||
.transpose()?;
|
.transpose()?;
|
||||||
|
|
||||||
let executor = ParachainExecutor::new(
|
let heap_pages = config
|
||||||
config.wasm_method,
|
.default_heap_pages
|
||||||
config.default_heap_pages,
|
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
|
||||||
config.max_runtime_instances,
|
|
||||||
config.runtime_cache_size,
|
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 = ParachainExecutor::new_with_wasm_executor(wasm);
|
||||||
|
|
||||||
let (client, backend, keystore_container, task_manager) =
|
let (client, backend, keystore_container, task_manager) =
|
||||||
sc_service::new_full_parts::<Block, RuntimeApi, _>(
|
sc_service::new_full_parts::<Block, RuntimeApi, _>(
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ description = "Assets common utilities"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
|
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
|
||||||
|
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
|
||||||
log = { version = "0.4.17", default-features = false }
|
log = { version = "0.4.17", default-features = false }
|
||||||
|
|
||||||
# Substrate
|
# Substrate
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ use sp_std::vec::Vec;
|
|||||||
use xcm::latest::MultiAsset;
|
use xcm::latest::MultiAsset;
|
||||||
|
|
||||||
/// The possible errors that can happen querying the storage of assets.
|
/// The possible errors that can happen querying the storage of assets.
|
||||||
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)]
|
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug, scale_info::TypeInfo)]
|
||||||
pub enum FungiblesAccessError {
|
pub enum FungiblesAccessError {
|
||||||
/// `MultiLocation` to `AssetId`/`ClassId` conversion failed.
|
/// `MultiLocation` to `AssetId`/`ClassId` conversion failed.
|
||||||
AssetIdConversionFailed,
|
AssetIdConversionFailed,
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ use sc_consensus::{
|
|||||||
import_queue::{BasicQueue, Verifier as VerifierT},
|
import_queue::{BasicQueue, Verifier as VerifierT},
|
||||||
BlockImportParams, ImportQueue,
|
BlockImportParams, ImportQueue,
|
||||||
};
|
};
|
||||||
use sc_executor::WasmExecutor;
|
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
|
||||||
use sc_network::NetworkBlock;
|
use sc_network::NetworkBlock;
|
||||||
use sc_network_sync::SyncingService;
|
use sc_network_sync::SyncingService;
|
||||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||||
@@ -257,13 +257,17 @@ where
|
|||||||
})
|
})
|
||||||
.transpose()?;
|
.transpose()?;
|
||||||
|
|
||||||
let executor = sc_executor::WasmExecutor::<HostFunctions>::new(
|
let heap_pages = config
|
||||||
config.wasm_method,
|
.default_heap_pages
|
||||||
config.default_heap_pages,
|
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
|
||||||
config.max_runtime_instances,
|
|
||||||
None,
|
let executor = sc_executor::WasmExecutor::<HostFunctions>::builder()
|
||||||
config.runtime_cache_size,
|
.with_execution_method(config.wasm_method)
|
||||||
);
|
.with_max_runtime_instances(config.max_runtime_instances)
|
||||||
|
.with_runtime_cache_size(config.runtime_cache_size)
|
||||||
|
.with_onchain_heap_alloc_strategy(heap_pages)
|
||||||
|
.with_offchain_heap_alloc_strategy(heap_pages)
|
||||||
|
.build();
|
||||||
|
|
||||||
let (client, backend, keystore_container, task_manager) =
|
let (client, backend, keystore_container, task_manager) =
|
||||||
sc_service::new_full_parts::<Block, RuntimeApi, _>(
|
sc_service::new_full_parts::<Block, RuntimeApi, _>(
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] }
|
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] }
|
||||||
|
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
|
||||||
|
|
||||||
# Substrate
|
# Substrate
|
||||||
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||||
@@ -23,6 +24,7 @@ xcm = { git = "https://github.com/paritytech/polkadot", default-features = false
|
|||||||
default = [ "std" ]
|
default = [ "std" ]
|
||||||
std = [
|
std = [
|
||||||
"codec/std",
|
"codec/std",
|
||||||
|
"scale-info/std",
|
||||||
"sp-api/std",
|
"sp-api/std",
|
||||||
"sp-runtime/std",
|
"sp-runtime/std",
|
||||||
"sp-std/std",
|
"sp-std/std",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
use codec::{Decode, Encode};
|
use codec::{Decode, Encode};
|
||||||
use polkadot_parachain::primitives::HeadData;
|
use polkadot_parachain::primitives::HeadData;
|
||||||
|
use scale_info::TypeInfo;
|
||||||
use sp_runtime::{traits::Block as BlockT, RuntimeDebug};
|
use sp_runtime::{traits::Block as BlockT, RuntimeDebug};
|
||||||
use sp_std::prelude::*;
|
use sp_std::prelude::*;
|
||||||
|
|
||||||
@@ -229,7 +230,7 @@ impl CollationInfoV1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Information about a collation.
|
/// Information about a collation.
|
||||||
#[derive(Clone, Debug, codec::Decode, codec::Encode, PartialEq)]
|
#[derive(Clone, Debug, codec::Decode, codec::Encode, PartialEq, TypeInfo)]
|
||||||
pub struct CollationInfo {
|
pub struct CollationInfo {
|
||||||
/// Messages destined to be interpreted by the Relay chain itself.
|
/// Messages destined to be interpreted by the Relay chain itself.
|
||||||
pub upward_messages: Vec<UpwardMessage>,
|
pub upward_messages: Vec<UpwardMessage>,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ use runtime::{
|
|||||||
Balance, Block, BlockHashCount, GenesisConfig, Runtime, RuntimeCall, Signature, SignedExtra,
|
Balance, Block, BlockHashCount, GenesisConfig, Runtime, RuntimeCall, Signature, SignedExtra,
|
||||||
SignedPayload, UncheckedExtrinsic, VERSION,
|
SignedPayload, UncheckedExtrinsic, VERSION,
|
||||||
};
|
};
|
||||||
use sc_executor::{WasmExecutionMethod, WasmExecutor};
|
use sc_executor::{HeapAllocStrategy, WasmExecutionMethod, WasmExecutor};
|
||||||
use sc_executor_common::runtime_blob::RuntimeBlob;
|
use sc_executor_common::runtime_blob::RuntimeBlob;
|
||||||
use sc_service::client;
|
use sc_service::client;
|
||||||
use sp_blockchain::HeaderBackend;
|
use sp_blockchain::HeaderBackend;
|
||||||
@@ -181,13 +181,14 @@ pub fn validate_block(
|
|||||||
let mut ext = TestExternalities::default();
|
let mut ext = TestExternalities::default();
|
||||||
let mut ext_ext = ext.ext();
|
let mut ext_ext = ext.ext();
|
||||||
|
|
||||||
let executor = WasmExecutor::<sp_io::SubstrateHostFunctions>::new(
|
let heap_pages = HeapAllocStrategy::Static { extra_pages: 1024 };
|
||||||
WasmExecutionMethod::Interpreted,
|
let executor = WasmExecutor::<sp_io::SubstrateHostFunctions>::builder()
|
||||||
Some(1024),
|
.with_execution_method(WasmExecutionMethod::Interpreted)
|
||||||
1,
|
.with_max_runtime_instances(1)
|
||||||
None,
|
.with_runtime_cache_size(2)
|
||||||
2,
|
.with_onchain_heap_alloc_strategy(heap_pages)
|
||||||
);
|
.with_offchain_heap_alloc_strategy(heap_pages)
|
||||||
|
.build();
|
||||||
|
|
||||||
executor
|
executor
|
||||||
.uncached_call(
|
.uncached_call(
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
pub mod chain_spec;
|
pub mod chain_spec;
|
||||||
mod genesis;
|
mod genesis;
|
||||||
|
|
||||||
|
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
|
||||||
use std::{
|
use std::{
|
||||||
future::Future,
|
future::Future,
|
||||||
net::{IpAddr, Ipv4Addr, SocketAddr},
|
net::{IpAddr, Ipv4Addr, SocketAddr},
|
||||||
@@ -184,12 +185,20 @@ pub fn new_partial(
|
|||||||
>,
|
>,
|
||||||
sc_service::Error,
|
sc_service::Error,
|
||||||
> {
|
> {
|
||||||
let executor = sc_executor::NativeElseWasmExecutor::<RuntimeExecutor>::new(
|
let heap_pages = config
|
||||||
config.wasm_method,
|
.default_heap_pages
|
||||||
config.default_heap_pages,
|
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
|
||||||
config.max_runtime_instances,
|
|
||||||
config.runtime_cache_size,
|
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) =
|
let (client, backend, keystore_container, task_manager) =
|
||||||
sc_service::new_full_parts::<Block, RuntimeApi, _>(config, None, executor)?;
|
sc_service::new_full_parts::<Block, RuntimeApi, _>(config, None, executor)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user