File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
target_chains/ethereum/contracts/forge-test Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ contract PulseTest is Test, PulseEvents {
401401 function testExecuteCallbackWithFutureTimestamp () public {
402402 // Setup request with future timestamp
403403 bytes32 [] memory priceIds = createPriceIds ();
404- uint256 futureTime = block .timestamp + 1 days ;
404+ uint256 futureTime = block .timestamp + 10 ; // 10 seconds in future
405405 vm.deal (address (consumer), 1 gwei);
406406
407407 uint128 totalFee = calculateTotalFee ();
@@ -434,6 +434,22 @@ contract PulseTest is Test, PulseEvents {
434434 }
435435 }
436436
437+ function testRevertOnTooFarFutureTimestamp () public {
438+ bytes32 [] memory priceIds = createPriceIds ();
439+ uint256 farFutureTime = block .timestamp + 61 ; // Just over 1 minute
440+ vm.deal (address (consumer), 1 gwei);
441+
442+ uint128 totalFee = calculateTotalFee ();
443+ vm.prank (address (consumer));
444+
445+ vm.expectRevert ("Too far in future " );
446+ pulse.requestPriceUpdatesWithCallback {value: totalFee}(
447+ farFutureTime,
448+ priceIds,
449+ CALLBACK_GAS_LIMIT
450+ );
451+ }
452+
437453 function testDoubleExecuteCallback () public {
438454 (
439455 uint64 sequenceNumber ,
You can’t perform that action at this time.
0 commit comments