mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37: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:
@@ -1217,19 +1217,24 @@ macro_rules! impl_opaque_keys {
|
||||
)*
|
||||
}
|
||||
) => {
|
||||
$( #[ $attr ] )*
|
||||
#[derive(
|
||||
Default, Clone, PartialEq, Eq,
|
||||
$crate::codec::Encode,
|
||||
$crate::codec::Decode,
|
||||
$crate::RuntimeDebug,
|
||||
)]
|
||||
#[cfg_attr(feature = "std", derive($crate::serde::Serialize, $crate::serde::Deserialize))]
|
||||
pub struct $name {
|
||||
$(
|
||||
$( #[ $inner_attr ] )*
|
||||
pub $field: <$type as $crate::BoundToRuntimeAppPublic>::Public,
|
||||
)*
|
||||
$crate::paste::paste! {
|
||||
#[cfg(feature = "std")]
|
||||
use $crate::serde as [< __opaque_keys_serde_import__ $name >];
|
||||
$( #[ $attr ] )*
|
||||
#[derive(
|
||||
Default, Clone, PartialEq, Eq,
|
||||
$crate::codec::Encode,
|
||||
$crate::codec::Decode,
|
||||
$crate::RuntimeDebug,
|
||||
)]
|
||||
#[cfg_attr(feature = "std", derive($crate::serde::Serialize, $crate::serde::Deserialize))]
|
||||
#[cfg_attr(feature = "std", serde(crate = "__opaque_keys_serde_import__" $name))]
|
||||
pub struct $name {
|
||||
$(
|
||||
$( #[ $inner_attr ] )*
|
||||
pub $field: <$type as $crate::BoundToRuntimeAppPublic>::Public,
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
impl $name {
|
||||
|
||||
Reference in New Issue
Block a user