Skip to content

Commit c6c8350

Browse files
committed
test: assert minimum health after undercollateralised rebalance
Per PR review, add assertion that health after rebalance is at least 1.1 (minimum threshold) to ensure protocol rebalances positions to a safe state.
1 parent 27ed50e commit c6c8350

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cadence/tests/rebalance_undercollateralised_test.cdc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,8 @@ fun testRebalanceUndercollateralised() {
107107
log("Required paydown: ".concat(requiredPaydown.toString()))
108108
log("Expected debt: ".concat(expectedDebt.toString()))
109109
log("Actual debt: ".concat(actualDebt.toString()))
110+
111+
// Ensure health is at least the minimum threshold (1.1)
112+
Test.assert(healthAfterRebalance >= 1.1,
113+
message: "Health after rebalance should be at least the minimum (1.1) but was ".concat(healthAfterRebalance.toString()))
110114
}

0 commit comments

Comments
 (0)