From 76cda01ee1aeab21509503eba37259016d7b9c12 Mon Sep 17 00:00:00 2001 From: smart_ex Date: Mon, 18 Apr 2022 18:40:41 +1000 Subject: [PATCH] validate only selected network contract addresses --- src/utils.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/utils.js b/src/utils.js index 78d2dbd..525b3c9 100644 --- a/src/utils.js +++ b/src/utils.js @@ -11,18 +11,17 @@ const TOKENS = { } const addressMap = new Map() -for (const [key, value] of Object.entries(instances)) { - const netId = Number(key.substring(5)) - for (const [currency, { instanceAddress, symbol, decimals }] of Object.entries(value)) { - Object.entries(instanceAddress).forEach(([amount, address]) => - addressMap.set(`${netId}_${address}`, { - currency, - amount, - symbol, - decimals, - }), - ) - } +const instance = instances[`netId${netId}`] + +for (const [currency, { instanceAddress, symbol, decimals }] of Object.entries(instance)) { + Object.entries(instanceAddress).forEach(([amount, address]) => + addressMap.set(`${netId}_${address}`, { + currency, + amount, + symbol, + decimals, + }), + ) } const sleep = ms => new Promise(res => setTimeout(res, ms))