Skip to content

Commit

Permalink
removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNoepel committed Sep 11, 2023
1 parent bb2e4ec commit 7fa5cd9
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/mappings/base/base-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,31 +630,23 @@ export function _handleBucketBankruptcy(event: ethereum.Event, index: BigInt, lp
// iterate through all bucket lends and set lend.lpb to zero
for (let i = 0; i < bucket.lends.length; i++) {
const lendId = bucket.lends[i]
log.info("_handleBucketBankruptcy loading lend {}", [lendId.toHexString()])
const lend = Lend.load(lendId)!
lend.lpb = ZERO_BD
log.info("_handleBucketBankruptcy upadating bucket lends for {}", [lend.lender.toHexString()])
updateBucketLends(bucket, lend)
log.info("_handleBucketBankruptcy upadating account lends for {}", [lend.lender.toHexString()])
updateAccountLends(loadOrCreateAccount(lend.lender), lend)
// remove lend from store
log.info("_handleBucketBankruptcy calling saveOrRemoveLend for {}", [lend.lender.toHexString()])
saveOrRemoveLend(lend)
}

// iterate through all bucket positionLends and set positionLend.lpb to zero
log.info("_handleBucketBankruptcy bucket has {} positionLends", [bucket.positionLends.length.toString()])
for (let i = 0; i < bucket.positionLends.length; i++) {
const positionLendId = bucket.positionLends[i]
log.info("_handleBucketBankruptcy loading positionLend {}", [positionLendId.toHexString()])
const positionLend = PositionLend.load(positionLendId)!
positionLend.lpb = ZERO_BD
log.info("_handleBucketBankruptcy calling saveOrRemovePositionLend for token {}", [positionLend.tokenId.toString()])
saveOrRemovePositionLend(positionLend)
}

// save entities to store
log.info("_handleBucketBankruptcy saving entities", [])
pool.save()
bucket.save()
bucketBankruptcy.save()
Expand Down

0 comments on commit 7fa5cd9

Please sign in to comment.