Skip to content

Commit

Permalink
fix runtime-benchmark feature build
Browse files Browse the repository at this point in the history
  • Loading branch information
salman01zp committed Dec 27, 2023
1 parent 34fc003 commit aaf913b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
7 changes: 6 additions & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ tangle-crypto-primitives = { workspace = true }

[features]
default = ["with-rocksdb-weights", "rocksdb", "sql"]
runtime-benchmarks = ["tangle-testnet-runtime/runtime-benchmarks"]
runtime-benchmarks = [
"tangle-testnet-runtime/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"sc-service/runtime-benchmarks",
]
with-rocksdb-weights = ["tangle-testnet-runtime/with-rocksdb-weights"]
with-paritydb-weights = ["tangle-testnet-runtime/with-paritydb-weights"]
rocksdb = [
Expand Down
2 changes: 2 additions & 0 deletions runtime/mainnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ runtime-benchmarks = [
"frame-system-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
Expand Down Expand Up @@ -168,6 +169,7 @@ std = [
"frame-executive/std",
"frame-system/std",
"frame-system-rpc-runtime-api/std",
"frame-system-benchmarking?/std",
"frame-election-provider-support/std",
"pallet-authorship/std",
"pallet-babe/std",
Expand Down
7 changes: 3 additions & 4 deletions runtime/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1758,11 +1758,10 @@ impl_runtime_apis! {
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList};
use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;

use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;

let mut list = Vec::<BenchmarkList>::new();

Expand All @@ -1778,8 +1777,8 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};

use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark };
use frame_support::traits::TrackedStorageKey;
use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {}

Expand Down
2 changes: 2 additions & 0 deletions runtime/testnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ runtime-benchmarks = [
"frame-system-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
Expand Down Expand Up @@ -171,6 +172,7 @@ std = [
"frame-executive/std",
"frame-system/std",
"frame-system-rpc-runtime-api/std",
"frame-system-benchmarking?/std",
"frame-election-provider-support/std",
"pallet-authorship/std",
"pallet-babe/std",
Expand Down
7 changes: 3 additions & 4 deletions runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1876,11 +1876,10 @@ impl_runtime_apis! {
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList};
use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;

use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;

let mut list = Vec::<BenchmarkList>::new();

Expand All @@ -1896,8 +1895,8 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};

use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark};
use frame_support::traits::TrackedStorageKey;
use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {}

Expand Down

0 comments on commit aaf913b

Please sign in to comment.