Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Co #11976: Enable rust features #1607

Merged
merged 5 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
546 changes: 288 additions & 258 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions parachain-template/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ pub fn run() -> Result<()> {
)?;
cmd.run(partials.client)
}),
#[cfg(not(feature = "runtime-benchmarks"))]
BenchmarkCmd::Storage(_) =>
return Err(sc_cli::Error::Input(
"Compile with --features=runtime-benchmarks \
to enable storage benchmarks."
.into(),
)
.into()),
#[cfg(feature = "runtime-benchmarks")]
BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| {
let partials = new_partial::<RuntimeApi, TemplateRuntimeExecutor, _>(
&config,
Expand Down
2 changes: 1 addition & 1 deletion parachain-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ runtime-benchmarks = [
"hex-literal",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
Expand Down
4 changes: 2 additions & 2 deletions parachains/runtimes/assets/statemine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ runtime-benchmarks = [
"hex-literal",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
Expand All @@ -102,7 +102,7 @@ runtime-benchmarks = [
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"pallet-xcm-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
Expand Down
4 changes: 2 additions & 2 deletions parachains/runtimes/assets/statemint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ runtime-benchmarks = [
"hex-literal",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
Expand All @@ -101,7 +101,7 @@ runtime-benchmarks = [
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"pallet-xcm-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
Expand Down
4 changes: 2 additions & 2 deletions parachains/runtimes/assets/westmint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ runtime-benchmarks = [
"hex-literal",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
Expand All @@ -101,7 +101,7 @@ runtime-benchmarks = [
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"pallet-xcm-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ runtime-benchmarks = [
"hex-literal",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-alliance/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/contracts/contracts-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ runtime-benchmarks = [
"hex-literal",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/testing/penpal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ runtime-benchmarks = [
"hex-literal",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
Expand Down
9 changes: 9 additions & 0 deletions polkadot-parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,15 @@ pub fn run() -> Result<()> {
BenchmarkCmd::Block(cmd) => runner.sync_run(|config| {
construct_benchmark_partials!(config, |partials| cmd.run(partials.client))
}),
#[cfg(not(feature = "runtime-benchmarks"))]
BenchmarkCmd::Storage(_) =>
return Err(sc_cli::Error::Input(
"Compile with --features=runtime-benchmarks \
to enable storage benchmarks."
.into(),
)
.into()),
#[cfg(feature = "runtime-benchmarks")]
BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| {
construct_benchmark_partials!(config, |partials| {
let db = partials.backend.expose_db();
Expand Down
2 changes: 2 additions & 0 deletions polkadot-parachain/tests/benchmark_storage_works.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "runtime-benchmarks")]

use assert_cmd::cargo::cargo_bin;
use std::{
path::Path,
Expand Down