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

Commit

Permalink
Removed score and compute from set_emergency_election_result (#9271)
Browse files Browse the repository at this point in the history
* Removed score and compute from set_emergency_election_result

* Supports type incorrectly set to A

* Typo
  • Loading branch information
Leonardo Custodio authored Jul 6, 2021
1 parent 5af7052 commit c95f862
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frame/election-provider-multi-phase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(())
Expand Down

0 comments on commit c95f862

Please sign in to comment.