From c95f86232e9d26e14a314c1f292501ee473db071 Mon Sep 17 00:00:00 2001 From: Leonardo Custodio Date: Tue, 6 Jul 2021 07:04:40 -0300 Subject: [PATCH] Removed score and compute from set_emergency_election_result (#9271) * Removed score and compute from set_emergency_election_result * Supports type incorrectly set to A * Typo --- frame/election-provider-multi-phase/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frame/election-provider-multi-phase/src/lib.rs b/frame/election-provider-multi-phase/src/lib.rs index 6c92f2b157180..cea42fc08b460 100644 --- a/frame/election-provider-multi-phase/src/lib.rs +++ b/frame/election-provider-multi-phase/src/lib.rs @@ -401,6 +401,8 @@ pub enum ElectionCompute { Signed, /// Election was computed with an unsigned submission. Unsigned, + /// Election was computed with emergency status. + Emergency, } impl Default for ElectionCompute { @@ -895,13 +897,19 @@ pub mod pallet { #[pallet::weight(T::DbWeight::get().reads_writes(1, 1))] pub fn set_emergency_election_result( origin: OriginFor, - solution: ReadySolution, + supports: Supports, ) -> DispatchResult { T::ForceOrigin::ensure_origin(origin)?; ensure!(Self::current_phase().is_emergency(), >::CallNotAllowed); // Note: we don't `rotate_round` at this point; the next call to // `ElectionProvider::elect` will succeed and take care of that. + + let solution = ReadySolution { + supports, + score: [0, 0, 0], + compute: ElectionCompute::Emergency, + }; >::put(solution); Ok(())