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

Commit 6c7e941

Browse files
authored
EPM and staking events improvement (#13035)
* EPM and staking events improvement * Uses RawOrigin in ElectionCompute event * Refactors new phase events to PhaseTransition event * PhaseTransitioned and remove RawOrigin from event * Adds helpers for epm phase transition and staking force new * addresses review comments * nit: removes unecessary clone * fixes benchmarks Co-authored-by: parity-processbot <>
1 parent f31588b commit 6c7e941

File tree

7 files changed

+369
-124
lines changed

7 files changed

+369
-124
lines changed

frame/election-provider-multi-phase/src/benchmarking.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ frame_benchmarking::benchmarks! {
200200
assert!(<MultiPhase<T>>::snapshot().is_none());
201201
assert!(<MultiPhase<T>>::current_phase().is_off());
202202
}: {
203-
<MultiPhase<T>>::on_initialize_open_signed();
203+
<MultiPhase<T>>::phase_transition(Phase::Signed);
204204
} verify {
205205
assert!(<MultiPhase<T>>::snapshot().is_none());
206206
assert!(<MultiPhase<T>>::current_phase().is_signed());
@@ -210,7 +210,8 @@ frame_benchmarking::benchmarks! {
210210
assert!(<MultiPhase<T>>::snapshot().is_none());
211211
assert!(<MultiPhase<T>>::current_phase().is_off());
212212
}: {
213-
<MultiPhase<T>>::on_initialize_open_unsigned(true, 1u32.into())
213+
let now = frame_system::Pallet::<T>::block_number();
214+
<MultiPhase<T>>::phase_transition(Phase::Unsigned((true, now)));
214215
} verify {
215216
assert!(<MultiPhase<T>>::snapshot().is_none());
216217
assert!(<MultiPhase<T>>::current_phase().is_unsigned());
@@ -318,7 +319,7 @@ frame_benchmarking::benchmarks! {
318319
submit {
319320
// the queue is full and the solution is only better than the worse.
320321
<MultiPhase<T>>::create_snapshot().map_err(<&str>::from)?;
321-
MultiPhase::<T>::on_initialize_open_signed();
322+
<MultiPhase<T>>::phase_transition(Phase::Signed);
322323
<Round<T>>::put(1);
323324

324325
let mut signed_submissions = SignedSubmissions::<T>::get();

0 commit comments

Comments
 (0)