mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 20:11:03 +00:00
Fix runtime benchmarks CI (#6545)
* debug (ci): ci config [skip ci] * debug (ci): fix runtime benchmarks * fix identity benchmarks * fix utility benchmarks * Revert "debug (ci): ci config [skip ci]" This reverts commit 081b175b5e95604520c79ea4e5822b84ea35ddaa. * change (ci): touch ci config to run CI Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Gav Wood <gavin@parity.io>
This commit is contained in:
@@ -20,11 +20,19 @@
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use super::*;
|
||||
use frame_system::RawOrigin;
|
||||
use frame_system::{RawOrigin, EventRecord};
|
||||
use frame_benchmarking::{benchmarks, account};
|
||||
|
||||
const SEED: u32 = 0;
|
||||
|
||||
fn assert_last_event<T: Trait>(generic_event: <T as Trait>::Event) {
|
||||
let events = frame_system::Module::<T>::events();
|
||||
let system_event: <T as frame_system::Trait>::Event = generic_event.into();
|
||||
// compare to the last event record
|
||||
let EventRecord { event, .. } = &events[events.len() - 1];
|
||||
assert_eq!(event, &system_event);
|
||||
}
|
||||
|
||||
benchmarks! {
|
||||
_ { }
|
||||
|
||||
@@ -37,6 +45,9 @@ benchmarks! {
|
||||
}
|
||||
let caller = account("caller", 0, SEED);
|
||||
}: _(RawOrigin::Signed(caller), calls)
|
||||
verify {
|
||||
assert_last_event::<T>(Event::BatchCompleted.into())
|
||||
}
|
||||
|
||||
as_derivative {
|
||||
let u in 0 .. 1000;
|
||||
|
||||
Reference in New Issue
Block a user