Skip to content

Commit

Permalink
Merge pull request #247 from euler-xyz/fix-invariants-tests
Browse files Browse the repository at this point in the history
fix invariant_totalAssetsShouldBeEqualToBalanceAfterSMEAR
  • Loading branch information
dglowinski authored May 27, 2024
2 parents 6215d49 + 663b9f5 commit ba6e4fb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/unit/esr/ESR.Fuzz.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ contract ESRFuzzTest is ESRTest {
assertGe(esrSlot.interestLeft, accruedInterest);
}

// totalAssets should be equal to the balance after SMEAR has passed
// function invariant_totalAssetsShouldBeEqualToBalanceAfterSMEAR() public {
// vm.assume(asset.balanceOf(address(esr)) <= type(uint168).max);
// esr.gulp();
// skip(esr.INTEREST_SMEAR()); // make sure smear has passed
// assertEq(esr.totalAssets(), asset.balanceOf(address(esr)));
// }
//totalAssets should be equal to the balance after SMEAR has passed
function invariant_totalAssetsShouldBeEqualToBalanceAfterSMEAR() public {
vm.assume(asset.balanceOf(address(esr)) <= type(uint168).max);
if (asset.balanceOf(address(esr)) == 0) return;
esr.gulp();
skip(esr.INTEREST_SMEAR()); // make sure smear has passed
assertEq(esr.totalAssets(), asset.balanceOf(address(esr)));
}

function testFuzz_interestAccrued_under_uint168(uint256 interestAmount, uint256 depositAmount, uint256 timePassed)
public
Expand Down

0 comments on commit ba6e4fb

Please sign in to comment.