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

Companion for Substrate #6929 (Execute verify logic when running benchmarks) #1623

Merged
merged 4 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 2 additions & 17 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,13 +1196,7 @@ sp_api::impl_runtime_apis! {
#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
pallet: Vec<u8>,
benchmark: Vec<u8>,
lowest_range_values: Vec<u32>,
highest_range_values: Vec<u32>,
steps: Vec<u32>,
repeat: u32,
extra: bool,
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues.
Expand Down Expand Up @@ -1232,16 +1226,7 @@ sp_api::impl_runtime_apis! {
];

let mut batches = Vec::<BenchmarkBatch>::new();
let params = (
&pallet,
&benchmark,
&lowest_range_values,
&highest_range_values,
&steps,
repeat,
&whitelist,
extra,
);
let params = (&config, &whitelist);
// Polkadot
add_benchmark!(params, batches, claims, Claims);
// Substrate
Expand Down
19 changes: 2 additions & 17 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,13 +1337,7 @@ sp_api::impl_runtime_apis! {
#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
pallet: Vec<u8>,
benchmark: Vec<u8>,
lowest_range_values: Vec<u32>,
highest_range_values: Vec<u32>,
steps: Vec<u32>,
repeat: u32,
extra: bool,
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues.
Expand Down Expand Up @@ -1373,16 +1367,7 @@ sp_api::impl_runtime_apis! {
];

let mut batches = Vec::<BenchmarkBatch>::new();
let params = (
&pallet,
&benchmark,
&lowest_range_values,
&highest_range_values,
&steps,
repeat,
&whitelist,
extra,
);
let params = (&config, &whitelist);
// Polkadot
add_benchmark!(params, batches, claims, Claims);
// Substrate
Expand Down
19 changes: 2 additions & 17 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -993,13 +993,7 @@ sp_api::impl_runtime_apis! {
#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
pallet: Vec<u8>,
benchmark: Vec<u8>,
lowest_range_values: Vec<u32>,
highest_range_values: Vec<u32>,
steps: Vec<u32>,
repeat: u32,
extra: bool,
config: frame_benchmarking::BenchmarkConfig,
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues.
Expand Down Expand Up @@ -1029,16 +1023,7 @@ sp_api::impl_runtime_apis! {
];

let mut batches = Vec::<BenchmarkBatch>::new();
let params = (
&pallet,
&benchmark,
&lowest_range_values,
&highest_range_values,
&steps,
repeat,
&whitelist,
extra,
);
let params = (&config, &whitelist);

add_benchmark!(params, batches, pallet_balances, Balances);
add_benchmark!(params, batches, pallet_identity, Identity);
Expand Down