Make New Storage Layer Truly Default (#11918)

* with storage layer truly default

* fmt

Co-authored-by: parity-processbot <>
This commit is contained in:
Shawn Tabrizi
2022-07-26 18:49:11 +01:00
committed by GitHub
parent 7bdeb960c3
commit 72522429a7
6 changed files with 9 additions and 41 deletions
@@ -163,19 +163,6 @@ pub fn expand_outer_dispatch(
}
}
}
impl #scrate::traits::DispatchableWithStorageLayer for Call {
type Origin = Origin;
fn dispatch_with_storage_layer(self, origin: Origin) -> #scrate::dispatch::DispatchResultWithPostInfo {
#scrate::storage::with_storage_layer(|| {
#scrate::dispatch::Dispatchable::dispatch(self, origin)
})
}
fn dispatch_bypass_filter_with_storage_layer(self, origin: Origin) -> #scrate::dispatch::DispatchResultWithPostInfo {
#scrate::storage::with_storage_layer(|| {
#scrate::traits::UnfilteredDispatchable::dispatch_bypass_filter(self, origin)
})
}
}
#(
impl #scrate::traits::IsSubType<#scrate::dispatch::CallableCallFor<#pallet_names, #runtime>> for Call {
@@ -267,9 +267,9 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
#frame_support::sp_tracing::enter_span!(
#frame_support::sp_tracing::trace_span!(stringify!(#fn_name))
);
// We execute all dispatchable in at least one storage layer, allowing them
// We execute all dispatchable in a new storage layer, allowing them
// to return an error at any point, and undoing any storage changes.
#frame_support::storage::in_storage_layer(|| {
#frame_support::storage::with_storage_layer(|| {
<#pallet_ident<#type_use_gen>>::#fn_name(origin, #( #args_name, )* )
.map(Into::into).map_err(Into::into)
})