Skip to content

Commit

Permalink
test: expiredUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlymite committed Sep 29, 2024
1 parent 84f0bb8 commit 6ae780d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/AaveStewardsInjector.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@ contract AaveStewardsInjector_Test is TestnetProcedures {
assertFalse(isAutomationPerformed);
}

function test_expiredUpdate() public {
// add rate update to risk oracle
_addUpdateToRiskOracle();

uint256 initialTs = block.timestamp;
vm.warp(initialTs + _stewardInjector.EXPIRATION_PERIOD());

bool isAutomationPerformed = _checkAndPerformAutomation();
assertFalse(isAutomationPerformed);

vm.warp(initialTs);
isAutomationPerformed = _checkAndPerformAutomation();
assertTrue(isAutomationPerformed);
}

function _addUpdateToRiskOracle() internal {
vm.startPrank(_riskOracleOwner);

Expand Down

0 comments on commit 6ae780d

Please sign in to comment.