Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
46004e3
Add GetParachainInfo to cumulus primitives core
Stephenlawrence00 Feb 12, 2025
aa7623c
fmt
Stephenlawrence00 Apr 1, 2025
ceb6abc
Uses SelfParaId
Stephenlawrence00 Apr 12, 2025
01ff449
on-chain paraid
Stephenlawrence00 Apr 12, 2025
cd03742
configure polkadot-omni-node with runtime generated para_id
Stephenlawrence00 Apr 30, 2025
42cd9bb
Merge branch 'master' of github.com:paritytech/polkadot-sdk into ib-p…
iulianbarbu May 26, 2025
2bf5056
Update cumulus/polkadot-omni-node/lib/src/common/spec.rs
iulianbarbu May 26, 2025
5e629b1
delete files after merge
iulianbarbu May 26, 2025
1b8f6bb
Merge branch 'master' into ib-paraid-api
iulianbarbu May 26, 2025
f61939e
Merge branch 'master' into ib-paraid-api
iulianbarbu May 26, 2025
b690325
simplify parachain id retrieval
iulianbarbu May 28, 2025
173c551
Merge branch 'master' into ib-paraid-api
iulianbarbu May 28, 2025
b89a2de
still parse para id from chain spec for a while
iulianbarbu May 28, 2025
dc7d938
a new round of para-id removal
iulianbarbu May 28, 2025
8d86842
small fixes
iulianbarbu May 28, 2025
5d592d5
some fixes
iulianbarbu May 29, 2025
a242861
Update from github-actions[bot] running command 'prdoc'
github-actions[bot] May 29, 2025
89541f3
Update from github-actions[bot] running command 'fmt'
github-actions[bot] May 29, 2025
da4dd4b
new round of polishing
iulianbarbu May 29, 2025
ef7cc6c
fix prdoc
iulianbarbu May 29, 2025
a8ddeac
more polishgin
iulianbarbu May 29, 2025
169863c
more fixes
iulianbarbu May 29, 2025
600c609
Merge branch 'master' into ib-paraid-api
iulianbarbu May 29, 2025
3a00254
Update from github-actions[bot] running command 'fmt'
github-actions[bot] May 29, 2025
d3e3eb2
ffix clippy
iulianbarbu May 29, 2025
09f85c4
more fixes
iulianbarbu May 29, 2025
b4dcee7
one more round of clippy fixing
iulianbarbu May 30, 2025
9f8abef
more clippy fixing
iulianbarbu May 30, 2025
9cd2617
first runtime is not a parachain, so omni-node shouldn't start it
iulianbarbu May 30, 2025
69709d0
fix test
iulianbarbu May 30, 2025
ebb2405
do not run minimal with omni-node anymore
iulianbarbu May 30, 2025
60e64cf
do not build FIRST_RUNTIME anymore
iulianbarbu May 30, 2025
cf7b9bf
polish first runtime testing
iulianbarbu May 30, 2025
383b85e
impl getparachainidentity for staking runtime
iulianbarbu May 30, 2025
9a93064
polishing minimal template
iulianbarbu May 30, 2025
7af999c
polish
iulianbarbu May 30, 2025
ffa3487
Merge branch 'master' into ib-paraid-api
iulianbarbu May 31, 2025
4cc19f7
fix syntax error
iulianbarbu May 31, 2025
c7b2439
fix markdown
iulianbarbu May 31, 2025
4507d6a
Update from github-actions[bot] running command 'fmt'
github-actions[bot] May 31, 2025
bb8aad8
Update prdoc/pr_8651.prdoc
iulianbarbu Jun 1, 2025
707ef54
Update substrate/bin/utils/chain-spec-builder/README.md
iulianbarbu Jun 1, 2025
ad4bec7
Update substrate/bin/utils/chain-spec-builder/README.docify.md
iulianbarbu Jun 1, 2025
a53df55
Update substrate/frame/staking-async/runtimes/parachain/build-and-run…
iulianbarbu Jun 1, 2025
61019dc
improved polkadot-sdk omni node tests
iulianbarbu Jun 1, 2025
2fbc5ce
parachain-template-node: remove para_id chain spec extension
iulianbarbu Jun 1, 2025
6ab7192
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Jun 2, 2025
3f4664c
fix clippy
iulianbarbu Jun 2, 2025
805453c
fix sdk guides test
iulianbarbu Jun 2, 2025
76800f0
add a note with chain-spec-builder
iulianbarbu Jun 2, 2025
a878c31
fix a few more things
iulianbarbu Jun 2, 2025
cf23e5b
Update templates/parachain/node/src/service.rs
iulianbarbu Jun 2, 2025
8175bc2
fix test
iulianbarbu Jun 2, 2025
90605d6
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 2, 2025
570029c
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 3, 2025
018f86c
Apply suggestions from code review
iulianbarbu Jun 3, 2025
bd6ac0c
improve allow(deprecated) usage
iulianbarbu Jun 3, 2025
24d569d
adjust info about the release when this takes effect
iulianbarbu Jun 3, 2025
a206d48
Update cumulus/polkadot-omni-node/lib/src/common/chain_spec.rs
iulianbarbu Jun 3, 2025
8aef412
polish deprecation comments
iulianbarbu Jun 4, 2025
2b121a7
Update cumulus/polkadot-omni-node/README.md
iulianbarbu Jun 4, 2025
55f9bb2
Update prdoc/pr_8651.prdoc
iulianbarbu Jun 4, 2025
fa991a0
Update prdoc/pr_8651.prdoc
iulianbarbu Jun 4, 2025
ca97051
re-added --para-id flag usage in omni-node-bin docs
iulianbarbu Jun 4, 2025
108d586
addressing michal feedback
iulianbarbu Jun 4, 2025
0af3390
Update cumulus/polkadot-omni-node/lib/src/common/spec.rs
iulianbarbu Jun 4, 2025
32b56d4
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 5, 2025
4b04cd5
Update substrate/bin/utils/chain-spec-builder/src/lib.rs
iulianbarbu Jun 6, 2025
81c2a1b
more updates
iulianbarbu Jun 6, 2025
edff492
still test para_id chain spec field based runtimes
iulianbarbu Jun 6, 2025
19cd9d0
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 8, 2025
fe4b078
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 10, 2025
dac7ca7
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 18, 2025
ab06132
rename trait
iulianbarbu Jun 19, 2025
ac901c9
Update cumulus/polkadot-omni-node/lib/src/common/chain_spec.rs
iulianbarbu Jun 19, 2025
038ccde
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 19, 2025
18de9d7
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Jun 19, 2025
8c228d3
fix test
iulianbarbu Jun 19, 2025
d520d37
fix test
iulianbarbu Jun 19, 2025
83f753d
Update cumulus/polkadot-omni-node/lib/src/common/chain_spec.rs
iulianbarbu Jun 19, 2025
b5d76b1
update prdoc
iulianbarbu Jun 19, 2025
f8d1189
reorder impl position
iulianbarbu Jun 20, 2025
5134c6e
specify that nodes generated chain specs
iulianbarbu Jun 20, 2025
88d526a
rename to GetParachainInfo
iulianbarbu Jun 20, 2025
e6f905b
fix prdoc
iulianbarbu Jun 20, 2025
ada6fd6
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Jun 20, 2025
3837380
Update pr_8651.prdoc
iulianbarbu Jun 20, 2025
354189d
Update pr_8651.prdoc
iulianbarbu Jun 20, 2025
e7fb49f
Update pr_8651.prdoc
iulianbarbu Jun 20, 2025
8f89a80
Merge branch 'master' into ib-paraid-api
iulianbarbu Jun 21, 2025
74563a8
fix sdk docs tests
iulianbarbu Jun 21, 2025
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
8 changes: 2 additions & 6 deletions .github/workflows/misc-sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ jobs:
srtool build --package ${{ matrix.package_name }} --runtime-dir ${{ matrix.runtime_path }} --root

# Generate chain spec
# Note that para-id is set to 1000 for both minimal/parachain templates.
# `parachain-runtime` is hardcoded to use this parachain id.
# `minimal` template isn't using it, but when started with Omni Node, this para id is required (any number can do it, so setting it to 1000 for convenience).
chain-spec-builder -c dev_chain_spec.json create \
--relay-chain "${{ matrix.relay_chain }}" \
--para-id 1000 \
--runtime "${{ matrix.runtime_path }}/target/srtool/release/wbuild/${{ matrix.runtime_wasm_path }}" \
named-preset development

Expand Down Expand Up @@ -162,9 +158,9 @@ jobs:
[workspace]
EOF

[ ${{ matrix.template }} != "solochain" ] && echo "# Leave out the node compilation from regular template usage." \
[ ${{ matrix.template }} == "parachain" ] && echo "# Leave out the node compilation from regular template usage." \
&& echo "default-members = [\"pallets/template\", \"runtime\"]" >> Cargo.toml
[ ${{ matrix.template }} == "solochain" ] && echo "# The node isn't yet replaceable by Omni Node."
[ ${{ matrix.template }} != "parachain" ] && echo "# The node isn't yet replaceable by Omni Node."
cat << EOF >> Cargo.toml
members = [
"node",
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,12 @@ impl_runtime_apis! {
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}

impl xcm_runtime_apis::authorized_aliases::AuthorizedAliasersApi<Block> for Runtime {
fn authorized_aliasers(target: VersionedLocation) -> Result<
Vec<xcm_runtime_apis::authorized_aliases::OriginAliaser>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

#[cfg(test)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,12 @@ impl_runtime_apis! {
genesis_config_presets::preset_names()
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,12 @@ impl_runtime_apis! {
genesis_config_presets::preset_names()
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,12 @@ impl_runtime_apis! {
genesis_config_presets::preset_names()
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use sp_runtime::{
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;

use cumulus_primitives_core::{AggregateMessageOrigin, ClaimQueueOffset, CoreSelector};
use cumulus_primitives_core::{AggregateMessageOrigin, ClaimQueueOffset, CoreSelector, ParaId};
pub use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
Expand Down Expand Up @@ -510,6 +510,12 @@ impl_runtime_apis! {
genesis_config_presets::preset_names()
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
6 changes: 6 additions & 0 deletions cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,12 @@ impl_runtime_apis! {
PolkadotXcm::is_trusted_teleporter(asset, location)
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
6 changes: 6 additions & 0 deletions cumulus/parachains/runtimes/people/people-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,12 @@ impl_runtime_apis! {
genesis_config_presets::preset_names()
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
6 changes: 6 additions & 0 deletions cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,12 @@ impl_runtime_apis! {
genesis_config_presets::preset_names()
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,12 @@ impl_runtime_apis! {
ParachainSystem::core_selector()
}
}

impl cumulus_primitives_core::GetParachainInfo<Block> for Runtime {
fn parachain_id() -> ParaId {
ParachainInfo::parachain_id()
}
}
}

cumulus_pallet_parachain_system::register_validate_block! {
Expand Down
2 changes: 1 addition & 1 deletion cumulus/polkadot-omni-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true
color-eyre = { workspace = true }

# Local
polkadot-omni-node-lib = { workspace = true }
polkadot-omni-node-lib = { workspace = true, features = ["rococo-native", "westend-native"] }

[dev-dependencies]
assert_cmd = { workspace = true }
Expand Down
17 changes: 14 additions & 3 deletions cumulus/polkadot-omni-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,20 @@ cargo install staging-chain-spec-builder --locked

### 2. Generate a chain spec

Omni Node expects for the chain spec to contain parachains related fields like `relay_chain` and `para_id`.
These fields can be introduced by running [`staging-chain-spec-builder`](https://crates.io/crates/staging-chain-spec-builder)
with additional flags:
Omni Node requires the chain spec to include a JSON key named `relay_chain`. It is set to a chain id,
representing the chain name, e.g. `westend`, `paseo`, `rococo`, `polkadot`, or `kusama`, but
there are also local variants that can be used for testing, like `rococo-local` or `westend-local`. The
local variants are available only for a build of `polkadot-omni-node` with
`westend-native` and `rococo-native` features respectively.

<!-- TODO: https://github.com/paritytech/polkadot-sdk/issues/8747 -->
<!-- TODO: https://github.com/paritytech/polkadot-sdk/issues/8740 -->
Additionaly, although deprecated, the `--para-id` flag can still be used to set the JSON key named
`para_id`. The removal of the flag will happen starting with `stable2512`. The alternative of not using
it is to implement the `cumulus_primitives_core::GetParachainInfo` runtime API for the runtime, and
upgrade it on-chain as well, to be compatible with nodes released starting with `stable2512`.

Example command bellow:

```bash
chain-spec-builder create --relay-chain <relay_chain_id> --para-id <id> -r <runtime.wasm> named-preset <preset_name>
Expand Down
22 changes: 3 additions & 19 deletions cumulus/polkadot-omni-node/lib/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use crate::{
cli::{Cli, RelayChainCli, Subcommand},
common::{
chain_spec::{Extensions, LoadSpec},
chain_spec::LoadSpec,
runtime::{
AuraConsensusId, Consensus, Runtime, RuntimeResolver as RuntimeResolverT,
RuntimeResolver,
Expand All @@ -33,11 +33,9 @@ use crate::{
use clap::{CommandFactory, FromArgMatches};
#[cfg(feature = "runtime-benchmarks")]
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
use sc_cli::{CliConfiguration, Result, SubstrateCli};
use sp_runtime::traits::AccountIdConversion;
#[cfg(feature = "runtime-benchmarks")]
use sp_runtime::traits::HashingFor;

Expand Down Expand Up @@ -304,24 +302,19 @@ where
runner.run_node_until_exit(|config| async move {
let node_spec =
new_node_spec(&config, &cmd_config.runtime_resolver, &cli.node_extra_args())?;
let para_id = ParaId::from(
Extensions::try_get(&*config.chain_spec)
.map(|e| e.para_id)
.ok_or("Could not find parachain extension in chain-spec.")?,
);

if cli.run.base.is_dev()? {
// Set default dev block time to 3000ms if not set.
// TODO: take block time from AURA config if set.
let dev_block_time = cli.dev_block_time.unwrap_or(DEFAULT_DEV_BLOCK_TIME_MS);
return node_spec
.start_manual_seal_node(config, para_id, dev_block_time)
.start_manual_seal_node(config, dev_block_time)
.map_err(Into::into);
}

if let Some(dev_block_time) = cli.dev_block_time {
return node_spec
.start_manual_seal_node(config, para_id, dev_block_time)
.start_manual_seal_node(config, dev_block_time)
.map_err(Into::into);
}

Expand Down Expand Up @@ -375,27 +368,18 @@ where
})
})
.flatten();

let parachain_account =
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(
&para_id,
);

let tokio_handle = config.tokio_handle.clone();
let polkadot_config =
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle)
.map_err(|err| format!("Relay chain argument error: {}", err))?;

info!("🪪 Parachain id: {:?}", para_id);
info!("🧾 Parachain Account: {}", parachain_account);
info!("✍️ Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });

node_spec
.start_node(
config,
polkadot_config,
collator_options,
para_id,
hwbench,
cli.node_extra_args(),
)
Expand Down
54 changes: 47 additions & 7 deletions cumulus/polkadot-omni-node/lib/src/common/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct DiskChainSpecLoader;

impl LoadSpec for DiskChainSpecLoader {
fn load_spec(&self, path: &str) -> Result<Box<dyn ChainSpec>, String> {
Ok(Box::new(GenericChainSpec::from_json_file(path.into())?))
Ok(Box::new(DeprecatedGenericChainSpec::from_json_file(path.into())?))
}
}

Expand All @@ -42,12 +42,35 @@ pub struct Extensions {
/// The relay chain of the Parachain.
#[serde(alias = "relayChain", alias = "RelayChain")]
pub relay_chain: String,
}

impl Extensions {
/// Try to get the extension from the given `ChainSpec`.
pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {
sc_chain_spec::get_extension(chain_spec.extensions())
}
}

/// Generic extensions for Parachain ChainSpecs used for extracting the extensions from chain specs.
/// This is also used only while `para_id` is around the corner.
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8747
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8740
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecExtension)]
pub struct DeprecatedExtensions {
/// The relay chain of the Parachain. It is kept here only for compatibility reasons until
/// people migrate to using the new `Extensions` struct and associated logic in the node
/// corresponding to pulling the parachain id from the runtime.
#[serde(alias = "relayChain", alias = "RelayChain")]
pub relay_chain: String,
/// The id of the Parachain.
#[serde(alias = "paraId", alias = "ParaId")]
pub para_id: u32,
#[deprecated(
note = "The para_id information is not required anymore and will be removed starting with `stable2512`. Runtimes must implement a new API called `cumulus_primitives_core::GetParachainInfo` to still be compatible with node versions starting with `stable2512`."
)]
pub para_id: Option<u32>,
}

impl Extensions {
impl DeprecatedExtensions {
Comment thread
iulianbarbu marked this conversation as resolved.
/// Try to get the extension from the given `ChainSpec`.
pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {
sc_chain_spec::get_extension(chain_spec.extensions())
Expand All @@ -56,6 +79,12 @@ impl Extensions {

/// Generic chain spec for all polkadot-parachain runtimes
pub type GenericChainSpec = sc_service::GenericChainSpec<Extensions>;
/// Generic chain spec which keeps chain spec loading compatible for those who provide
/// `para_id` extension instead of implementing the runtime API
/// `cumulus_primitives_core::GetParachainInfo`.
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8747
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8740
pub type DeprecatedGenericChainSpec = sc_service::GenericChainSpec<DeprecatedExtensions>;

#[cfg(test)]
mod tests {
Expand All @@ -66,12 +95,23 @@ mod tests {
let camel_case = r#"{"relayChain":"relay","paraId":1}"#;
let snake_case = r#"{"relay_chain":"relay","para_id":1}"#;
let pascal_case = r#"{"RelayChain":"relay","ParaId":1}"#;
let para_id_missing = r#"{"RelayChain":"westend"}"#;

let camel_case_extension: Extensions = serde_json::from_str(camel_case).unwrap();
let snake_case_extension: Extensions = serde_json::from_str(snake_case).unwrap();
let pascal_case_extension: Extensions = serde_json::from_str(pascal_case).unwrap();

let camel_case_extension: DeprecatedExtensions = serde_json::from_str(camel_case).unwrap();
let snake_case_extension: DeprecatedExtensions = serde_json::from_str(snake_case).unwrap();
let pascal_case_extension: DeprecatedExtensions =
serde_json::from_str(pascal_case).unwrap();
let missing_paraid_extension: Extensions = serde_json::from_str(para_id_missing).unwrap();
let missing_paraid_deprecated: DeprecatedExtensions =
serde_json::from_str(para_id_missing).unwrap();
assert_eq!(camel_case_extension, snake_case_extension);
assert_eq!(snake_case_extension, pascal_case_extension);
assert_eq!(missing_paraid_extension.relay_chain, "westend".to_string());

// TODO: remove it once `para_id` is removed: https://github.com/paritytech/polkadot-sdk/issues/8740
assert_eq!(missing_paraid_deprecated.relay_chain, "westend".to_string());
#[allow(deprecated)]
let test = missing_paraid_deprecated.para_id.is_none();
assert!(test);
}
}
Loading
Loading