Skip to content

Commit

Permalink
chainSpec: runtime genesis layout updated (#1469)
Browse files Browse the repository at this point in the history
* chainSpec: runtime genesis layout updated

* fix
  • Loading branch information
michalkucharczyk authored Nov 5, 2023
1 parent ec51855 commit 771fe7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion javascript/packages/orchestrator/src/chainSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@ export function getRuntimeConfig(chainSpec: any) {
// runtime_genesis_config is no longer in ChainSpec after rococo runtime rework (refer to: https://github.com/paritytech/polkadot-sdk/pull/1256)
// ChainSpec may contain a RuntimeGenesisConfigPatch
return (
chainSpec.genesis.runtimeGenesisConfigPatch ||
chainSpec.genesis.runtimeGenesis?.config ||
chainSpec.genesis.runtimeGenesis?.patch ||
chainSpec.genesis.runtime?.runtime_genesis_config ||
chainSpec.genesis.runtime
);
Expand Down
9 changes: 7 additions & 2 deletions javascript/packages/orchestrator/src/paras.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ export async function generateParachainFiles(
if (plainData.genesis.runtime?.parachainInfo?.parachainId)
plainData.genesis.runtime.parachainInfo.parachainId = parachain.id;
else if (
plainData.genesis.runtimeGenesisConfigPatch?.parachainInfo?.parachainId
plainData.genesis.runtimeGenesis?.patch?.parachainInfo?.parachainId
)
plainData.genesis.runtimeGenesisConfigPatch.parachainInfo.parachainId =
plainData.genesis.runtimeGenesis.patch.parachainInfo.parachainId =
parachain.id;
else if (
plainData.genesis.runtimeGenesis?.config?.parachainInfo?.parachainId
)
plainData.genesis.runtimeGenesis.config.parachainInfo.parachainId =
parachain.id;

writeChainSpec(chainSpecFullPathPlain, plainData);
Expand Down

0 comments on commit 771fe7d

Please sign in to comment.