mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 14:57:56 +00:00
Add benchmark to node-template pallet-template (#8239)
* Add benchmark to node-template pallet-template * export sp_std to avoid missing dep when using macro * fix more `sp_std` deps * remove unused * Update bin/node-template/pallets/template/src/benchmarking.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update bin/node-template/pallets/template/Cargo.toml Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
//! Benchmarking setup for pallet-template
|
||||
|
||||
use super::*;
|
||||
|
||||
use frame_system::RawOrigin;
|
||||
use frame_benchmarking::{benchmarks, whitelisted_caller, impl_benchmark_test_suite};
|
||||
#[allow(unused)]
|
||||
use crate::Module as Template;
|
||||
|
||||
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,
|
||||
);
|
||||
Reference in New Issue
Block a user