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

Commit

Permalink
Respect feature gated functions
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Sep 8, 2022
1 parent 2e5aafe commit bc1da9d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
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
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

0 comments on commit bc1da9d

Please sign in to comment.