diff --git a/substrate/frame/election-provider-multi-phase/src/lib.rs b/substrate/frame/election-provider-multi-phase/src/lib.rs index 8676be438300..6733bd15b357 100644 --- a/substrate/frame/election-provider-multi-phase/src/lib.rs +++ b/substrate/frame/election-provider-multi-phase/src/lib.rs @@ -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; /// Maximum number of voters that can support a winner in an election solution. diff --git a/substrate/frame/staking/src/pallet/impls.rs b/substrate/frame/staking/src/pallet/impls.rs index 785c688453dd..fb30e3f497d1 100644 --- a/substrate/frame/staking/src/pallet/impls.rs +++ b/substrate/frame/staking/src/pallet/impls.rs @@ -707,18 +707,17 @@ impl Pallet { }, _ => {}, } - // 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.