From 6260fa2bc3f829a9cf412941795f9fe7ba951e13 Mon Sep 17 00:00:00 2001 From: Fazleiw <156914529+Fazleiw@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:19:46 +0700 Subject: [PATCH] Update warp.ts --- typescript/cli/src/check/warp.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/typescript/cli/src/check/warp.ts b/typescript/cli/src/check/warp.ts index a31fac62e..d92a67e14 100644 --- a/typescript/cli/src/check/warp.ts +++ b/typescript/cli/src/check/warp.ts @@ -15,9 +15,10 @@ export async function runWarpRouteCheck({ onChainWarpConfig: WarpRouteDeployConfig; }): Promise { // Go through each chain and only add to the output the chains that have mismatches - const [violations, isInvalid] = Object.keys(warpRouteConfig).reduce( - (acc, chain) => { - const { mergedObject, isInvalid } = diffObjMerge( + const violations: { [key: string]: ObjectDiff } = {}; // Improved: Declared a specific type for violations + let isInvalid = false; // Improved: Initialized isInvalid separately + for (const chain of Object.keys(warpRouteConfig)) { + const { mergedObject, isInvalid: currentIsInvalid } = diffObjMerge( normalizeConfig(onChainWarpConfig[chain]), normalizeConfig(warpRouteConfig[chain]), );