mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 08:15:41 +00:00
Introduce storage attr macro #[disable_try_decode_storage] and set it on System::Events and ParachainSystem::HostConfiguration (#3454)
Closes https://github.com/paritytech/polkadot-sdk/issues/2560 Allows marking storage items with `#[disable_try_decode_storage]`, and uses it with `System::Events`. Question: what's the recommended way to write a test for this? I couldn't find a test for similar existing macro `#[whitelist_storage]`.
This commit is contained in:
@@ -834,7 +834,10 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
.storages
|
||||
.iter()
|
||||
.filter_map(|storage| {
|
||||
if storage.cfg_attrs.is_empty() {
|
||||
// A little hacky; don't generate for cfg gated storages to not get compile errors
|
||||
// when building "frame-feature-testing" gated storages in the "frame-support-test"
|
||||
// crate.
|
||||
if storage.try_decode && storage.cfg_attrs.is_empty() {
|
||||
let ident = &storage.ident;
|
||||
let gen = &def.type_use_generics(storage.attr_span);
|
||||
Some(quote::quote_spanned!(storage.attr_span => #ident<#gen> ))
|
||||
|
||||
Reference in New Issue
Block a user