mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 13:37:57 +00:00
Add base-weight to System::Extrinsic* events (#12329)
* Add base-weight to events Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix test Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
3317eb76d5
commit
26ea6e1e48
@@ -1509,9 +1509,15 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
|
||||
/// To be called immediately after an extrinsic has been applied.
|
||||
///
|
||||
/// Emits an `ExtrinsicSuccess` or `ExtrinsicFailed` event depending on the outcome.
|
||||
/// The emitted event contains the post-dispatch corrected weight including
|
||||
/// the base-weight for its dispatch class.
|
||||
pub fn note_applied_extrinsic(r: &DispatchResultWithPostInfo, mut info: DispatchInfo) {
|
||||
info.weight = extract_actual_weight(r, &info);
|
||||
info.weight = extract_actual_weight(r, &info)
|
||||
.saturating_add(T::BlockWeights::get().get(info.class).base_extrinsic);
|
||||
info.pays_fee = extract_actual_pays_fee(r, &info);
|
||||
|
||||
Self::deposit_event(match r {
|
||||
Ok(_) => Event::ExtrinsicSuccess { dispatch_info: info },
|
||||
Err(err) => {
|
||||
|
||||
Reference in New Issue
Block a user