From d52b4ad7685db492df3df487ad50ea3c89cf60fb Mon Sep 17 00:00:00 2001 From: Nikhil Gupta Date: Wed, 5 Apr 2023 18:36:32 +0530 Subject: [PATCH] tests::it_works_for_default_value --- .../pallets/template/src/benchmarking.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/node-template/pallets/template/src/benchmarking.rs b/bin/node-template/pallets/template/src/benchmarking.rs index 1790849970440..5687584b83462 100644 --- a/bin/node-template/pallets/template/src/benchmarking.rs +++ b/bin/node-template/pallets/template/src/benchmarking.rs @@ -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::::get(), Some(s)); }