Skip to content

Commit

Permalink
fix: BatchUpdated event even if Trove isn't batched
Browse files Browse the repository at this point in the history
  • Loading branch information
danielattilasimon committed Sep 6, 2024
1 parent 65db4b3 commit 5f9b14c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions contracts/src/TroveManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,18 @@ contract TroveManager is LiquityBase, ITroveManager, ITroveEvents {
_collChangeFromOperation: -int256(trove.entireColl)
});

emit BatchUpdated({
_interestBatchManager: batchAddress,
_operation: BatchOperation.exitBatch,
_debt: batches[batchAddress].debt,
_coll: batches[batchAddress].coll,
_annualInterestRate: batch.annualInterestRate,
_annualManagementFee: batch.annualManagementFee,
_totalDebtShares: batches[batchAddress].totalDebtShares,
_debtIncreaseFromUpfrontFee: 0
});
if (isTroveInBatch) {
emit BatchUpdated({
_interestBatchManager: batchAddress,
_operation: BatchOperation.exitBatch,
_debt: batches[batchAddress].debt,
_coll: batches[batchAddress].coll,
_annualInterestRate: batch.annualInterestRate,
_annualManagementFee: batch.annualManagementFee,
_totalDebtShares: batches[batchAddress].totalDebtShares,
_debtIncreaseFromUpfrontFee: 0
});
}
}

// Return the amount of Coll to be drawn from a trove's collateral and sent as gas compensation.
Expand Down

0 comments on commit 5f9b14c

Please sign in to comment.