Skip to content

Commit

Permalink
addresses PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gpestana committed Dec 3, 2024
1 parent 442a64e commit e43e885
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions substrate/frame/election-provider-multi-phase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ pub mod pallet {
/// Maximum number of winners that an election supports.
///
/// Note: This must always be greater or equal to `T::DataProvider::desired_targets()`.
#[pallet::constant]
type MaxWinners: Get<u32>;

/// Maximum number of voters that can support a winner in an election solution.
Expand Down
13 changes: 6 additions & 7 deletions substrate/frame/staking/src/pallet/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,18 +707,17 @@ impl<T: Config> Pallet<T> {
},
_ => {},
}

// election failed, clear election prep metadata.
Self::clear_election_metadata();

Self::deposit_event(Event::StakingElectionFailed);
return None
}

Self::deposit_event(Event::StakersElected);
Self::trigger_new_era(start_session_index);
None
} else {
Self::deposit_event(Event::StakersElected);
Self::trigger_new_era(start_session_index);

Some(validators)
Some(validators)
}
}

/// Paginated elect.
Expand Down

0 comments on commit e43e885

Please sign in to comment.