Skip to content

Commit

Permalink
fix(chain-spec): ChainSpecBuilder with object as default genesis (par…
Browse files Browse the repository at this point in the history
…itytech#4345)

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
2 people authored and TarekkMA committed Aug 2, 2024
1 parent a55cd28 commit 778c190
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 778c190

Please sign in to comment.