diff --git a/src/helpers/processTransactions.ts b/src/helpers/processTransactions.ts index a83e5af0..e3a5ac5e 100644 --- a/src/helpers/processTransactions.ts +++ b/src/helpers/processTransactions.ts @@ -80,7 +80,7 @@ export const getTxDataFromEVMEventLogs = async ( argGetters, logGetters, } = params; - const targetValue = target + const targetValue = target; // if this is ever used, need to also overwrite fromBlock and toBlock const overriddenChain = chain ? chain : chainContractsAreOn; if (isTransfer) { @@ -138,8 +138,11 @@ export const getTxDataFromEVMEventLogs = async ( ).output; //console.log(logs) if (logs.length === 0) { - console.info(`No logs received for ${adapterName} from ${fromBlock} to ${toBlock} with topic ${topic} (${isDeposit ? 'Deposit': 'Withdrawal'}) for ${targetValue}.`); - + console.info( + `No logs received for ${adapterName} from ${fromBlock} to ${toBlock} with topic ${topic} (${ + isDeposit ? "Deposit" : "Withdrawal" + }) for ${targetValue}.` + ); } break; } catch (e) { @@ -158,18 +161,26 @@ export const getTxDataFromEVMEventLogs = async ( .process(async (txLog: any, i) => { data[i] = data[i] || {}; data[i]["isDeposit"] = isDeposit; - await Promise.all(Object.entries(logKeys!).map(async ([eventKey, logKey]) => { - // @ts-ignore - const value = await logGetters?.[eventKey]?.(provider, iface, txLog) || txLog[logKey]; - if (typeof value !== EventKeyTypes[eventKey]) { - throw new Error( - `Type of ${eventKey} retrieved using ${logKey} is ${typeof value} when it must be ${ - EventKeyTypes[eventKey] - }.` - ); - } - data[i][eventKey] = value; - })); + try { + await Promise.all( + Object.entries(logKeys!).map(async ([eventKey, logKey]) => { + // @ts-ignore + const value = (await logGetters?.[eventKey]?.(provider, iface, txLog)) || txLog[logKey]; + if (typeof value !== EventKeyTypes[eventKey]) { + throw new Error( + `Type of ${eventKey} retrieved using ${logKey} is ${typeof value} when it must be ${ + EventKeyTypes[eventKey] + }.` + ); + } + data[i][eventKey] = value; + }) + ); + } catch (e) { + console.error( + `Unable to get log keys for ${adapterName} with log keys ${logKeys}. SKIPPING TX with hash ${txLog.transactionHash} ${chainContractsAreOn}` + ); + } let parsedLog = {} as any; try { parsedLog = iface.parseLog({