Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/sr-primitives/src/generic/checked_extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ where
Extra::pre_dispatch_unsigned(info, len)?;
None
};
Ok(self.function.dispatch(Origin::from(maybe_who)))
let res = self.function.dispatch(Origin::from(maybe_who));
Extra::post_dispatch(info, len);
Comment thread
xlc marked this conversation as resolved.
Outdated
Ok(res)
}
}

Expand Down
14 changes: 13 additions & 1 deletion core/sr-primitives/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ pub trait SignedExtension:
/// also perform any pre-signature-verification checks and return an error if needed.
fn additional_signed(&self) -> Result<Self::AdditionalSigned, &'static str>;

/// Validate a signed transaction for the transaction queue.
/// Validate a signed transaction for the transaction queue.
fn validate(
&self,
_who: &Self::AccountId,
Expand Down Expand Up @@ -868,6 +868,12 @@ pub trait SignedExtension:
info: DispatchInfo,
len: usize,
) -> Result<(), DispatchError> { Self::validate_unsigned(info, len).map(|_| ()) }

/// Do any post-flight stuff for a transaction.
fn post_dispatch(
_info: DispatchInfo,
_len: usize,
) { }
}

macro_rules! tuple_impl_indexed {
Expand Down Expand Up @@ -916,6 +922,12 @@ macro_rules! tuple_impl_indexed {
$($direct::pre_dispatch_unsigned(info, len)?;)+
Ok(())
}
fn post_dispatch(
info: DispatchInfo,
len: usize,
) {
$($direct::post_dispatch(info, len);)+
}
}

};
Expand Down