mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 10:57:56 +00:00
add post_dispatch (#3229)
* add post_dispatch * Update traits.rs * Update checked_extrinsic.rs * Update traits.rs * Update traits.rs * fix build issue * update runtime version * fix test build issue
This commit is contained in:
@@ -77,14 +77,16 @@ where
|
||||
info: DispatchInfo,
|
||||
len: usize,
|
||||
) -> Result<DispatchResult, DispatchError> {
|
||||
let maybe_who = if let Some((id, extra)) = self.signed {
|
||||
Extra::pre_dispatch(extra, &id, &self.function, info, len)?;
|
||||
Some(id)
|
||||
let (maybe_who, pre) = if let Some((id, extra)) = self.signed {
|
||||
let pre = Extra::pre_dispatch(extra, &id, &self.function, info, len)?;
|
||||
(Some(id), pre)
|
||||
} else {
|
||||
Extra::pre_dispatch_unsigned(&self.function, info, len)?;
|
||||
None
|
||||
let pre = Extra::pre_dispatch_unsigned(&self.function, info, len)?;
|
||||
(None, pre)
|
||||
};
|
||||
Ok(self.function.dispatch(Origin::from(maybe_who)))
|
||||
let res = self.function.dispatch(Origin::from(maybe_who));
|
||||
Extra::post_dispatch(pre, info, len);
|
||||
Ok(res)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -236,6 +236,8 @@ mod tests {
|
||||
type AccountId = u64;
|
||||
type Call = ();
|
||||
type AdditionalSigned = ();
|
||||
type Pre = ();
|
||||
|
||||
fn additional_signed(&self) -> rstd::result::Result<(), &'static str> { Ok(()) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user