Skip to content

Commit

Permalink
fix: setBatchManagerAnnualInterestRate() breaks SortedTroves orde…
Browse files Browse the repository at this point in the history
…ring

Fixes #359.
  • Loading branch information
danielattilasimon committed Aug 24, 2024
1 parent 2f7a2ef commit aa571dd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions contracts/src/BorrowerOperations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -941,16 +941,14 @@ contract BorrowerOperations is LiquityBase, AddRemoveManagers, IBorrowerOperatio

activePoolCached.mintAggInterestAndAccountForTroveChange(batchChange, msg.sender);

// TODO emit BatchUpdated(msg.sender, batch.entireCollWithoutRedistribution, newDebt, Operation.adjustBatchInterestRate);

troveManagerCached.onSetBatchManagerAnnualInterestRate(
msg.sender, batch.entireCollWithoutRedistribution, newDebt, _newAnnualInterestRate
);

// Check batch is not empty, and then reinsert in sorted list
if (!sortedTroves.isEmptyBatch(BatchId.wrap(msg.sender))) {
sortedTroves.reInsertBatch(BatchId.wrap(msg.sender), _newAnnualInterestRate, _upperHint, _lowerHint);
}

troveManagerCached.onSetBatchManagerAnnualInterestRate(
msg.sender, batch.entireCollWithoutRedistribution, newDebt, _newAnnualInterestRate
);
}

function setInterestBatchManager(
Expand Down

0 comments on commit aa571dd

Please sign in to comment.