mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 23:41:02 +00:00
Implement batch_all and update Utility pallet for weight refunds (#7188)
* implement batch_all * bump version * updates * Better weight story for utility * small fixes * weights * assert_noop_ignore_postinfo doesnt make sense * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -56,6 +56,19 @@ benchmarks! {
|
||||
let caller_key = frame_system::Account::<T>::hashed_key_for(&caller);
|
||||
frame_benchmarking::benchmarking::add_to_whitelist(caller_key.into());
|
||||
}: _(RawOrigin::Signed(caller), SEED as u16, call)
|
||||
|
||||
batch_all {
|
||||
let c in 0 .. 1000;
|
||||
let mut calls: Vec<<T as Trait>::Call> = Vec::new();
|
||||
for i in 0 .. c {
|
||||
let call = frame_system::Call::remark(vec![]).into();
|
||||
calls.push(call);
|
||||
}
|
||||
let caller = whitelisted_caller();
|
||||
}: _(RawOrigin::Signed(caller), calls)
|
||||
verify {
|
||||
assert_last_event::<T>(Event::BatchCompleted.into())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -69,6 +82,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(test_benchmark_batch::<Test>());
|
||||
assert_ok!(test_benchmark_as_derivative::<Test>());
|
||||
assert_ok!(test_benchmark_batch_all::<Test>());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user