Add parachain related parameters to `chain-spec-builder` (#4889)
When using with `polkadot-parachain`, you usually need to specify the `relay_chain` and `para_id` fields in the chain spec. With this PR it can be achieved by specifying newly added `--para-id` and `--relay-chain` command line args, e.g: ``` chain-spec-builder create -r _runtime.wasm --para-id 100 --relay-chain xxx default ``` This was implemented by simple _json_ blobs merging. Additionally unit tests covering basic functionality were added. Also adds a fix for not overwriting the chain spec with the default config each time, swallowing not standard fields is also fixed. Fixes: #4873 --------- Co-authored-by:Sebastian Kunert <skunert49@gmail.com> Co-authored-by:
Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
Showing
- Cargo.lock 2 additions, 0 deletionsCargo.lock
- docs/sdk/src/reference_docs/chain_spec_genesis.rs 4 additions, 2 deletionsdocs/sdk/src/reference_docs/chain_spec_genesis.rs
- docs/sdk/src/reference_docs/chain_spec_runtime/tests/chain_spec_builder_tests.rs 60 additions, 1 deletion...docs/chain_spec_runtime/tests/chain_spec_builder_tests.rs
- prdoc/pr_4889.prdoc 15 additions, 0 deletionsprdoc/pr_4889.prdoc
- substrate/bin/utils/chain-spec-builder/Cargo.toml 4 additions, 0 deletionssubstrate/bin/utils/chain-spec-builder/Cargo.toml
- substrate/bin/utils/chain-spec-builder/bin/main.rs 2 additions, 106 deletionssubstrate/bin/utils/chain-spec-builder/bin/main.rs
- substrate/bin/utils/chain-spec-builder/src/lib.rs 224 additions, 21 deletionssubstrate/bin/utils/chain-spec-builder/src/lib.rs
- substrate/bin/utils/chain-spec-builder/tests/expected/add_code_substitute.json 42 additions, 0 deletions...hain-spec-builder/tests/expected/add_code_substitute.json
- substrate/bin/utils/chain-spec-builder/tests/expected/convert_to_raw.json 38 additions, 0 deletions...ils/chain-spec-builder/tests/expected/convert_to_raw.json
- substrate/bin/utils/chain-spec-builder/tests/expected/create_default.json 37 additions, 0 deletions...ils/chain-spec-builder/tests/expected/create_default.json
- substrate/bin/utils/chain-spec-builder/tests/expected/create_parachain.json 39 additions, 0 deletions...s/chain-spec-builder/tests/expected/create_parachain.json
- substrate/bin/utils/chain-spec-builder/tests/expected/create_raw_storage.json 38 additions, 0 deletions...chain-spec-builder/tests/expected/create_raw_storage.json
- substrate/bin/utils/chain-spec-builder/tests/expected/create_with_full.json 58 additions, 0 deletions...s/chain-spec-builder/tests/expected/create_with_full.json
- substrate/bin/utils/chain-spec-builder/tests/expected/create_with_named_preset.json 38 additions, 0 deletions...spec-builder/tests/expected/create_with_named_preset.json
- substrate/bin/utils/chain-spec-builder/tests/expected/create_with_params.json 37 additions, 0 deletions...chain-spec-builder/tests/expected/create_with_params.json
- substrate/bin/utils/chain-spec-builder/tests/expected/create_with_patch.json 43 additions, 0 deletions.../chain-spec-builder/tests/expected/create_with_patch.json
- substrate/bin/utils/chain-spec-builder/tests/expected/update_code.json 40 additions, 0 deletions.../utils/chain-spec-builder/tests/expected/update_code.json
- substrate/bin/utils/chain-spec-builder/tests/expected/update_code_raw.json 38 additions, 0 deletions...ls/chain-spec-builder/tests/expected/update_code_raw.json
- substrate/bin/utils/chain-spec-builder/tests/input/chain_spec_conversion_test.json 40 additions, 0 deletions...-spec-builder/tests/input/chain_spec_conversion_test.json
- substrate/bin/utils/chain-spec-builder/tests/input/chain_spec_plain.json 40 additions, 0 deletions...tils/chain-spec-builder/tests/input/chain_spec_plain.json
prdoc/pr_4889.prdoc
0 → 100644
This diff is collapsed.
Please register or sign in to comment