Add some important events to batch & staking to ensure ease of analysis (#9462)

* Add some important events to batch & staking to ensure ease of analysis

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>

* Update lib.rs

* fix test

Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Gavin Wood
2021-07-29 22:02:28 +02:00
committed by GitHub
parent 060d564fc3
commit 8a44bec2dc
7 changed files with 30 additions and 16 deletions
+4
View File
@@ -108,6 +108,8 @@ pub mod pallet {
BatchInterrupted(u32, DispatchError),
/// Batch of dispatches completed fully with no error.
BatchCompleted,
/// A single item within a Batch of dispatches has completed with no error.
ItemCompleted,
}
#[pallet::call]
@@ -173,6 +175,7 @@ pub mod pallet {
// Return the actual used weight + base_weight of this call.
return Ok(Some(base_weight + weight).into())
}
Self::deposit_event(Event::ItemCompleted);
}
Self::deposit_event(Event::BatchCompleted);
let base_weight = T::WeightInfo::batch(calls_len as u32);
@@ -289,6 +292,7 @@ pub mod pallet {
err.post_info = Some(base_weight + weight).into();
err
})?;
Self::deposit_event(Event::ItemCompleted);
}
Self::deposit_event(Event::BatchCompleted);
let base_weight = T::WeightInfo::batch_all(calls_len as u32);