Add field names to pallet Event variants (#9993)

* convert pallet-assets events to struct types

* updated events of a couple pallets

* updated pallet event field names

* update pallet event field names

* updated events in test files

* cargo fmt

* minorfixes

* fix assertion error

* minor fix

* formatting fix

* fmt
This commit is contained in:
David Salami
2021-11-16 02:56:00 +01:00
committed by GitHub
parent fb3c7326c2
commit 120894fdb7
48 changed files with 1181 additions and 681 deletions
@@ -429,7 +429,7 @@ impl<T: Config> Pallet<T> {
<QueuedSolution<T>>::put(ready_solution);
// emit reward event
Self::deposit_event(crate::Event::Rewarded(who.clone(), reward));
Self::deposit_event(crate::Event::Rewarded { account: who.clone(), value: reward });
// unreserve deposit.
let _remaining = T::Currency::unreserve(who, deposit);
@@ -446,7 +446,7 @@ impl<T: Config> Pallet<T> {
///
/// Infallible
pub fn finalize_signed_phase_reject_solution(who: &T::AccountId, deposit: BalanceOf<T>) {
Self::deposit_event(crate::Event::Slashed(who.clone(), deposit));
Self::deposit_event(crate::Event::Slashed { account: who.clone(), value: deposit });
let (negative_imbalance, _remaining) = T::Currency::slash_reserved(who, deposit);
debug_assert!(_remaining.is_zero());
T::SlashHandler::on_unbalanced(negative_imbalance);