From 697c3d51bc9b29f62e464a33fafec11e825deee8 Mon Sep 17 00:00:00 2001 From: Luiz Carvalho Date: Wed, 1 May 2024 14:39:36 -0300 Subject: [PATCH] fix(substrate/chain-spec): ChainSpecBuilder with object as default genesis 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. --- 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 a9cdce4bf955..5bae16a86d2d 100644 --- a/substrate/client/chain-spec/src/chain_spec.rs +++ b/substrate/client/chain-spec/src/chain_spec.rs @@ -367,7 +367,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,