From 1ab66c0e831ce76518ba0059c468e72546c9bcdc Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Fri, 15 Nov 2024 10:45:57 +0100 Subject: [PATCH] fix: processed pools object missing latest assessor --- src/mappings/handlers/ethHandlers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mappings/handlers/ethHandlers.ts b/src/mappings/handlers/ethHandlers.ts index 2f20bcb..b48ba4d 100644 --- a/src/mappings/handlers/ethHandlers.ts +++ b/src/mappings/handlers/ethHandlers.ts @@ -61,7 +61,7 @@ async function _handleEthBlock(block: EthereumBlock): Promise { const latestNavFeed = getLatestContract(tinlakePool.navFeed, blockNumber) const latestReserve = getLatestContract(tinlakePool.reserve, blockNumber) const latestAssessor = getLatestContract(tinlakePool.assessor, blockNumber) - processedPools[pool.id] = { pool, latestNavFeed, latestReserve, tinlakePool } + processedPools[pool.id] = { pool, latestNavFeed, latestReserve, latestAssessor, tinlakePool } // initialize new pool if (!pool.isActive) { @@ -473,7 +473,7 @@ async function getNewLoans(existingLoans: number[], shelfAddress: string) { } function getLatestContract(contractArray: ContractArray[], blockNumber: number) { - if(contractArray.length === 1) return contractArray[0] + if (contractArray.length === 1) return contractArray[0] return contractArray.find((entry) => entry.startBlock! <= blockNumber) }