mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
transactional: Wrap pallet::calls directly in storage layers (#11927)
* transactional: Wrap `pallet::calls` directly in storage layers Before this pr we only wrapped `pallet::calls` into storage layers when executing the calls with `dispatch`. This pr is solving that by wrapping each call function inside a storage layer. * Teach `BasicExternalities` transactions support * Fix crates * FMT * Fix benchmarking tests * Use correct span * Support old decl macros * Fix test * Apply suggestions from code review Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update frame/state-trie-migration/src/lib.rs * Update frame/state-trie-migration/src/lib.rs * Update frame/state-trie-migration/src/lib.rs * Feedback * Apply suggestions from code review Co-authored-by: cheme <emericchevalier.pro@gmail.com> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: cheme <emericchevalier.pro@gmail.com>
This commit is contained in:
@@ -1787,9 +1787,11 @@ macro_rules! decl_module {
|
||||
$vis fn $name(
|
||||
$origin: $origin_ty $(, $param: $param_ty )*
|
||||
) -> $crate::dispatch::DispatchResult {
|
||||
$crate::sp_tracing::enter_span!($crate::sp_tracing::trace_span!(stringify!($name)));
|
||||
{ $( $impl )* }
|
||||
Ok(())
|
||||
$crate::storage::with_storage_layer(|| {
|
||||
$crate::sp_tracing::enter_span!($crate::sp_tracing::trace_span!(stringify!($name)));
|
||||
{ $( $impl )* }
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1805,8 +1807,10 @@ macro_rules! decl_module {
|
||||
) => {
|
||||
$(#[$fn_attr])*
|
||||
$vis fn $name($origin: $origin_ty $(, $param: $param_ty )* ) -> $result {
|
||||
$crate::sp_tracing::enter_span!($crate::sp_tracing::trace_span!(stringify!($name)));
|
||||
$( $impl )*
|
||||
$crate::storage::with_storage_layer(|| {
|
||||
$crate::sp_tracing::enter_span!($crate::sp_tracing::trace_span!(stringify!($name)));
|
||||
$( $impl )*
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user