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
+6 -3
View File
@@ -109,8 +109,8 @@ pub mod pallet {
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event {
/// Batch of dispatches did not complete fully. Index of first failing dispatch given, as
/// well as the error. \[index, error\]
BatchInterrupted(u32, DispatchError),
/// well as the error.
BatchInterrupted { index: u32, error: DispatchError },
/// Batch of dispatches completed fully with no error.
BatchCompleted,
/// A single item within a Batch of dispatches has completed with no error.
@@ -217,7 +217,10 @@ pub mod pallet {
// Add the weight of this call.
weight = weight.saturating_add(extract_actual_weight(&result, &info));
if let Err(e) = result {
Self::deposit_event(Event::BatchInterrupted(index as u32, e.error));
Self::deposit_event(Event::BatchInterrupted {
index: index as u32,
error: e.error,
});
// Take the weight of this function itself into account.
let base_weight = T::WeightInfo::batch(index.saturating_add(1) as u32);
// Return the actual used weight + base_weight of this call.