Add force_batch to utility pallet (#11148)

* Add batch_try to utility pallet

* lint

* rename utility.batch_try -> utility.force_batch

* Remove un-needed index field for utility.ItemFailed event

* Remove indexes of utility,BatchCompletedWithErrors

* Apply suggestions from code review

Co-authored-by: Louis Merlin <hello@louismerl.in>

Co-authored-by: Louis Merlin <hello@louismerl.in>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Jun Jiang
2022-05-05 18:44:13 +08:00
committed by GitHub
parent b24d1a2c23
commit f9e4e87efa
4 changed files with 130 additions and 0 deletions
@@ -73,5 +73,18 @@ benchmarks! {
let pallets_origin = Into::<T::PalletsOrigin>::into(pallets_origin);
}: _(RawOrigin::Root, Box::new(pallets_origin), call)
force_batch {
let c in 0 .. 1000;
let mut calls: Vec<<T as Config>::Call> = Vec::new();
for i in 0 .. c {
let call = frame_system::Call::remark { remark: vec![] }.into();
calls.push(call);
}
let caller = whitelisted_caller();
}: _(RawOrigin::Signed(caller), calls)
verify {
assert_last_event::<T>(Event::BatchCompleted.into())
}
impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test);
}