From 8bfa8c13cc1125eea85fab9b32058ddd9d6a5076 Mon Sep 17 00:00:00 2001 From: Paul Balaji Date: Mon, 5 Feb 2024 17:50:21 +0000 Subject: [PATCH] fix: agent config artifact includes only chains user deployed to (#3223) --- typescript/cli/src/deploy/core.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/typescript/cli/src/deploy/core.ts b/typescript/cli/src/deploy/core.ts index 6295632aca..14617f9b83 100644 --- a/typescript/cli/src/deploy/core.ts +++ b/typescript/cli/src/deploy/core.ts @@ -472,18 +472,20 @@ async function writeAgentConfig( multiProvider: MultiProvider, ) { const startBlocks: ChainMap = {}; + const core = HyperlaneCore.fromAddressesMap(artifacts, multiProvider); + for (const chain of chains) { - const core = HyperlaneCore.fromAddressesMap(artifacts, multiProvider); const mailbox = core.getContracts(chain).mailbox; startBlocks[chain] = (await mailbox.deployedBlock()).toNumber(); } + const mergedAddressesMap = objMerge( sdkContractAddressesMap, artifacts, ) as ChainMap; const agentConfig = buildAgentConfig( - Object.keys(mergedAddressesMap), + chains, // Use only the chains that were deployed to multiProvider, mergedAddressesMap, startBlocks,