Skip to content
Merged
Changes from all 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
15 changes: 11 additions & 4 deletions javascript/packages/orchestrator/src/chainSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,11 @@ export async function addParachainToGenesis(
else if (runtimeConfig.parachainsParas) {
paras = runtimeConfig.parachainsParas.paras;
}
// The config may not contain paras. Since chainspec allows to contain the RuntimeGenesisConfig patch we can inject it.
else {
runtimeConfig.paras = { paras: [] };
paras = runtimeConfig.paras.paras;
}
if (paras) {
const new_para = [
parseInt(para_id),
Expand Down Expand Up @@ -622,11 +627,13 @@ function findAndReplaceConfig(obj1: any, obj2: any) {
}

export function getRuntimeConfig(chainSpec: any) {
const runtimeConfig =
// 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.runtime?.runtime_genesis_config ||
chainSpec.genesis.runtime;

return runtimeConfig;
chainSpec.genesis.runtime
);
}

export function readAndParseChainSpec(specPath: string) {
Expand Down