Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

EPM and staking events improvement #13035

Merged
merged 9 commits into from
Jan 9, 2023
7 changes: 4 additions & 3 deletions frame/election-provider-multi-phase/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ frame_benchmarking::benchmarks! {
assert!(<MultiPhase<T>>::snapshot().is_none());
assert!(<MultiPhase<T>>::current_phase().is_off());
}: {
<MultiPhase<T>>::on_initialize_open_signed();
<MultiPhase<T>>::phase_transition(Phase::Signed);
} verify {
assert!(<MultiPhase<T>>::snapshot().is_none());
assert!(<MultiPhase<T>>::current_phase().is_signed());
Expand All @@ -210,7 +210,8 @@ frame_benchmarking::benchmarks! {
assert!(<MultiPhase<T>>::snapshot().is_none());
assert!(<MultiPhase<T>>::current_phase().is_off());
}: {
<MultiPhase<T>>::on_initialize_open_unsigned(true, 1u32.into())
let now = frame_system::Pallet::<T>::block_number();
<MultiPhase<T>>::phase_transition(Phase::Unsigned((true, now)));
} verify {
assert!(<MultiPhase<T>>::snapshot().is_none());
assert!(<MultiPhase<T>>::current_phase().is_unsigned());
Expand Down Expand Up @@ -318,7 +319,7 @@ frame_benchmarking::benchmarks! {
submit {
// the queue is full and the solution is only better than the worse.
<MultiPhase<T>>::create_snapshot().map_err(<&str>::from)?;
MultiPhase::<T>::on_initialize_open_signed();
<MultiPhase<T>>::phase_transition(Phase::Signed);
<Round<T>>::put(1);

let mut signed_submissions = SignedSubmissions::<T>::get();
Expand Down
Loading