Add field names to pallet Event variants (#10184)

* Changed named fields to struct variants

* Fixed errors.

* Made adjustments as per `cargo +nightly fmt`.

* Update frame/uniques/src/lib.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Removed redundant comments for structs.

* Moved frame-support to dev dependencies

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
Ayevbeosa Iyamu
2021-11-15 20:16:03 +01:00
committed by GitHub
parent 9ee0b1cb6c
commit 8a5bb77e03
9 changed files with 185 additions and 126 deletions
+9 -4
View File
@@ -44,7 +44,12 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
details.owner = dest;
Asset::<T, I>::insert(&class, &instance, &details);
Self::deposit_event(Event::Transferred(class, instance, origin, details.owner));
Self::deposit_event(Event::Transferred {
class,
instance,
from: origin,
to: details.owner,
});
Ok(())
}
@@ -105,7 +110,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Attribute::<T, I>::remove_prefix((&class,), None);
T::Currency::unreserve(&class_details.owner, class_details.total_deposit);
Self::deposit_event(Event::Destroyed(class));
Self::deposit_event(Event::Destroyed { class });
Ok(DestroyWitness {
instances: class_details.instances,
@@ -146,7 +151,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Ok(())
})?;
Self::deposit_event(Event::Issued(class, instance, owner));
Self::deposit_event(Event::Issued { class, instance, owner });
Ok(())
}
@@ -174,7 +179,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Asset::<T, I>::remove(&class, &instance);
Account::<T, I>::remove((&owner, &class, &instance));
Self::deposit_event(Event::Burned(class, instance, owner));
Self::deposit_event(Event::Burned { class, instance, owner });
Ok(())
}
}