Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
frame::support: serde for pallets' GenesisConfig enabled in no-std
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkucharczyk committed May 30, 2023
1 parent d00d664 commit 1a4c96c
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions frame/support/procedural/src/pallet/expand/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,13 @@ pub fn expand_genesis_config(def: &mut Def) -> proc_macro2::TokenStream {
));
}
attrs.push(syn::parse_quote!(
#[cfg_attr(feature = "std", derive(#frame_support::Serialize, #frame_support::Deserialize))]
#[derive(#frame_support::Serialize, #frame_support::Deserialize)]
));
attrs.push(
syn::parse_quote!( #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] ),
);
attrs.push(
syn::parse_quote!( #[cfg_attr(feature = "std", serde(deny_unknown_fields))] ),
);
attrs.push(
syn::parse_quote!( #[cfg_attr(feature = "std", serde(bound(serialize = "")))] ),
);
attrs.push(
syn::parse_quote!( #[cfg_attr(feature = "std", serde(bound(deserialize = "")))] ),
);
attrs.push(
syn::parse_quote!( #[cfg_attr(feature = "std", serde(crate = #serde_crate))] ),
);
attrs.push(syn::parse_quote!( #[serde(rename_all = "camelCase")] ));
attrs.push(syn::parse_quote!( #[serde(deny_unknown_fields)] ));
attrs.push(syn::parse_quote!( #[serde(bound(serialize = ""))] ));
attrs.push(syn::parse_quote!( #[serde(bound(deserialize = ""))] ));
attrs.push(syn::parse_quote!( #[serde(crate = #serde_crate)] ));
},
_ => unreachable!("Checked by genesis_config parser"),
}
Expand Down

0 comments on commit 1a4c96c

Please sign in to comment.