mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 01:07:57 +00:00
Remove serde requirement from FRAME macros (#8628)
* Remove `serde` requirement from FRAME macros Currently there is some implicit requirement on `serde` being present in the `Cargo.toml` of a pallet when `GenesisConfig` is used. This pr removes this requirement by using the serde attribute `serde(crate = "..")`. * build a unique reexport of serde in impl_opaque_keys, by abusing paste doc concatenation * Optimize Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -76,10 +76,13 @@ macro_rules! impl_outer_config {
|
||||
}
|
||||
|
||||
$crate::paste::item! {
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use $crate::serde as __genesis_config_serde_import__;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
#[derive($crate::serde::Serialize, $crate::serde::Deserialize, Default)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
#[serde(crate = "__genesis_config_serde_import__")]
|
||||
pub struct $main {
|
||||
$(
|
||||
pub [< $snake $(_ $instance )? >]: $config,
|
||||
|
||||
Reference in New Issue
Block a user