Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept relayChain and paraId as alternative spellings #2366

Merged
merged 3 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Added

- The `relay_chain` and `para_id` fields in chain specifications can now alternatively be named respectively `relayChain` and `paraId`. This increases consistency with the other fields of chain specifications, which are all camelCase.

### Fixed

- Fix another panic in case of a carefully-crafted LEB128 length. ([#2337](https://github.com/paritytech/smoldot/pull/2337))
Expand Down
7 changes: 7 additions & 0 deletions src/chain_spec/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ pub(super) struct ClientSpec {
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub(super) struct ChainSpecParachain {
// Note that in Substrate/Cumulus this field is only named `relay_chain` and `relayChain` is
// not accepted (as of 2022-06-09). This seems to be an oversight, as there are only two
// fields that use snake_case while the rest uses camelCase. For this reason, smoldot
// supports both.
#[serde(alias = "relayChain")]
pub(super) relay_chain: String,
// Same remark concerning the name as `relay_chain`
#[serde(alias = "paraId")]
pub(super) para_id: u32,
}

Expand Down