mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 13:21:10 +00:00
Migrate pallet-mmr to the new pallet attribute macro (#9181)
* Migrate pallet-mmr to the new pallet attribute macro Signed-off-by: koushiro <koushiro.cqx@gmail.com> * fix typo Signed-off-by: koushiro <koushiro.cqx@gmail.com> * use instance macro Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -21,24 +21,24 @@
|
||||
|
||||
use crate::*;
|
||||
use frame_support::traits::OnInitialize;
|
||||
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
|
||||
use frame_benchmarking::{benchmarks_instance_pallet, impl_benchmark_test_suite};
|
||||
|
||||
benchmarks! {
|
||||
benchmarks_instance_pallet! {
|
||||
on_initialize {
|
||||
let x in 1 .. 1_000;
|
||||
|
||||
let leaves = x as u64;
|
||||
}: {
|
||||
for b in 0..leaves {
|
||||
Module::<T>::on_initialize((b as u32).into());
|
||||
Pallet::<T, I>::on_initialize((b as u32).into());
|
||||
}
|
||||
} verify {
|
||||
assert_eq!(crate::NumberOfLeaves::<DefaultInstance>::get(), leaves);
|
||||
assert_eq!(crate::NumberOfLeaves::<T, I>::get(), leaves);
|
||||
}
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(
|
||||
Module,
|
||||
Pallet,
|
||||
crate::tests::new_test_ext(),
|
||||
crate::mock::Test,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user