Skip to content

Commit

Permalink
test: fix invariant tests after urgent redemption changes
Browse files Browse the repository at this point in the history
We're no longer touching Troves with zero debt.
  • Loading branch information
danielattilasimon committed Oct 23, 2024
1 parent 4c68a01 commit 17da34a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/src/test/TestContracts/InvariantsTestHandler.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2728,11 +2728,14 @@ contract InvariantsTestHandler is BaseHandler, BaseMultiCollateralTest {

for (uint256 j = 0; j < r.batch.length; ++j) {
uint256 troveId = _troveIdOf(i, r.batch[j]);
if (!_troveIds[i].has(troveId)) continue; // skip non-existent Trove

if (r.redeemedIds.has(troveId)) continue; // skip duplicate entry
r.redeemedIds.add(troveId);

LatestTroveData memory trove = branches[i].troveManager.getLatestTroveData(troveId);
if (trove.entireDebt == 0) continue; // nothing to redeem

uint256 debtRedeemed = Math.min(amount, trove.entireDebt);
uint256 collRedeemed = debtRedeemed * (DECIMAL_PRECISION + URGENT_REDEMPTION_BONUS) / _price[i];

Expand Down

0 comments on commit 17da34a

Please sign in to comment.