mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Companion for substrate#14435 (BenchmarkHelper for frame-system) (#2766)
* Temporary fix for frame_system::set_code benchmark
* Removed temprary fix
* BenchmarkHelper for frame-system (TODO: add stuff for ParachainSystem OnSetCode)
* BenchmarkHelper for frame-system (TODO: add stuff for ParachainSystem OnSetCode)
* Glutton
* Fix benchmarks for `set_code`
* Changed dummy values to non-zero
* update lockfile for {"polkadot", "substrate"}
---------
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -52,6 +52,7 @@ runtime-benchmarks = [
|
||||
"frame-system-benchmarking/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pallet-glutton/runtime-benchmarks",
|
||||
"cumulus-pallet-parachain-system/runtime-benchmarks",
|
||||
"xcm-builder/runtime-benchmarks",
|
||||
]
|
||||
std = [
|
||||
|
||||
@@ -379,9 +379,18 @@ impl_runtime_apis! {
|
||||
fn dispatch_benchmark(
|
||||
config: frame_benchmarking::BenchmarkConfig
|
||||
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
|
||||
use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey};
|
||||
use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError, TrackedStorageKey};
|
||||
use frame_system_benchmarking::Pallet as SystemBench;
|
||||
impl frame_system_benchmarking::Config for Runtime {}
|
||||
impl frame_system_benchmarking::Config for Runtime {
|
||||
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
|
||||
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_set_code() {
|
||||
System::assert_last_event(cumulus_pallet_parachain_system::Event::<Runtime>::ValidationFunctionStored.into());
|
||||
}
|
||||
}
|
||||
|
||||
use frame_support::traits::WhitelistedStorageKeys;
|
||||
let whitelist: Vec<TrackedStorageKey> = AllPalletsWithSystem::whitelisted_storage_keys();
|
||||
|
||||
Reference in New Issue
Block a user