From 83b5bb57875f768612fc0c1d4413d8262611ed64 Mon Sep 17 00:00:00 2001 From: vrtnd Date: Thu, 24 Aug 2023 16:11:14 +0300 Subject: [PATCH] fix aggregate custom chain mappings --- src/utils/aggregate.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/aggregate.ts b/src/utils/aggregate.ts index a4b3bcea..7f5c9eef 100644 --- a/src/utils/aggregate.ts +++ b/src/utils/aggregate.ts @@ -118,7 +118,9 @@ export const runAggregateDataAllAdapters = async (timestamp: number, hourly: boo const chainsPromises = Promise.all( chains.map(async (chain) => { try { - await aggregateData(timestamp, bridgeDbName, chain, hourly, largeTxThreshold); + let chainContractsAreOn = bridgeNetwork.chainMapping?.[chain] ? bridgeNetwork.chainMapping?.[chain] : chain; + chainContractsAreOn = chainContractsAreOn === "avax" ? "avalanche" : chainContractsAreOn; + await aggregateData(timestamp, bridgeDbName, chainContractsAreOn, hourly, largeTxThreshold); } catch (e) { const errString = `Unable to aggregate hourly data for ${bridgeDbName} on chain ${chain}, skipping.`; await insertErrorRow({