diff --git a/frame/elections-phragmen/src/lib.rs b/frame/elections-phragmen/src/lib.rs index cf3864f2e3f92..be47b5adcce5e 100644 --- a/frame/elections-phragmen/src/lib.rs +++ b/frame/elections-phragmen/src/lib.rs @@ -682,6 +682,10 @@ decl_event!( /// A \[member\] has been removed. This should always be followed by either `NewTerm` or /// `EmptyTerm`. MemberKicked(AccountId), + /// A candidate was slashed due to failing to obtain a seat as member or runner-up + CandidateSlashed(AccountId, Balance), + /// A seat holder (member or runner-up) was slashed due to failing to retaining their position. + SeatHolderSlashed(AccountId, Balance), /// A \[member\] has renounced their candidacy. MemberRenounced(AccountId), /// A voter was reported with the the report being successful or not. @@ -995,6 +999,7 @@ impl Module { new_runners_up_ids_sorted.binary_search(&c).is_err() { let (imbalance, _) = T::Currency::slash_reserved(&c, T::CandidacyBond::get()); + Self::deposit_event(RawEvent::CandidateSlashed(c, T::CandidacyBond::get())); T::LoserCandidate::on_unbalanced(imbalance); } }); @@ -1002,6 +1007,7 @@ impl Module { // Burn outgoing bonds to_burn_bond.into_iter().for_each(|x| { let (imbalance, _) = T::Currency::slash_reserved(&x, T::CandidacyBond::get()); + Self::deposit_event(RawEvent::SeatHolderSlashed(x, T::CandidacyBond::get())); T::LoserCandidate::on_unbalanced(imbalance); });