Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature [MGX-251] - Default transactional #75

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
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
32 changes: 16 additions & 16 deletions frame/support/procedural/src/pallet/expand/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,22 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
let capture_docs = if cfg!(feature = "no-metadata-docs") { "never" } else { "always" };

// Wrap all calls inside of storage layers
// if let Some(syn::Item::Impl(item_impl)) = def
// .call
// .as_ref()
// .map(|c| &mut def.item.content.as_mut().expect("Checked by def parser").1[c.index])
// {
// item_impl.items.iter_mut().for_each(|i| {
// if let syn::ImplItem::Method(method) = i {
// let block = &method.block;
// method.block = syn::parse_quote! {{
// // 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::with_storage_layer(|| #block)
// }};
// }
// });
// }
if let Some(syn::Item::Impl(item_impl)) = def
.call
.as_ref()
.map(|c| &mut def.item.content.as_mut().expect("Checked by def parser").1[c.index])
{
item_impl.items.iter_mut().for_each(|i| {
if let syn::ImplItem::Method(method) = i {
let block = &method.block;
method.block = syn::parse_quote! {{
// 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::with_storage_layer(|| #block)
}};
}
});
}

quote::quote_spanned!(span =>
#[doc(hidden)]
Expand Down