mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +00:00
Use define_benchmarks! (#4760)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
8756678a83
commit
cc1201ef27
@@ -1095,6 +1095,20 @@ impl pallet_multisig::Config for Runtime {
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
#[macro_use]
|
||||
extern crate frame_benchmarking;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
mod benches {
|
||||
define_benchmarks!(
|
||||
[runtime_parachains::configuration, Configuration]
|
||||
[runtime_parachains::disputes, ParasDisputes]
|
||||
[runtime_parachains::paras_inherent, ParaInherent]
|
||||
[runtime_parachains::paras, Paras]
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "disable-runtime-api"))]
|
||||
sp_api::impl_runtime_apis! {
|
||||
impl sp_api::Core<Block> for Runtime {
|
||||
@@ -1552,18 +1566,13 @@ sp_api::impl_runtime_apis! {
|
||||
Vec<frame_benchmarking::BenchmarkList>,
|
||||
Vec<frame_support::traits::StorageInfo>,
|
||||
) {
|
||||
use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};
|
||||
use frame_benchmarking::{Benchmarking, BenchmarkList};
|
||||
use frame_support::traits::StorageInfoTrait;
|
||||
|
||||
let mut list = Vec::<BenchmarkList>::new();
|
||||
|
||||
list_benchmark!(list, extra, runtime_parachains::configuration, Configuration);
|
||||
list_benchmark!(list, extra, runtime_parachains::disputes, ParasDisputes);
|
||||
list_benchmark!(list, extra, runtime_parachains::paras_inherent, ParaInherent);
|
||||
list_benchmark!(list, extra, runtime_parachains::paras, Paras);
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
|
||||
return (list, storage_info)
|
||||
}
|
||||
|
||||
@@ -1573,7 +1582,7 @@ sp_api::impl_runtime_apis! {
|
||||
Vec<frame_benchmarking::BenchmarkBatch>,
|
||||
sp_runtime::RuntimeString,
|
||||
> {
|
||||
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
|
||||
use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey};
|
||||
|
||||
let mut batches = Vec::<BenchmarkBatch>::new();
|
||||
let whitelist: Vec<TrackedStorageKey> = vec![
|
||||
@@ -1589,11 +1598,7 @@ sp_api::impl_runtime_apis! {
|
||||
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
|
||||
];
|
||||
let params = (&config, &whitelist);
|
||||
|
||||
add_benchmark!(params, batches, runtime_parachains::configuration, Configuration);
|
||||
add_benchmark!(params, batches, runtime_parachains::disputes, ParasDisputes);
|
||||
add_benchmark!(params, batches, runtime_parachains::paras_inherent, ParaInherent);
|
||||
add_benchmark!(params, batches, runtime_parachains::paras, Paras);
|
||||
add_benchmarks!(params, batches);
|
||||
|
||||
Ok(batches)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user