From 2f341fcf15dd5a9b4601810e6e4ce7373f5af10a Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Tue, 18 Oct 2022 13:15:40 +0300 Subject: [PATCH] derive Serialize/Deserialize for BeefyAuthoritySet (#12516) --- substrate/Cargo.lock | 1 + substrate/primitives/beefy/Cargo.toml | 2 ++ substrate/primitives/beefy/src/mmr.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 2c1b427f0a..7ea4e3e5c0 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -535,6 +535,7 @@ dependencies = [ "array-bytes", "parity-scale-codec", "scale-info", + "serde", "sp-api", "sp-application-crypto", "sp-core", diff --git a/substrate/primitives/beefy/Cargo.toml b/substrate/primitives/beefy/Cargo.toml index f85e2edf4f..22e41b5130 100644 --- a/substrate/primitives/beefy/Cargo.toml +++ b/substrate/primitives/beefy/Cargo.toml @@ -14,6 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.136", optional = true, features = ["derive"] } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false, path = "../api" } sp-application-crypto = { version = "6.0.0", default-features = false, path = "../application-crypto" } @@ -32,6 +33,7 @@ default = ["std"] std = [ "codec/std", "scale-info/std", + "serde", "sp-api/std", "sp-application-crypto/std", "sp-core/std", diff --git a/substrate/primitives/beefy/src/mmr.rs b/substrate/primitives/beefy/src/mmr.rs index 0edb8babd6..78ceef0b6b 100644 --- a/substrate/primitives/beefy/src/mmr.rs +++ b/substrate/primitives/beefy/src/mmr.rs @@ -101,6 +101,7 @@ impl MmrLeafVersion { /// Details of a BEEFY authority set. #[derive(Debug, Default, PartialEq, Eq, Clone, Encode, Decode, TypeInfo, MaxEncodedLen)] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] pub struct BeefyAuthoritySet { /// Id of the set. ///