mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +00:00
Include post dispatch corrected weight in extrinsic events (#6024)
* Include post dispatch corrected weight in extrinsic events * Drop the 'Post' from ApplyExtrinsicResultWithPostInfo to make it less verbose * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Use proper Event type in pallet_system tests * Add test that the actual weight is returned by events * Make fn extract_actual_weight cap at pre dispatch weight * Bump spec version Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
committed by
GitHub
parent
81b30fe6f6
commit
80accdbf7c
@@ -119,6 +119,7 @@ use sp_std::{prelude::*, marker::PhantomData};
|
||||
use frame_support::{
|
||||
storage::StorageValue, weights::{GetDispatchInfo, DispatchInfo, DispatchClass},
|
||||
traits::{OnInitialize, OnFinalize, OnRuntimeUpgrade, OffchainWorker},
|
||||
dispatch::PostDispatchInfo,
|
||||
};
|
||||
use sp_runtime::{
|
||||
generic::Digest, ApplyExtrinsicResult,
|
||||
@@ -174,7 +175,7 @@ where
|
||||
CheckedOf<Block::Extrinsic, Context>:
|
||||
Applyable +
|
||||
GetDispatchInfo,
|
||||
CallOf<Block::Extrinsic, Context>: Dispatchable<Info=DispatchInfo>,
|
||||
CallOf<Block::Extrinsic, Context>: Dispatchable<Info=DispatchInfo, PostInfo=PostDispatchInfo>,
|
||||
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
|
||||
UnsignedValidator: ValidateUnsigned<Call=CallOf<Block::Extrinsic, Context>>,
|
||||
{
|
||||
@@ -200,7 +201,7 @@ where
|
||||
CheckedOf<Block::Extrinsic, Context>:
|
||||
Applyable +
|
||||
GetDispatchInfo,
|
||||
CallOf<Block::Extrinsic, Context>: Dispatchable<Info=DispatchInfo>,
|
||||
CallOf<Block::Extrinsic, Context>: Dispatchable<Info=DispatchInfo, PostInfo=PostDispatchInfo>,
|
||||
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
|
||||
UnsignedValidator: ValidateUnsigned<Call=CallOf<Block::Extrinsic, Context>>,
|
||||
{
|
||||
@@ -368,9 +369,9 @@ where
|
||||
let dispatch_info = xt.get_dispatch_info();
|
||||
let r = Applyable::apply::<UnsignedValidator>(xt, &dispatch_info, encoded_len)?;
|
||||
|
||||
<frame_system::Module<System>>::note_applied_extrinsic(&r, encoded_len as u32, dispatch_info);
|
||||
<frame_system::Module<System>>::note_applied_extrinsic(&r, dispatch_info);
|
||||
|
||||
Ok(r)
|
||||
Ok(r.map(|_| ()).map_err(|e| e.error))
|
||||
}
|
||||
|
||||
fn final_checks(header: &System::Header) {
|
||||
|
||||
Reference in New Issue
Block a user