mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 18:37:59 +00:00
f8ce186496
* Generate one #[test] fn per bench case. * Update benchmark macro syntax in frame pallets. * Explain new benchmark macro syntax in example pallet. * support with and without a semicolon * update pallets to use individual tests * migrate staking too * migrate more pallets * fix up democracy and use individual tests * Fix comment * Put println message in panic * Remove `another_set_dummy` from doc `another_set_dummy` is not present in the benchmarking.rs (anymore). * Update doc for benchmarks macro * Update doc for impl_benchmark_test_suite macro Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
21 lines
482 B
Rust
21 lines
482 B
Rust
//! Benchmarking setup for pallet-template
|
|
|
|
use super::*;
|
|
|
|
#[allow(unused)]
|
|
use crate::Pallet as Template;
|
|
use frame_benchmarking::{benchmarks, whitelisted_caller};
|
|
use frame_system::RawOrigin;
|
|
|
|
benchmarks! {
|
|
do_something {
|
|
let s in 0 .. 100;
|
|
let caller: T::AccountId = whitelisted_caller();
|
|
}: _(RawOrigin::Signed(caller), s)
|
|
verify {
|
|
assert_eq!(Something::<T>::get(), Some(s));
|
|
}
|
|
|
|
impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test);
|
|
}
|