diff --git a/frame/democracy/src/lib.rs b/frame/democracy/src/lib.rs index 50b245006fa24..e9e3c3dddd549 100644 --- a/frame/democracy/src/lib.rs +++ b/frame/democracy/src/lib.rs @@ -546,6 +546,10 @@ pub mod pallet { PreimageReaped(T::Hash, T::AccountId, BalanceOf, T::AccountId), /// A proposal \[hash\] has been blacklisted permanently. Blacklisted(T::Hash), + /// An account has voted in a referendum + Voted(T::AccountId, ReferendumIndex, AccountVote>), + /// An account has secconded a proposal + Seconded(T::AccountId, PropIndex), } #[pallet::error] @@ -687,8 +691,9 @@ pub mod pallet { ensure!(seconds <= seconds_upper_bound, Error::::WrongUpperBound); let mut deposit = Self::deposit_of(proposal).ok_or(Error::::ProposalMissing)?; T::Currency::reserve(&who, deposit.1)?; - deposit.0.push(who); + deposit.0.push(who.clone()); >::insert(proposal, deposit); + Self::deposit_event(Event::::Seconded(who, proposal)); Ok(()) } @@ -1383,6 +1388,7 @@ impl Pallet { votes.insert(i, (ref_index, vote)); }, } + Self::deposit_event(Event::::Voted(who.clone(), ref_index, vote)); // Shouldn't be possible to fail, but we handle it gracefully. status.tally.add(vote).ok_or(ArithmeticError::Overflow)?; if let Some(approve) = vote.as_standard() {