Skip to content

Commit

Permalink
frame-support: sp-runtime dependency updated (serde) (paritytech#2907)
Browse files Browse the repository at this point in the history
`frame-support` crate compilation fails (reported by @koute):

```
$ cargo check --no-default-features --target=wasm32-unknown-unknown

error[E0277]: the trait bound `GC: Serialize` is not satisfied
    --> substrate/frame/support/src/genesis_builder_helper.rs:32:24
     |
32   |     serde_json::to_string(&GC::default())
     |     --------------------- ^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `GC`
     |     |
     |     required by a bound introduced by this call
     |
note: required by a bound in `serde_json::to_string`
    --> /home/kou/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.111/src/ser.rs:2209:17
     |
2207 | pub fn to_string<T>(value: &T) -> Result<String>
     |        --------- required by a bound in this function
2208 | where
2209 |     T: ?Sized + Serialize,
     |                 ^^^^^^^^^ required by this bound in `to_string`
help: consider further restricting this bound
     |
30   |     GC: BuildGenesisConfig + Default + serde::Serialize,
     |                                      ++++++++++++++++++
```

This PR should fix this.

For all runtimes `sp-runtime/serde` feature was likely enabled by this
(and few other pallets):

https://github.com/paritytech/polkadot-sdk/blob/d1e8e3339ea91c1e48e8bc30d56fad3241444e9d/substrate/frame/system/Cargo.toml#L27
  • Loading branch information
michalkucharczyk authored Jan 11, 2024
1 parent 83bf499 commit f7a80ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion substrate/frame/support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ frame-metadata = { version = "16.0.0", default-features = false, features = ["cu
sp-api = { path = "../../primitives/api", default-features = false, features = ["frame-metadata"] }
sp-std = { path = "../../primitives/std", default-features = false }
sp-io = { path = "../../primitives/io", default-features = false }
sp-runtime = { path = "../../primitives/runtime", default-features = false }
sp-runtime = { path = "../../primitives/runtime", default-features = false, features = ["serde"] }
sp-tracing = { path = "../../primitives/tracing", default-features = false }
sp-core = { path = "../../primitives/core", default-features = false }
sp-arithmetic = { path = "../../primitives/arithmetic", default-features = false }
Expand Down

0 comments on commit f7a80ec

Please sign in to comment.