From d00d66425b59b6c1f44479655a2bda5bc308f866 Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Mon, 1 May 2023 14:39:31 +0200 Subject: [PATCH 1/6] frame: support for serde added - enabled `serde` features in dependent crates, no gate feature introduced, linker should do the job and strip unused code. - frame::staking: added impl of `serde::Serialize, serde::Deserialize` for `enum Forcing` - primitives::runtime: impl_opaque_keys macro provides `Serialize/Deserialize` impl if `serde` is enabled - primitives::staking: added impl of `serde::Serialize`, `serde::Deserialize` for `enum StakerStatus` --- frame/babe/Cargo.toml | 12 ++++++------ frame/beefy/Cargo.toml | 10 ++++------ frame/grandpa/Cargo.toml | 12 ++++++------ frame/im-online/Cargo.toml | 10 +++++----- frame/membership/Cargo.toml | 6 +++--- frame/session/Cargo.toml | 8 ++++---- frame/staking/Cargo.toml | 12 ++++++------ frame/staking/src/lib.rs | 15 +++++++++++++-- frame/support/Cargo.toml | 4 ++-- frame/support/src/lib.rs | 2 -- frame/system/Cargo.toml | 14 +++++++------- frame/system/src/lib.rs | 2 +- primitives/runtime/src/traits.rs | 4 ++-- primitives/staking/Cargo.toml | 7 +++++-- primitives/staking/src/lib.rs | 2 +- 15 files changed, 65 insertions(+), 55 deletions(-) diff --git a/frame/babe/Cargo.toml b/frame/babe/Cargo.toml index 6d25a895d48a8..0929c8904f29b 100644 --- a/frame/babe/Cargo.toml +++ b/frame/babe/Cargo.toml @@ -15,20 +15,20 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } pallet-session = { version = "4.0.0-dev", default-features = false, path = "../session" } pallet-timestamp = { version = "4.0.0-dev", default-features = false, path = "../timestamp" } -sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto" } -sp-consensus-babe = { version = "0.10.0-dev", default-features = false, path = "../../primitives/consensus/babe" } -sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core" } +sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto", features = ["serde"] } +sp-consensus-babe = { version = "0.10.0-dev", default-features = false, path = "../../primitives/consensus/babe", features = ["serde"] } +sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core", features = ["serde"] } sp-io = { version = "8.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } -sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } +sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking", features = ["serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } [dev-dependencies] diff --git a/frame/beefy/Cargo.toml b/frame/beefy/Cargo.toml index 42e2150dd6514..889ae7180e804 100644 --- a/frame/beefy/Cargo.toml +++ b/frame/beefy/Cargo.toml @@ -10,16 +10,15 @@ homepage = "https://substrate.io" [dependencies] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.136", optional = true } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } pallet-session = { version = "4.0.0-dev", default-features = false, path = "../session" } -sp-consensus-beefy = { version = "4.0.0-dev", default-features = false, path = "../../primitives/consensus/beefy" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } +sp-consensus-beefy = { version = "4.0.0-dev", default-features = false, path = "../../primitives/consensus/beefy", features = ["serde"] } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } -sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } +sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking", features = ["serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } [dev-dependencies] @@ -42,7 +41,6 @@ std = [ "pallet-authorship/std", "pallet-session/std", "scale-info/std", - "serde", "sp-consensus-beefy/std", "sp-runtime/std", "sp-session/std", diff --git a/frame/grandpa/Cargo.toml b/frame/grandpa/Cargo.toml index 9dcb048a51c77..1d343909635a6 100644 --- a/frame/grandpa/Cargo.toml +++ b/frame/grandpa/Cargo.toml @@ -15,19 +15,19 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } pallet-session = { version = "4.0.0-dev", default-features = false, path = "../session" } -sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto" } -sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core" } -sp-consensus-grandpa = { version = "4.0.0-dev", default-features = false, path = "../../primitives/consensus/grandpa" } +sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto", features = ["serde"] } +sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core", features = ["serde"] } +sp-consensus-grandpa = { version = "4.0.0-dev", default-features = false, path = "../../primitives/consensus/grandpa", features = ["serde"] } sp-io = { version = "8.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } -sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } +sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking", features = ["serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } [dev-dependencies] diff --git a/frame/im-online/Cargo.toml b/frame/im-online/Cargo.toml index 7cf63116dcbfc..615f9c50e567b 100644 --- a/frame/im-online/Cargo.toml +++ b/frame/im-online/Cargo.toml @@ -15,16 +15,16 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } -sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto" } -sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core" } +sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto", features = ["serde"] } +sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core", features = ["serde"] } sp-io = { version = "8.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } -sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } +sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking", features = ["serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } [dev-dependencies] diff --git a/frame/membership/Cargo.toml b/frame/membership/Cargo.toml index 55dc7fdc531f6..05f4bd6743076 100644 --- a/frame/membership/Cargo.toml +++ b/frame/membership/Cargo.toml @@ -15,13 +15,13 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } -sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core" } +sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core", features = ["serde"] } sp-io = { version = "8.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } [features] diff --git a/frame/session/Cargo.toml b/frame/session/Cargo.toml index 250ac6ea9042f..923351bb29c44 100644 --- a/frame/session/Cargo.toml +++ b/frame/session/Cargo.toml @@ -16,15 +16,15 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } impl-trait-for-tuples = "0.2.2" log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-timestamp = { version = "4.0.0-dev", default-features = false, path = "../timestamp" } -sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core" } +sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core", features = ["serde"] } sp-io = { version = "8.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } sp-session = { version = "4.0.0-dev", default-features = false, path = "../../primitives/session" } -sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } +sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking", features = ["serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } sp-trie = { version = "8.0.0", default-features = false, optional = true, path = "../../primitives/trie" } diff --git a/frame/staking/Cargo.toml b/frame/staking/Cargo.toml index 450d2c39ef45a..1b0842940d40a 100644 --- a/frame/staking/Cargo.toml +++ b/frame/staking/Cargo.toml @@ -13,22 +13,22 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.136", optional = true } +serde = { version = "1.0.136", default-features = false, features = ["alloc", "derive"]} codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [ "derive", ] } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } sp-io = { version = "8.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } -sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } +sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking", features = ["serde"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } pallet-session = { version = "4.0.0-dev", default-features = false, features = [ "historical", ], path = "../session" } pallet-authorship = { version = "4.0.0-dev", default-features = false, path = "../authorship" } -sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto" } +sp-application-crypto = { version = "8.0.0", default-features = false, path = "../../primitives/application-crypto", features = ["serde"] } frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../election-provider-support" } log = { version = "0.4.17", default-features = false } @@ -53,7 +53,7 @@ rand_chacha = { version = "0.2" } default = ["std"] std = [ "frame-benchmarking?/std", - "serde", + "serde/std", "codec/std", "scale-info/std", "sp-std/std", diff --git a/frame/staking/src/lib.rs b/frame/staking/src/lib.rs index c87aeb681a226..55205fad38ff9 100644 --- a/frame/staking/src/lib.rs +++ b/frame/staking/src/lib.rs @@ -849,8 +849,19 @@ impl {}; } -#[cfg(feature = "std")] #[doc(hidden)] pub use serde::{Deserialize, Serialize}; diff --git a/frame/system/Cargo.toml b/frame/system/Cargo.toml index 57aea5bc0c840..601dc17ae9e9a 100644 --- a/frame/system/Cargo.toml +++ b/frame/system/Cargo.toml @@ -16,15 +16,15 @@ targets = ["x86_64-unknown-linux-gnu"] cfg-if = "1.0" codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } log = { version = "0.4.17", default-features = false } -scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.136", features = ["derive"], optional = true } +scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } +serde = { version = "1.0.136", default-features = false, features = ["derive", "alloc"] } frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } -sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core" } +sp-core = { version = "8.0.0", default-features = false, path = "../../primitives/core", features = ["serde"] } sp-io = { version = "8.0.0", default-features = false, path = "../../primitives/io" } -sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime" } +sp-runtime = { version = "8.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] } sp-std = { version = "6.0.0", default-features = false, path = "../../primitives/std" } -sp-version = { version = "6.0.0", default-features = false, path = "../../primitives/version" } -sp-weights = { version = "5.0.0", default-features = false, path = "../../primitives/weights" } +sp-version = { version = "6.0.0", default-features = false, path = "../../primitives/version", features = ["serde"] } +sp-weights = { version = "5.0.0", default-features = false, path = "../../primitives/weights", features = ["serde"] } [dev-dependencies] criterion = "0.4.0" @@ -38,7 +38,7 @@ std = [ "frame-support/std", "log/std", "scale-info/std", - "serde", + "serde/std", "sp-core/std", "sp-io/std", "sp-runtime/std", diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index 8c717e3f5eb12..79cdcf22f55c7 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -673,7 +673,7 @@ pub mod pallet { #[derive(Default)] #[pallet::genesis_config] pub struct GenesisConfig { - #[cfg_attr(feature = "std", serde(with = "sp_core::bytes"))] + #[serde(with = "sp_core::bytes")] pub code: Vec, } diff --git a/primitives/runtime/src/traits.rs b/primitives/runtime/src/traits.rs index d1fda9f3d5256..14e134cc89750 100644 --- a/primitives/runtime/src/traits.rs +++ b/primitives/runtime/src/traits.rs @@ -1763,7 +1763,7 @@ macro_rules! impl_opaque_keys_inner { /// } /// ``` #[macro_export] -#[cfg(feature = "std")] +#[cfg(any(feature = "serde", feature = "std"))] macro_rules! impl_opaque_keys { { $( #[ $attr:meta ] )* @@ -1793,7 +1793,7 @@ macro_rules! impl_opaque_keys { } #[macro_export] -#[cfg(not(feature = "std"))] +#[cfg(all(not(feature = "std"), not(feature = "serde")))] #[doc(hidden)] macro_rules! impl_opaque_keys { { diff --git a/primitives/staking/Cargo.toml b/primitives/staking/Cargo.toml index be6bd4653f140..8d200e2e531f9 100644 --- a/primitives/staking/Cargo.toml +++ b/primitives/staking/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.136", optional = true } +serde = { version = "1.0.136", default-features = false, features = ["derive", "alloc"], optional = true } codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } sp-core = { version = "8.0.0", default-features = false, path = "../core" } @@ -23,11 +23,14 @@ sp-std = { version = "6.0.0", default-features = false, path = "../std" } [features] default = ["std"] std = [ - "serde", + "serde/std", "codec/std", "scale-info/std", "sp-core/std", "sp-runtime/std", "sp-std/std", ] +serde = [ + "dep:serde" +] runtime-benchmarks = [] diff --git a/primitives/staking/src/lib.rs b/primitives/staking/src/lib.rs index 57128bd327d9e..2fd5c6acc6a04 100644 --- a/primitives/staking/src/lib.rs +++ b/primitives/staking/src/lib.rs @@ -35,7 +35,7 @@ pub type EraIndex = u32; /// Representation of the status of a staker. #[derive(RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone))] pub enum StakerStatus { /// Chilling. Idle, From 1a4c96ce96ed65fa5cef1c582c24f96c566d3336 Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Tue, 30 May 2023 15:30:38 +0200 Subject: [PATCH 2/6] frame::support: serde for pallets' GenesisConfig enabled in no-std --- .../src/pallet/expand/genesis_config.rs | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/frame/support/procedural/src/pallet/expand/genesis_config.rs b/frame/support/procedural/src/pallet/expand/genesis_config.rs index de46afecf3d01..cbe47bd8505f6 100644 --- a/frame/support/procedural/src/pallet/expand/genesis_config.rs +++ b/frame/support/procedural/src/pallet/expand/genesis_config.rs @@ -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"), } From 69dd09f7ef75f2ca9f00f5d83accb484b9e735f9 Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Tue, 30 May 2023 19:20:29 +0200 Subject: [PATCH 3/6] Cargo.lock updated --- Cargo.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 5c44f781ee644..d99740b470d1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6161,7 +6161,6 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "serde", "sp-consensus-beefy", "sp-core", "sp-io", From 220956f482562c2f7ed05ec6ca2b342003f9f078 Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Wed, 31 May 2023 07:36:19 +0100 Subject: [PATCH 4/6] Update primitives/staking/Cargo.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Köcher --- primitives/staking/Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/primitives/staking/Cargo.toml b/primitives/staking/Cargo.toml index 8d200e2e531f9..5c12c4c5207e3 100644 --- a/primitives/staking/Cargo.toml +++ b/primitives/staking/Cargo.toml @@ -30,7 +30,4 @@ std = [ "sp-runtime/std", "sp-std/std", ] -serde = [ - "dep:serde" -] runtime-benchmarks = [] From 04dd465434eb5a5cdf75f1623052f4013b16068e Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Thu, 1 Jun 2023 11:35:02 +0200 Subject: [PATCH 5/6] fix --- frame/support/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/support/Cargo.toml b/frame/support/Cargo.toml index b8b63ddb5cb83..1bd3ff815d8ee 100644 --- a/frame/support/Cargo.toml +++ b/frame/support/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.163", deafult-features = false, features = ["alloc", "derive"] } +serde = { version = "1.0.163", default-features = false, features = ["alloc", "derive"] } codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } frame-metadata = { version = "15.1.0", default-features = false, features = ["v14", "v15-unstable"] } From c5acc15c5e5fab89e2d80e733e3ceb344456ff3e Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Thu, 1 Jun 2023 11:55:38 +0200 Subject: [PATCH 6/6] Cargo.lock update + missed serde/std in beefy --- Cargo.lock | 1 + frame/beefy/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index ef143bd569881..e37cc1cb52c90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6160,6 +6160,7 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", + "serde", "sp-consensus-beefy", "sp-core", "sp-io", diff --git a/frame/beefy/Cargo.toml b/frame/beefy/Cargo.toml index 3a425ea1752c5..980f1e80e19cb 100644 --- a/frame/beefy/Cargo.toml +++ b/frame/beefy/Cargo.toml @@ -42,6 +42,7 @@ std = [ "pallet-authorship/std", "pallet-session/std", "scale-info/std", + "serde/std", "sp-consensus-beefy/std", "sp-runtime/std", "sp-session/std",