Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

finality_grandpa::Commit doesn't implement core::fmt::Debug #12654

Closed
2 tasks done
nazar-pc opened this issue Nov 9, 2022 · 0 comments · Fixed by #12664
Closed
2 tasks done

finality_grandpa::Commit doesn't implement core::fmt::Debug #12654

nazar-pc opened this issue Nov 9, 2022 · 0 comments · Fixed by #12664

Comments

@nazar-pc
Copy link
Contributor

nazar-pc commented Nov 9, 2022

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

I have added sp-debug-derive = { version = "4.0.0", default-features = false, features = ["force-debug"] } to my runtime and it stopped compiling with this:

  error[E0277]: `finality_grandpa::Commit<<Header as HeaderT>::Hash, <Header as HeaderT>::Number, app::Signature, app::Public>` doesn't implement `core::fmt::Debug`
     --> /home/nazar-pc/.cargo/git/checkouts/substrate-7bc20b373ca3e834/4fa79c1/primitives/finality-grandpa/src/lib.rs:132:48
      |
  132 | #[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug)]
      |                                                ^^^^^^^^^^^^ `finality_grandpa::Commit<<Header as HeaderT>::Hash, <Header as HeaderT>::Number, app::Signature, app::Public>` cannot be formatted using `{:?}` because it doesn't implement `core::fmt::Debug`
      |
      = help: the trait `core::fmt::Debug` is not implemented for `finality_grandpa::Commit<<Header as HeaderT>::Hash, <Header as HeaderT>::Number, app::Signature, app::Public>`
      = note: required for the cast from `finality_grandpa::Commit<<Header as HeaderT>::Hash, <Header as HeaderT>::Number, app::Signature, app::Public>` to the object type `dyn core::fmt::Debug`
      = note: this error originates in the derive macro `RuntimeDebug` (in Nightly builds, run with -Z macro-backtrace for more info)

  For more information about this error, try `rustc --explain E0277`.

Looks like something went wrong with this feature enabled.

Steps to reproduce

Apply following patch:

diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml
--- a/bin/node/runtime/Cargo.toml	(revision 4fa79c18d6a29fdd1adeba6b7946b70d18263523)
+++ b/bin/node/runtime/Cargo.toml	(date 1667956598703)
@@ -108,6 +108,7 @@
 pallet-uniques = { version = "4.0.0-dev", default-features = false, path = "../../../frame/uniques" }
 pallet-vesting = { version = "4.0.0-dev", default-features = false, path = "../../../frame/vesting" }
 pallet-whitelist = { version = "4.0.0-dev", default-features = false, path = "../../../frame/whitelist" }
+sp-debug-derive = { version = "4.0.0", path = "../../../primitives/debug-derive", default-features = false, features = ["force-debug"] }
 
 [build-dependencies]
 substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-builder" }

Then run cargo c -p kitchensink-runtime

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant