Companion for #9090 (include storage info) (#3424)

* update benchmark

* add host function

* update Substrate

* fix unused

Co-authored-by: parity-processbot <>
This commit is contained in:
Shawn Tabrizi
2021-07-07 19:01:00 -04:00
committed by GitHub
parent 2bb31db98c
commit 0e7217b4da
6 changed files with 186 additions and 168 deletions
+7 -4
View File
@@ -73,8 +73,6 @@ use sp_runtime::{
Extrinsic as ExtrinsicT, SaturatedConversion, Verify,
},
};
#[cfg(feature = "runtime-benchmarks")]
use sp_runtime::RuntimeString;
use sp_version::RuntimeVersion;
use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives};
#[cfg(any(feature = "std", test))]
@@ -1433,8 +1431,12 @@ sp_api::impl_runtime_apis! {
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig,
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, RuntimeString> {
) -> Result<
(Vec<frame_benchmarking::BenchmarkBatch>, Vec<frame_support::traits::StorageInfo>),
sp_runtime::RuntimeString,
> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
use frame_support::traits::StorageInfoTrait;
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues.
// To get around that, we separated the Session benchmarks into its own crate, which is why
// we need these two lines below.
@@ -1489,7 +1491,8 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, pallet_vesting, Vesting);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok(batches)
let storage_info = AllPalletsWithSystem::storage_info();
Ok((batches, storage_info))
}
}
}