Skip to content

Commit

Permalink
fix: processed pools object missing latest assessor
Browse files Browse the repository at this point in the history
  • Loading branch information
hieronx committed Nov 15, 2024
1 parent 5367606 commit 1ab66c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mappings/handlers/ethHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function _handleEthBlock(block: EthereumBlock): Promise<void> {
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) {
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 1ab66c0

Please sign in to comment.