Skip to content

Commit

Permalink
Accept relayChain and paraId as alternative spellings (#2366)
Browse files Browse the repository at this point in the history
* Accept relayChain and paraId as alternative spellings

* brings -> increases

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
tomaka and mergify[bot] authored Jun 9, 2022
1 parent ed966fa commit ce5a66c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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

0 comments on commit ce5a66c

Please sign in to comment.