Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Moves pallet template to benchmarking v2 #13826

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions bin/node-template/pallets/template/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ use super::*;

#[allow(unused)]
use crate::Pallet as Template;
use frame_benchmarking::v1::{benchmarks, whitelisted_caller};
use frame_benchmarking::{impl_benchmark_test_suite, whitelisted_caller, v2::*};
use frame_system::RawOrigin;

benchmarks! {
do_something {
let s in 0 .. 100;
#[benchmarks]
mod benchmarks {
use super::*;

#[benchmark]
fn do_something(s: Linear<0, 100>) {
let caller: T::AccountId = whitelisted_caller();
}: _(RawOrigin::Signed(caller), s)
verify {

#[extrinsic_call]
_(RawOrigin::Signed(caller), s);

assert_eq!(Something::<T>::get(), Some(s));
}

Expand Down