Add ProposalRejected event to Treasury (#4468)

Closes #4467

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Gavin Wood
2019-12-20 21:35:51 +01:00
committed by GitHub
parent 14a08d430c
commit e6b8a69656
+5 -1
View File
@@ -167,11 +167,13 @@ decl_module! {
#[weight = SimpleDispatchInfo::FixedOperational(100_000)]
fn reject_proposal(origin, #[compact] proposal_id: ProposalIndex) {
T::RejectOrigin::ensure_origin(origin)?;
let proposal = <Proposals<T>>::take(proposal_id).ok_or(Error::<T>::InvalidProposalIndex)?;
let proposal = <Proposals<T>>::take(&proposal_id).ok_or(Error::<T>::InvalidProposalIndex)?;
let value = proposal.bond;
let imbalance = T::Currency::slash_reserved(&proposal.proposer, value).0;
T::ProposalRejection::on_unbalanced(imbalance);
Self::deposit_event(Event::<T>::Rejected(proposal_id, value));
}
/// Approve a proposal. At a later time, the proposal will be allocated to the beneficiary
@@ -244,6 +246,8 @@ decl_event!(
Spending(Balance),
/// Some funds have been allocated.
Awarded(ProposalIndex, Balance, AccountId),
/// A proposal was rejected; funds were slashed.
Rejected(ProposalIndex, Balance),
/// Some of our funds have been burnt.
Burnt(Balance),
/// Spending has finished; this is the amount that rolls over until next spend.