mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 05:21:08 +00:00
Add pallet names to Events (#10296)
* chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * fix: add fix to tests for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: updated transaction-storage pallet event variants * chore: updated transaction-storage pallet event variants * chore: formatted contracts pallet * chore: update treasury event variants
This commit is contained in:
@@ -255,21 +255,20 @@ pub mod pallet {
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config<I>, I: 'static = ()> {
|
||||
/// New proposal. \[proposal_index\]
|
||||
Proposed(ProposalIndex),
|
||||
/// We have ended a spend period and will now allocate funds. \[budget_remaining\]
|
||||
Spending(BalanceOf<T, I>),
|
||||
/// Some funds have been allocated. \[proposal_index, award, beneficiary\]
|
||||
Awarded(ProposalIndex, BalanceOf<T, I>, T::AccountId),
|
||||
/// A proposal was rejected; funds were slashed. \[proposal_index, slashed\]
|
||||
Rejected(ProposalIndex, BalanceOf<T, I>),
|
||||
/// Some of our funds have been burnt. \[burn\]
|
||||
Burnt(BalanceOf<T, I>),
|
||||
/// New proposal.
|
||||
Proposed { proposal_index: ProposalIndex },
|
||||
/// We have ended a spend period and will now allocate funds.
|
||||
Spending { budget_remaining: BalanceOf<T, I> },
|
||||
/// Some funds have been allocated.
|
||||
Awarded { proposal_index: ProposalIndex, award: BalanceOf<T, I>, account: T::AccountId },
|
||||
/// A proposal was rejected; funds were slashed.
|
||||
Rejected { proposal_index: ProposalIndex, slashed: BalanceOf<T, I> },
|
||||
/// Some of our funds have been burnt.
|
||||
Burnt { burnt_funds: BalanceOf<T, I> },
|
||||
/// Spending has finished; this is the amount that rolls over until next spend.
|
||||
/// \[budget_remaining\]
|
||||
Rollover(BalanceOf<T, I>),
|
||||
/// Some funds have been deposited. \[deposit\]
|
||||
Deposit(BalanceOf<T, I>),
|
||||
Rollover { rollover_balance: BalanceOf<T, I> },
|
||||
/// Some funds have been deposited.
|
||||
Deposit { value: BalanceOf<T, I> },
|
||||
}
|
||||
|
||||
/// Old name generated by `decl_event`.
|
||||
@@ -334,7 +333,7 @@ pub mod pallet {
|
||||
<ProposalCount<T, I>>::put(c + 1);
|
||||
<Proposals<T, I>>::insert(c, Proposal { proposer, value, beneficiary, bond });
|
||||
|
||||
Self::deposit_event(Event::Proposed(c));
|
||||
Self::deposit_event(Event::Proposed { proposal_index: c });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -360,7 +359,10 @@ pub mod pallet {
|
||||
let imbalance = T::Currency::slash_reserved(&proposal.proposer, value).0;
|
||||
T::OnSlash::on_unbalanced(imbalance);
|
||||
|
||||
Self::deposit_event(Event::<T, I>::Rejected(proposal_id, value));
|
||||
Self::deposit_event(Event::<T, I>::Rejected {
|
||||
proposal_index: proposal_id,
|
||||
slashed: value,
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -410,7 +412,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
let mut total_weight: Weight = Zero::zero();
|
||||
|
||||
let mut budget_remaining = Self::pot();
|
||||
Self::deposit_event(Event::Spending(budget_remaining));
|
||||
Self::deposit_event(Event::Spending { budget_remaining });
|
||||
let account_id = Self::account_id();
|
||||
|
||||
let mut missed_any = false;
|
||||
@@ -431,7 +433,11 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
// provide the allocation.
|
||||
imbalance.subsume(T::Currency::deposit_creating(&p.beneficiary, p.value));
|
||||
|
||||
Self::deposit_event(Event::Awarded(index, p.value, p.beneficiary));
|
||||
Self::deposit_event(Event::Awarded {
|
||||
proposal_index: index,
|
||||
award: p.value,
|
||||
account: p.beneficiary,
|
||||
});
|
||||
false
|
||||
} else {
|
||||
missed_any = true;
|
||||
@@ -462,7 +468,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
let (debit, credit) = T::Currency::pair(burn);
|
||||
imbalance.subsume(debit);
|
||||
T::BurnDestination::on_unbalanced(credit);
|
||||
Self::deposit_event(Event::Burnt(burn))
|
||||
Self::deposit_event(Event::Burnt { burnt_funds: burn })
|
||||
}
|
||||
|
||||
// Must never be an error, but better to be safe.
|
||||
@@ -477,7 +483,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
drop(problem);
|
||||
}
|
||||
|
||||
Self::deposit_event(Event::Rollover(budget_remaining));
|
||||
Self::deposit_event(Event::Rollover { rollover_balance: budget_remaining });
|
||||
|
||||
total_weight
|
||||
}
|
||||
@@ -498,6 +504,6 @@ impl<T: Config<I>, I: 'static> OnUnbalanced<NegativeImbalanceOf<T, I>> for Palle
|
||||
// Must resolve into existing but better to be safe.
|
||||
let _ = T::Currency::resolve_creating(&Self::account_id(), amount);
|
||||
|
||||
Self::deposit_event(Event::Deposit(numeric_amount));
|
||||
Self::deposit_event(Event::Deposit { value: numeric_amount });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user