Skip to content

Commit

Permalink
fix(chain-spec): ChainSpecBuilder with object as default genesis (#4345)
Browse files Browse the repository at this point in the history
The current `json_patch::merge` function will replace the default
configuration with the builder action if the action is not a JSON
Object, which means, if not configured, the current code will try to use
`Value::Null` as the config, which (almost?) always fails, making it
mandatory to configure `with_genesis_config...`.

This change uses a JSON Object as the default values, which means the
code will continue using the default config if none is given.

Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
saiintbrisson and bkchr committed Jul 24, 2024
1 parent 76a6d47 commit b9aa8ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion substrate/client/chain-spec/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl<E, EHF> ChainSpecBuilder<E, EHF> {
name: "Development".to_string(),
id: "dev".to_string(),
chain_type: ChainType::Local,
genesis_build_action: GenesisBuildAction::Patch(Default::default()),
genesis_build_action: GenesisBuildAction::Patch(json::json!({})),
boot_nodes: None,
telemetry_endpoints: None,
protocol_id: None,
Expand Down

0 comments on commit b9aa8ab

Please sign in to comment.