From bc89da26a8c4dd0793615d5ce86a26b0cd1db5c3 Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Thu, 18 May 2023 13:36:48 +0200 Subject: [PATCH] Added serde feature to sp-consensus-aura (#14166) This is followup of #13027. `Aura` need to enable `serde` feature in dependent crates, otherwise test-substrate-runtime compilation fails with the following error if `serde` is enabled: ``` error: cannot find macro `format` in this scope --> /home/miszka/parity/10-genesis-config/substrate-master/primitives/consensus/aura/src/lib.rs:50:3 | 50 | app_crypto!(ed25519, AURA); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider importing one of these items: scale_info::prelude::format sp_application_crypto::format = note: this error originates in the macro `$crate::app_crypto_public_common_if_serde` which comes from the expansion of the macro `app_crypto` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- primitives/consensus/aura/Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/primitives/consensus/aura/Cargo.toml b/primitives/consensus/aura/Cargo.toml index 94a031a547368..57689aaa13aa6 100644 --- a/primitives/consensus/aura/Cargo.toml +++ b/primitives/consensus/aura/Cargo.toml @@ -40,3 +40,11 @@ std = [ "sp-std/std", "sp-timestamp/std", ] + +# Serde support without relying on std features. +serde = [ + "scale-info/serde", + "sp-application-crypto/serde", + "sp-consensus-slots/serde", + "sp-runtime/serde", +]