|
|
@@ -401,7 +401,7 @@ contract PulseTest is Test, PulseEvents {
|
|
|
function testExecuteCallbackWithFutureTimestamp() public {
|
|
|
// Setup request with future timestamp
|
|
|
bytes32[] memory priceIds = createPriceIds();
|
|
|
- uint256 futureTime = block.timestamp + 1 days;
|
|
|
+ uint256 futureTime = block.timestamp + 10; // 10 seconds in future
|
|
|
vm.deal(address(consumer), 1 gwei);
|
|
|
|
|
|
uint128 totalFee = calculateTotalFee();
|
|
|
@@ -434,6 +434,22 @@ contract PulseTest is Test, PulseEvents {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ function testRevertOnTooFarFutureTimestamp() public {
|
|
|
+ bytes32[] memory priceIds = createPriceIds();
|
|
|
+ uint256 farFutureTime = block.timestamp + 61; // Just over 1 minute
|
|
|
+ vm.deal(address(consumer), 1 gwei);
|
|
|
+
|
|
|
+ uint128 totalFee = calculateTotalFee();
|
|
|
+ vm.prank(address(consumer));
|
|
|
+
|
|
|
+ vm.expectRevert("Too far in future");
|
|
|
+ pulse.requestPriceUpdatesWithCallback{value: totalFee}(
|
|
|
+ farFutureTime,
|
|
|
+ priceIds,
|
|
|
+ CALLBACK_GAS_LIMIT
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
function testDoubleExecuteCallback() public {
|
|
|
(
|
|
|
uint64 sequenceNumber,
|