From b9aa8ab6a07f193bbedc6f778e70b6adcb44f2ad Mon Sep 17 00:00:00 2001 From: Luiz Carvalho Date: Wed, 24 Jul 2024 20:01:00 +1000 Subject: [PATCH] fix(chain-spec): ChainSpecBuilder with object as default genesis (#4345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- substrate/client/chain-spec/src/chain_spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/client/chain-spec/src/chain_spec.rs b/substrate/client/chain-spec/src/chain_spec.rs index 5f90f549e022..aa3c1ba3e6f1 100644 --- a/substrate/client/chain-spec/src/chain_spec.rs +++ b/substrate/client/chain-spec/src/chain_spec.rs @@ -325,7 +325,7 @@ impl ChainSpecBuilder { 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,