From 6ae780d2136945de96cd19fce554073ee8d26945 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Sun, 29 Sep 2024 16:00:50 +0530 Subject: [PATCH] test: expiredUpdate --- tests/AaveStewardsInjector.t.sol | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/AaveStewardsInjector.t.sol b/tests/AaveStewardsInjector.t.sol index 46e6150..4a04f3b 100644 --- a/tests/AaveStewardsInjector.t.sol +++ b/tests/AaveStewardsInjector.t.sol @@ -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);