Skip to content
Snippets Groups Projects
Commit 279ff4b6 authored by Leonardo Custodio's avatar Leonardo Custodio Committed by GitHub
Browse files

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
parent e755577c
No related merge requests found
......@@ -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<T>,
solution: ReadySolution<T::AccountId>,
supports: Supports<T::AccountId>,
) -> DispatchResult {
T::ForceOrigin::ensure_origin(origin)?;
ensure!(Self::current_phase().is_emergency(), <Error<T>>::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,
};
<QueuedSolution<T>>::put(solution);
Ok(())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment