diff --git a/contracts/src/TroveManager.sol b/contracts/src/TroveManager.sol index bb04bed7..668116e3 100644 --- a/contracts/src/TroveManager.sol +++ b/contracts/src/TroveManager.sol @@ -622,6 +622,19 @@ contract TroveManager is LiquityBase, ITroveManager, ITroveEvents { _collChangeFromOperation: -int256(_singleRedemption.collLot) }); + if (_isTroveInBatch) { + emit BatchUpdated({ + _interestBatchManager: _singleRedemption.batchAddress, + _operation: BatchOperation.troveChange, + _debt: batches[_singleRedemption.batchAddress].debt, + _coll: batches[_singleRedemption.batchAddress].coll, + _annualInterestRate: _singleRedemption.batch.annualInterestRate, + _annualManagementFee: _singleRedemption.batch.annualManagementFee, + _totalDebtShares: batches[_singleRedemption.batchAddress].totalDebtShares, + _debtIncreaseFromUpfrontFee: 0 + }); + } + emit RedemptionFeePaidToTrove(_singleRedemption.troveId, _singleRedemption.collFee); return newDebt; @@ -676,17 +689,6 @@ contract TroveManager is LiquityBase, ITroveManager, ITroveEvents { batch.entireDebtWithoutRedistribution * batch.annualManagementFee; _activePool.mintAggInterestAndAccountForTroveChange(batchTroveChange, _batchAddress); - - emit BatchUpdated({ - _interestBatchManager: _batchAddress, - _operation: BatchOperation.troveChange, - _debt: batch.entireDebtWithoutRedistribution, - _coll: batch.entireCollWithoutRedistribution, - _annualInterestRate: batch.annualInterestRate, - _annualManagementFee: batch.annualManagementFee, - _totalDebtShares: batches[_batchAddress].totalDebtShares, - _debtIncreaseFromUpfrontFee: 0 - }); } /* Send _boldamount Bold to the system and redeem the corresponding amount of collateral from as many Troves as are needed to fill the redemption