Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to 1.9.0 #179

Merged
merged 5 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,596 changes: 2,395 additions & 2,201 deletions Cargo.lock

Large diffs are not rendered by default.

195 changes: 98 additions & 97 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ subxt-signer = "0.34.0"
tokio = { version = "1.36", features = ["macros", "time", "rt-multi-thread"] }

# Build
substrate-wasm-builder = "19.0.0"
substrate-wasm-builder = "20.0.0"
substrate-build-script-utils = "11.0.0"

# Local
Expand All @@ -61,112 +61,113 @@ pop-runtime-common = { path = "runtime/common", default-features = false }
pop-primitives = { path = "./primitives", default-features = false }

# Substrate
sc-basic-authorship = "0.36.0"
sc-chain-spec = "29.0.0"
sc-cli = "0.38.0"
sc-client-api = "30.0.0"
sc-offchain = "31.0.0"
sc-consensus = "0.35.0"
sc-executor = "0.34.0"
sc-network = "0.36.0"
sc-network-sync = "0.35.0"
sc-rpc = "31.0.0"
sc-service = "0.37.0"
sc-sysinfo = "29.0.0"
sc-basic-authorship = "0.37.0"
sc-chain-spec = "30.0.1"
sc-cli = "0.39.0"
sc-client-api = "31.0.0"
sc-offchain = "32.0.0"
sc-consensus = "0.36.0"
sc-executor = "0.35.0"
sc-network = "0.37.0"
sc-network-sync = "0.36.0"
sc-rpc = "32.0.0"
sc-service = "0.38.0"
sc-sysinfo = "30.0.0"
sc-telemetry = "17.0.0"
sc-tracing = "30.0.0"
sc-transaction-pool = "30.0.0"
sc-transaction-pool-api = "30.0.0"
frame-benchmarking = { version = "30.0.0", default-features = false }
frame-benchmarking-cli = "34.0.0"
frame-executive = { version = "30.0.0", default-features = false }
frame-support = { version = "30.0.0", default-features = false }
frame-system = { version = "30.0.0", default-features = false }
frame-system-benchmarking = { version = "30.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "28.0.0", default-features = false }
frame-try-runtime = { version = "0.36.0", default-features = false }
pallet-aura = { version = "29.0.0", default-features = false }
pallet-authorship = { version = "30.0.0", default-features = false }
pallet-assets = { version = "31.0.0", default-features = false }
pallet-balances = { version = "30.0.0", default-features = false }
pallet-contracts = { version = "29.0.0", default-features = false }
pallet-message-queue = { version = "33.0.0", default-features = false }
pallet-multisig = { version = "30.0.0", default-features = false }
pallet-nft-fractionalization = { version = "12.0.0", default-features = false }
pallet-nfts = { version = "24.0.0", default-features = false }
pallet-nfts-runtime-api = { version = "16.0.0", default-features = false }
pallet-preimage = { version = "30.0.0", default-features = false }
pallet-proxy = { version = "30.0.0", default-features = false }
pallet-scheduler = { version = "31.0.0", default-features = false }
pallet-session = { version = "30.0.0", default-features = false }
pallet-sudo = { version = "30.0.0", default-features = false }
pallet-timestamp = { version = "29.0.0", default-features = false }
pallet-transaction-payment = { version = "30.0.0", default-features = false }
pallet-transaction-payment-rpc = "32.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "30.0.0", default-features = false }
pallet-utility = { version = "30.0.0", default-features = false }
sp-api = { version = "28.0.0", default-features = false }
sp-authority-discovery = { version = "28.0.0", default-features = false }
sp-block-builder = { version = "28.0.0", default-features = false }
sp-blockchain = "30.0.0"
sp-consensus-aura = { version = "0.34.0", default-features = false }
sp-consensus-babe = { version = "0.34.0", default-features = false }
sp-consensus-beefy = { version = "15.0.0", default-features = false }
sp-consensus-grandpa = { version = "15.0.0", default-features = false }
sp-core = { version = "30.0.0", default-features = false }
sp-keystore = "0.36.0"
sp-io = { version = "32.0.0", default-features = false }
sp-genesis-builder = { version = "0.9.0", default-features = false }
sp-inherents = { version = "28.0.0", default-features = false }
sp-offchain = { version = "28.0.0", default-features = false }
sp-runtime = { version = "33.0.0", default-features = false }
sp-timestamp = "28.0.0"
substrate-frame-rpc-system = "30.0.0"
sc-tracing = "31.0.0"
sc-transaction-pool = "31.0.0"
sc-transaction-pool-api = "31.0.0"
frame-benchmarking = { version = "31.0.0", default-features = false }
frame-benchmarking-cli = "35.0.1"
frame-executive = { version = "31.0.0", default-features = false }
frame-support = { version = "31.0.0", default-features = false }
frame-system = { version = "31.0.0", default-features = false }
frame-system-benchmarking = { version = "31.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "29.0.0", default-features = false }
frame-try-runtime = { version = "0.37.0", default-features = false }
pallet-aura = { version = "30.0.0", default-features = false }
pallet-authorship = { version = "31.0.0", default-features = false }
pallet-assets = { version = "32.0.0", default-features = false }
pallet-balances = { version = "31.0.0", default-features = false }
pallet-contracts = { version = "30.0.0", default-features = false }
pallet-message-queue = { version = "34.0.0", default-features = false }
pallet-multisig = { version = "31.0.0", default-features = false }
pallet-nft-fractionalization = { version = "13.0.0", default-features = false }
pallet-nfts = { version = "25.0.0", default-features = false }
pallet-nfts-runtime-api = { version = "17.0.0", default-features = false }
pallet-preimage = { version = "31.0.0", default-features = false }
pallet-proxy = { version = "31.0.0", default-features = false }
pallet-scheduler = { version = "32.0.0", default-features = false }
pallet-session = { version = "31.0.0", default-features = false }
pallet-sudo = { version = "31.0.0", default-features = false }
pallet-timestamp = { version = "30.0.0", default-features = false }
pallet-transaction-payment = { version = "31.0.0", default-features = false }
pallet-transaction-payment-rpc = "33.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "31.0.0", default-features = false }
pallet-utility = { version = "31.0.0", default-features = false }
sp-api = { version = "29.0.0", default-features = false }
sp-authority-discovery = { version = "29.0.0", default-features = false }
sp-block-builder = { version = "29.0.0", default-features = false }
sp-blockchain = "31.0.0"
sp-consensus-aura = { version = "0.35.0", default-features = false }
sp-consensus-babe = { version = "0.35.0", default-features = false }
sp-consensus-beefy = { version = "16.0.0", default-features = false }
sp-consensus-grandpa = { version = "16.0.0", default-features = false }
sp-core = { version = "31.0.0", default-features = false }
sp-keystore = "0.37.0"
sp-io = { version = "33.0.0", default-features = false }
sp-genesis-builder = { version = "0.10.0", default-features = false }
sp-inherents = { version = "29.0.0", default-features = false }
sp-offchain = { version = "29.0.0", default-features = false }
sp-runtime = { version = "34.0.0", default-features = false }
sp-timestamp = "29.0.0"
substrate-frame-rpc-system = "31.0.0"
substrate-prometheus-endpoint = "0.17.0"
sp-session = { version = "29.0.0", default-features = false }
sp-session = { version = "30.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-transaction-pool = { version = "28.0.0", default-features = false }
sp-version = { version = "31.0.0", default-features = false }
sp-transaction-pool = { version = "29.0.0", default-features = false }
sp-version = { version = "32.0.0", default-features = false }

# Polkadot
pallet-xcm = { version = "9.0.1", default-features = false }
polkadot-cli = "9.0.0"
polkadot-parachain-primitives = { version = "8.0.0", default-features = false }
polkadot-runtime-parachains = { version = "9.0.0", default-features = false }
polkadot-primitives = { version = "9.0.0", default-features = false }
polkadot-runtime-common = { version = "9.0.0", default-features = false }
rococo-runtime-constants = { version = "9.0.0", default-features = false }
rococo-runtime = { version = "9.0.0", default-features = false }
xcm = { version = "9.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "9.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "9.0.1", package = "staging-xcm-executor", default-features = false }
pallet-xcm = { version = "10.0.1", default-features = false }
polkadot-cli = "10.0.0"
polkadot-parachain-primitives = { version = "9.0.0", default-features = false }
polkadot-runtime-parachains = { version = "10.0.0", default-features = false }
polkadot-primitives = { version = "10.0.0", default-features = false }
polkadot-runtime-common = { version = "10.0.0", default-features = false }
rococo-runtime-constants = { version = "10.0.0", default-features = false }
rococo-runtime = { version = "10.0.0", default-features = false }
xcm = { version = "10.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "10.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "10.0.0", package = "staging-xcm-executor", default-features = false }

# Cumulus
asset-hub-rococo-runtime = { version = "0.13.0", default-features = false }
asset-test-utils = { version = "9.0.0", default-features = false }
cumulus-pallet-aura-ext = { version = "0.9.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.9.0", default-features = false, features = [
asset-hub-rococo-runtime = { version = "0.14.0", default-features = false }
asset-test-utils = { version = "10.0.0", default-features = false }
cumulus-pallet-aura-ext = { version = "0.10.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.10.0", default-features = false, features = [
"parameterized-consensus-hook",
] }
cumulus-pallet-session-benchmarking = { version = "11.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.9.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.9.0", default-features = false }
cumulus-primitives-aura = { version = "0.9.0", default-features = false }
cumulus-primitives-core = { version = "0.9.0", default-features = false }
cumulus-primitives-utility = { version = "0.9.0", default-features = false }
emulated-integration-tests-common = { version = "5.0.0", default-features = false }
pallet-collator-selection = { version = "11.0.1", default-features = false }
parachains-common = { version = "9.0.0", default-features = false }
parachain-info = { version = "0.9.0", package = "staging-parachain-info", default-features = false }
cumulus-primitives-parachain-inherent = "0.9.0"
cumulus-relay-chain-interface = "0.9.0"
cumulus-pallet-session-benchmarking = { version = "12.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.10.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.10.0", default-features = false }
cumulus-primitives-aura = { version = "0.10.0", default-features = false }
cumulus-primitives-core = { version = "0.10.0", default-features = false }
cumulus-primitives-storage-weight-reclaim = { version = "1.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.10.0", default-features = false }
emulated-integration-tests-common = { version = "6.0.0", default-features = false }
pallet-collator-selection = { version = "12.0.1", default-features = false }
parachains-common = { version = "10.0.0", default-features = false }
parachain-info = { version = "0.10.0", package = "staging-parachain-info", default-features = false }
cumulus-primitives-parachain-inherent = "0.10.0"
cumulus-relay-chain-interface = "0.10.0"
color-print = "0.3.4"
cumulus-client-cli = "0.9.0"
cumulus-client-collator = "0.9.0"
cumulus-client-consensus-aura = "0.9.0"
cumulus-client-consensus-common = "0.9.0"
cumulus-client-consensus-proposer = "0.9.0"
cumulus-client-service = "0.9.0"
cumulus-client-cli = "0.10.0"
cumulus-client-collator = "0.10.0"
cumulus-client-consensus-aura = "0.10.0"
cumulus-client-consensus-common = "0.10.0"
cumulus-client-consensus-proposer = "0.10.0"
cumulus-client-service = "0.10.0"

# Paseo
asset-hub-paseo-runtime = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{net::SocketAddr, path::PathBuf};

use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
Expand Down Expand Up @@ -270,7 +271,7 @@ pub fn run() -> Result<()> {
match cmd {
BenchmarkCmd::Pallet(cmd) =>
if cfg!(feature = "runtime-benchmarks") {
runner.sync_run(|config| cmd.run::<sp_runtime::traits::HashingFor<Block>, ()>(config))
runner.sync_run(|config| cmd.run::<sp_runtime::traits::HashingFor<Block>, ReclaimHostFunctions>(config))
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
Expand Down
8 changes: 6 additions & 2 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ use substrate_prometheus_endpoint::Registry;
pub struct DevnetRuntimeExecutor;

impl NativeExecutionDispatch for DevnetRuntimeExecutor {
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
type ExtendHostFunctions = (
cumulus_client_service::storage_proof_size::HostFunctions,
frame_benchmarking::benchmarking::HostFunctions,
);

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
pop_runtime_devnet::api::dispatch(method, data)
Expand Down Expand Up @@ -131,10 +134,11 @@ where
let executor = NativeElseWasmExecutor::<Executor>::new_with_wasm_executor(wasm);

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
true,
)?;
let client = Arc::new(client);

Expand Down
2 changes: 2 additions & 0 deletions runtime/devnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ cumulus-pallet-xcmp-queue.workspace = true
cumulus-primitives-aura.workspace = true
cumulus-primitives-core.workspace = true
cumulus-primitives-utility.workspace = true
cumulus-primitives-storage-weight-reclaim.workspace = true
pallet-collator-selection.workspace = true
parachains-common.workspace = true
parachain-info.workspace = true
Expand All @@ -103,6 +104,7 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking/std",
"frame-executive/std",
Expand Down
4 changes: 3 additions & 1 deletion runtime/devnet/src/config/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use frame_support::{
parameter_types,
traits::{ConstBool, ConstU32, Randomness},
};
use frame_system::pallet_prelude::BlockNumberFor;
use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned};

pub enum AllowBalancesCall {}

Expand Down Expand Up @@ -79,6 +79,8 @@ impl pallet_contracts::Config for Runtime {
type MaxStorageKeyLen = ConstU32<128>;
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
type UnsafeUnstableInterface = ConstBool<true>;
type UploadOrigin = EnsureSigned<Self::AccountId>;
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type MaxDelegateDependencies = ConstU32<32>;
type RuntimeHoldReason = RuntimeHoldReason;
Expand Down
7 changes: 4 additions & 3 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub use pop_runtime_common::{
BLOCK_PROCESSING_VELOCITY, EXISTENTIAL_DEPOSIT, MICROUNIT, MILLIUNIT, NORMAL_DISPATCH_RATIO,
RELAY_CHAIN_SLOT_DURATION_MILLIS, UNIT,
};
pub use sp_runtime::{MultiAddress, Perbill, Permill};
pub use sp_runtime::{ExtrinsicInclusionMode, MultiAddress, Perbill, Permill};

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand Down Expand Up @@ -101,6 +101,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -260,7 +261,7 @@ impl Contains<RuntimeCall> for AllowedApiCalls {
/// The default types are being injected by [`derive_impl`](`frame_support::derive_impl`) from
/// [`ParaChainDefaultConfig`](`struct@frame_system::config_preludes::ParaChainDefaultConfig`),
/// but overridden as needed.
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)]
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
Expand Down Expand Up @@ -641,7 +642,7 @@ impl_runtime_apis! {
Executive::execute_block(block)
}

fn initialize_block(header: &<Block as BlockT>::Header) {
fn initialize_block(header: &<Block as BlockT>::Header) -> ExtrinsicInclusionMode {
Executive::initialize_block(header)
}
}
Expand Down
4 changes: 3 additions & 1 deletion runtime/testnet/src/config/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use frame_support::{
parameter_types,
traits::{ConstBool, ConstU32, Randomness},
};
use frame_system::pallet_prelude::BlockNumberFor;
use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned};

pub enum AllowBalancesCall {}

Expand Down Expand Up @@ -79,6 +79,8 @@ impl pallet_contracts::Config for Runtime {
type MaxStorageKeyLen = ConstU32<128>;
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
type UnsafeUnstableInterface = ConstBool<true>;
type UploadOrigin = EnsureSigned<Self::AccountId>;
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type MaxDelegateDependencies = ConstU32<32>;
type RuntimeHoldReason = RuntimeHoldReason;
Expand Down
7 changes: 4 additions & 3 deletions runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
MILLISECS_PER_BLOCK, MILLIUNIT, MINUTES, NORMAL_DISPATCH_RATIO,
RELAY_CHAIN_SLOT_DURATION_MILLIS, SLOT_DURATION, UNINCLUDED_SEGMENT_CAPACITY, UNIT,
};
pub use sp_runtime::{MultiAddress, Perbill, Permill};
pub use sp_runtime::{ExtrinsicInclusionMode, MultiAddress, Perbill, Permill};

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand Down Expand Up @@ -101,6 +101,7 @@
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,

Check failure on line 104 in runtime/testnet/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

failed to resolve: use of undeclared crate or module `cumulus_primitives_storage_weight_reclaim`

error[E0433]: failed to resolve: use of undeclared crate or module `cumulus_primitives_storage_weight_reclaim` --> runtime/testnet/src/lib.rs:104:2 | 104 | cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `cumulus_primitives_storage_weight_reclaim`
chungquantin marked this conversation as resolved.
Show resolved Hide resolved
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -264,7 +265,7 @@
/// The default types are being injected by [`derive_impl`](`frame_support::derive_impl`) from
/// [`ParaChainDefaultConfig`](`struct@frame_system::config_preludes::ParaChainDefaultConfig`),
/// but overridden as needed.
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)]
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
Expand Down Expand Up @@ -612,350 +613,350 @@
);
}

impl_runtime_apis! {

impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> sp_consensus_aura::SlotDuration {
sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION)
}

fn authorities() -> Vec<AuraId> {
Aura::authorities().into_inner()
}
}

impl sp_api::Core<Block> for Runtime {
fn version() -> RuntimeVersion {
VERSION
}

fn execute_block(block: Block) {
Executive::execute_block(block)
}

fn initialize_block(header: &<Block as BlockT>::Header) {
fn initialize_block(header: &<Block as BlockT>::Header) -> ExtrinsicInclusionMode{
Executive::initialize_block(header)
}
}

impl sp_api::Metadata<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
OpaqueMetadata::new(Runtime::metadata().into())
}

fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> {
Runtime::metadata_at_version(version)
}

fn metadata_versions() -> sp_std::vec::Vec<u32> {
Runtime::metadata_versions()
}
}

impl sp_block_builder::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
Executive::apply_extrinsic(extrinsic)
}

fn finalize_block() -> <Block as BlockT>::Header {
Executive::finalize_block()
}

fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
data.create_extrinsics()
}

fn check_inherents(
block: Block,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
}
}

impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
fn validate_transaction(
source: TransactionSource,
tx: <Block as BlockT>::Extrinsic,
block_hash: <Block as BlockT>::Hash,
) -> TransactionValidity {
Executive::validate_transaction(source, tx, block_hash)
}
}

impl sp_offchain::OffchainWorkerApi<Block> for Runtime {
fn offchain_worker(header: &<Block as BlockT>::Header) {
Executive::offchain_worker(header)
}
}

impl sp_session::SessionKeys<Block> for Runtime {
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
SessionKeys::generate(seed)
}

fn decode_session_keys(
encoded: Vec<u8>,
) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {
SessionKeys::decode_into_raw_public_keys(&encoded)
}
}

impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
fn account_nonce(account: AccountId) -> Nonce {
System::account_nonce(account)
}
}

impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {
fn query_info(
uxt: <Block as BlockT>::Extrinsic,
len: u32,
) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {
TransactionPayment::query_info(uxt, len)
}
fn query_fee_details(
uxt: <Block as BlockT>::Extrinsic,
len: u32,
) -> pallet_transaction_payment::FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len)
}
fn query_weight_to_fee(weight: Weight) -> Balance {
TransactionPayment::weight_to_fee(weight)
}
fn query_length_to_fee(length: u32) -> Balance {
TransactionPayment::length_to_fee(length)
}
}

impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
for Runtime
{
fn query_call_info(
call: RuntimeCall,
len: u32,
) -> pallet_transaction_payment::RuntimeDispatchInfo<Balance> {
TransactionPayment::query_call_info(call, len)
}
fn query_call_fee_details(
call: RuntimeCall,
len: u32,
) -> pallet_transaction_payment::FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len)
}
fn query_weight_to_fee(weight: Weight) -> Balance {
TransactionPayment::weight_to_fee(weight)
}
fn query_length_to_fee(length: u32) -> Balance {
TransactionPayment::length_to_fee(length)
}
}

impl pallet_contracts::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash, EventRecord>
for Runtime
{
fn call(
origin: AccountId,
dest: AccountId,
value: Balance,
gas_limit: Option<Weight>,
storage_deposit_limit: Option<Balance>,
input_data: Vec<u8>,
) -> pallet_contracts::ContractExecResult<Balance, EventRecord> {
let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block);
Contracts::bare_call(
origin,
dest,
value,
gas_limit,
storage_deposit_limit,
input_data,
CONTRACTS_DEBUG_OUTPUT,
CONTRACTS_EVENTS,
pallet_contracts::Determinism::Enforced,
)
}

fn instantiate(
origin: AccountId,
value: Balance,
gas_limit: Option<Weight>,
storage_deposit_limit: Option<Balance>,
code: pallet_contracts::Code<Hash>,
data: Vec<u8>,
salt: Vec<u8>,
) -> pallet_contracts::ContractInstantiateResult<AccountId, Balance, EventRecord>
{
let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block);
Contracts::bare_instantiate(
origin,
value,
gas_limit,
storage_deposit_limit,
code,
data,
salt,
CONTRACTS_DEBUG_OUTPUT,
CONTRACTS_EVENTS,
)
}

fn upload_code(
origin: AccountId,
code: Vec<u8>,
storage_deposit_limit: Option<Balance>,
determinism: pallet_contracts::Determinism,
) -> pallet_contracts::CodeUploadResult<Hash, Balance>
{
Contracts::bare_upload_code(origin, code, storage_deposit_limit, determinism)
}

fn get_storage(
address: AccountId,
key: Vec<u8>,
) -> pallet_contracts::GetStorageResult {
Contracts::get_storage(address, key)
}
}

impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {
fn can_build_upon(
included_hash: <Block as BlockT>::Hash,
slot: cumulus_primitives_aura::Slot,
) -> bool {
ConsensusHook::can_build_upon(included_hash, slot)
}
}

impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {
fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {
ParachainSystem::collect_collation_info(header)
}
}

impl pallet_nfts_runtime_api::NftsApi<Block, AccountId, u32, u32> for Runtime {
fn owner(collection: u32, item: u32) -> Option<AccountId> {
<Nfts as Inspect<AccountId>>::owner(&collection, &item)
}

fn collection_owner(collection: u32) -> Option<AccountId> {
<Nfts as Inspect<AccountId>>::collection_owner(&collection)
}

fn attribute(
collection: u32,
item: u32,
key: Vec<u8>,
) -> Option<Vec<u8>> {
<Nfts as Inspect<AccountId>>::attribute(&collection, &item, &key)
}

fn custom_attribute(
account: AccountId,
collection: u32,
item: u32,
key: Vec<u8>,
) -> Option<Vec<u8>> {
<Nfts as Inspect<AccountId>>::custom_attribute(
&account,
&collection,
&item,
&key,
)
}

fn system_attribute(
collection: u32,
item: Option<u32>,
key: Vec<u8>,
) -> Option<Vec<u8>> {
<Nfts as Inspect<AccountId>>::system_attribute(&collection, item.as_ref(), &key)
}

fn collection_attribute(collection: u32, key: Vec<u8>) -> Option<Vec<u8>> {
<Nfts as Inspect<AccountId>>::collection_attribute(&collection, &key)
}
}

#[cfg(feature = "try-runtime")]
impl frame_try_runtime::TryRuntime<Block> for Runtime {
fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) {
let weight = Executive::try_runtime_upgrade(checks).unwrap();
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block(
block: Block,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
) -> Weight {
// NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to
// have a backtrace here.
Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap()
}
}

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;

let mut list = Vec::<BenchmarkList>::new();
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
}

fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{BenchmarkError, Benchmarking, BenchmarkBatch};

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}

fn verify_set_code() {
System::assert_last_event(cumulus_pallet_parachain_system::Event::<Runtime>::ValidationFunctionStored.into());
}
}

use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
impl cumulus_pallet_session_benchmarking::Config for Runtime {}

use frame_support::traits::WhitelistedStorageKeys;
let whitelist = AllPalletsWithSystem::whitelisted_storage_keys();

let mut batches = Vec::<BenchmarkBatch>::new();
let params = (&config, &whitelist);
add_benchmarks!(params, batches);

if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok(batches)
}
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
}
}
}

Check failure on line 959 in runtime/testnet/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

type annotations needed: cannot satisfy `pallet_contracts::ContractResult<std::result::Result<pallet_contracts::ExecReturnValue, sp_runtime::DispatchError>, u128, frame_system::EventRecord<RuntimeEvent, sp_core::H256>>: std::panic::UnwindSafe`

error[E0283]: type annotations needed: cannot satisfy `pallet_contracts::ContractResult<std::result::Result<pallet_contracts::ExecReturnValue, sp_runtime::DispatchError>, u128, frame_system::EventRecord<RuntimeEvent, sp_core::H256>>: std::panic::UnwindSafe` --> runtime/testnet/src/lib.rs:616:1 | 616 | / impl_runtime_apis! { 617 | | 618 | | impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime { 619 | | fn slot_duration() -> sp_consensus_aura::SlotDuration { ... | 958 | | } 959 | | } | |_^ | = note: cannot satisfy `pallet_contracts::ContractResult<std::result::Result<pallet_contracts::ExecReturnValue, sp_runtime::DispatchError>, u128, frame_system::EventRecord<RuntimeEvent, sp_core::H256>>: std::panic::UnwindSafe` = note: this error originates in the macro `impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info)

Check failure on line 959 in runtime/testnet/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

type annotations needed: cannot satisfy `RuntimeCall: std::panic::UnwindSafe`

error[E0283]: type annotations needed: cannot satisfy `RuntimeCall: std::panic::UnwindSafe` --> runtime/testnet/src/lib.rs:616:1 | 616 | / impl_runtime_apis! { 617 | | 618 | | impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime { 619 | | fn slot_duration() -> sp_consensus_aura::SlotDuration { ... | 958 | | } 959 | | } | |_^ | = note: cannot satisfy `RuntimeCall: std::panic::UnwindSafe` = note: this error originates in the macro `impl_runtime_apis` (in Nightly builds, run with -Z macro-backtrace for more info)

cumulus_pallet_parachain_system::register_validate_block! {
Runtime = Runtime,
Expand Down
Loading