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
+3 -3
View File
@@ -168,8 +168,8 @@ pub mod pallet {
#[pallet::event]
#[pallet::generate_deposit(pub(crate) fn deposit_event)]
pub enum Event<T: Config> {
/// Moved an account from one bag to another. \[who, from, to\].
Rebagged(T::AccountId, VoteWeight, VoteWeight),
/// Moved an account from one bag to another.
Rebagged { who: T::AccountId, from: VoteWeight, to: VoteWeight },
}
#[pallet::call]
@@ -216,7 +216,7 @@ impl<T: Config> Pallet<T> {
let maybe_movement = list::Node::<T>::get(&account)
.and_then(|node| List::update_position_for(node, new_weight));
if let Some((from, to)) = maybe_movement {
Self::deposit_event(Event::<T>::Rebagged(account.clone(), from, to));
Self::deposit_event(Event::<T>::Rebagged { who: account.clone(), from, to });
};
maybe_movement
}