You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test.assert(diff<tolerance, message: "Insurance collected should be around \(expectedCollectedAmount) but current \(collectedInsuranceAmount)")
121
+
Test.assert(equalWithinVariance(expectedCollectedAmount, collectedInsuranceAmount, 0.001), message: "Insurance collected should be around \(expectedCollectedAmount) but current \(collectedInsuranceAmount)")
@@ -109,12 +109,6 @@ fun test_collectStability_success_fullAmount() {
109
109
// protocolFee ≈ 29.0656 MOET
110
110
// stabilityAmt = 29.0656 × 0.1 / 0.1 = 29.065637485 MOET (all to stability since insuranceRate=0)
111
111
//
112
-
// NOTE: block timestamps vary slightly between runs, so we use a 0.5 MOET tolerance.
113
-
lettolerance = 0.001
114
112
letexpectedCollectedAmount = 29.065
115
-
letdiff = expectedCollectedAmount>collectedAmount
116
-
?expectedCollectedAmount-collectedAmount
117
-
: collectedAmount-expectedCollectedAmount
118
-
119
-
Test.assert(diff<tolerance, message: "Stability collected should be around \(expectedCollectedAmount) but current \(collectedAmount)")
113
+
Test.assert(equalWithinVariance(expectedCollectedAmount, collectedAmount, 0.001), message: "Stability collected should be around \(expectedCollectedAmount) but current \(collectedAmount)")
0 commit comments