From ff7462367927f8c1c8a4e5f3c7c20fd1dd097473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Molina?= Date: Wed, 21 Aug 2024 15:47:39 +0200 Subject: [PATCH] Adapt local-v and mainnet-local-v to collatorStaking --- .../packages/orchestrator/src/chain-decorators/local-v.ts | 8 ++------ .../orchestrator/src/chain-decorators/mainnet-local-v.ts | 5 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/javascript/packages/orchestrator/src/chain-decorators/local-v.ts b/javascript/packages/orchestrator/src/chain-decorators/local-v.ts index 945bee69d..01b280a90 100644 --- a/javascript/packages/orchestrator/src/chain-decorators/local-v.ts +++ b/javascript/packages/orchestrator/src/chain-decorators/local-v.ts @@ -54,14 +54,10 @@ export async function addCollatorSelection(specPath: string, node: Node) { try { const chainSpec = readAndParseChainSpec(specPath); const runtimeConfig = getRuntimeConfig(chainSpec); - if (!runtimeConfig?.collatorSelection?.invulnerables) return; - const { eth_account } = node.accounts; - if (runtimeConfig.collatorSelection) - runtimeConfig.collatorSelection.invulnerables.push(eth_account.address); - if (runtimeConfig.collatorStaking) - runtimeConfig.collatorStaking.invulnerables.push(eth_account.address); + runtimeConfig?.collatorSelection?.invulnerables?.push(eth_account.address); + runtimeConfig?.collatorStaking?.invulnerables?.push(eth_account.address); new CreateLogTable({ colWidths: [30, 20, 70], diff --git a/javascript/packages/orchestrator/src/chain-decorators/mainnet-local-v.ts b/javascript/packages/orchestrator/src/chain-decorators/mainnet-local-v.ts index b5668f4b4..01b280a90 100644 --- a/javascript/packages/orchestrator/src/chain-decorators/mainnet-local-v.ts +++ b/javascript/packages/orchestrator/src/chain-decorators/mainnet-local-v.ts @@ -54,11 +54,10 @@ export async function addCollatorSelection(specPath: string, node: Node) { try { const chainSpec = readAndParseChainSpec(specPath); const runtimeConfig = getRuntimeConfig(chainSpec); - if (!runtimeConfig?.collatorSelection?.invulnerables) return; - const { eth_account } = node.accounts; - runtimeConfig.collatorSelection.invulnerables.push(eth_account.address); + runtimeConfig?.collatorSelection?.invulnerables?.push(eth_account.address); + runtimeConfig?.collatorStaking?.invulnerables?.push(eth_account.address); new CreateLogTable({ colWidths: [30, 20, 70],