|
|
@@ -248,7 +248,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
numInitialFeeds
|
|
|
);
|
|
|
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, initialPriceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, initialPriceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(initialPriceFeeds);
|
|
|
|
|
|
vm.prank(pusher);
|
|
|
@@ -822,7 +822,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
priceIds.length
|
|
|
);
|
|
|
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds1, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds1, slots);
|
|
|
bytes[] memory updateData1 = createMockUpdateData(priceFeeds1);
|
|
|
|
|
|
// Perform first update
|
|
|
@@ -873,7 +873,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
priceFeeds2[i].emaPrice.publishTime = publishTime2;
|
|
|
}
|
|
|
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds2, slots); // Mock for the second call
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds2, slots); // Mock for the second call
|
|
|
bytes[] memory updateData2 = createMockUpdateData(priceFeeds2);
|
|
|
|
|
|
// Perform second update
|
|
|
@@ -934,7 +934,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
);
|
|
|
|
|
|
uint256 mockPythFee = MOCK_PYTH_FEE_PER_FEED * params.priceIds.length;
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
|
|
|
// Get state before
|
|
|
@@ -1019,7 +1019,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
priceIds.length
|
|
|
);
|
|
|
uint256 mockPythFee = MOCK_PYTH_FEE_PER_FEED * priceIds.length;
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
|
|
|
// Calculate minimum keeper fee (overhead + feed-specific fee)
|
|
|
@@ -1078,7 +1078,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
PythStructs.PriceFeed[] memory priceFeeds1;
|
|
|
uint64[] memory slots1;
|
|
|
(priceFeeds1, slots1) = createMockPriceFeedsWithSlots(publishTime1, 2);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds1, slots1);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds1, slots1);
|
|
|
bytes[] memory updateData1 = createMockUpdateData(priceFeeds1);
|
|
|
vm.prank(pusher);
|
|
|
scheduler.updatePriceFeeds(subscriptionId, updateData1, priceIds);
|
|
|
@@ -1089,7 +1089,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
PythStructs.PriceFeed[] memory priceFeeds2;
|
|
|
uint64[] memory slots2;
|
|
|
(priceFeeds2, slots2) = createMockPriceFeedsWithSlots(publishTime2, 2);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds2, slots2);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds2, slots2);
|
|
|
bytes[] memory updateData2 = createMockUpdateData(priceFeeds2);
|
|
|
|
|
|
// Expect revert because heartbeat condition is not met
|
|
|
@@ -1126,7 +1126,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
PythStructs.PriceFeed[] memory priceFeeds1;
|
|
|
uint64[] memory slots;
|
|
|
(priceFeeds1, slots) = createMockPriceFeedsWithSlots(publishTime1, 2);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds1, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds1, slots);
|
|
|
bytes[] memory updateData1 = createMockUpdateData(priceFeeds1);
|
|
|
vm.prank(pusher);
|
|
|
scheduler.updatePriceFeeds(subscriptionId, updateData1, priceIds);
|
|
|
@@ -1152,7 +1152,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
priceFeeds2[i].price.publishTime = publishTime2;
|
|
|
}
|
|
|
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds2, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds2, slots);
|
|
|
bytes[] memory updateData2 = createMockUpdateData(priceFeeds2);
|
|
|
|
|
|
// Expect revert because deviation condition is not met
|
|
|
@@ -1178,7 +1178,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
PythStructs.PriceFeed[] memory priceFeeds1;
|
|
|
uint64[] memory slots1;
|
|
|
(priceFeeds1, slots1) = createMockPriceFeedsWithSlots(publishTime1, 2);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds1, slots1);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds1, slots1);
|
|
|
bytes[] memory updateData1 = createMockUpdateData(priceFeeds1);
|
|
|
|
|
|
vm.prank(pusher);
|
|
|
@@ -1190,7 +1190,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
uint64[] memory slots2;
|
|
|
(priceFeeds2, slots2) = createMockPriceFeedsWithSlots(publishTime2, 2);
|
|
|
// Mock Pyth response to return feeds with the older timestamp
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds2, slots2);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds2, slots2);
|
|
|
bytes[] memory updateData2 = createMockUpdateData(priceFeeds2);
|
|
|
|
|
|
// Expect revert with TimestampOlderThanLastUpdate (checked in _validateShouldUpdatePrices)
|
|
|
@@ -1231,7 +1231,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
slots[1] = 200; // Different slot
|
|
|
|
|
|
// Mock Pyth response to return these feeds with mismatched slots
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
|
|
|
// Expect revert with PriceSlotMismatch error
|
|
|
@@ -1346,7 +1346,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
PythStructs.PriceFeed[] memory priceFeeds;
|
|
|
uint64[] memory slots;
|
|
|
(priceFeeds, slots) = createMockPriceFeedsWithSlots(publishTime, 2);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
|
|
|
vm.prank(pusher);
|
|
|
@@ -1388,7 +1388,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
PythStructs.PriceFeed[] memory priceFeeds;
|
|
|
uint64[] memory slots;
|
|
|
(priceFeeds, slots) = createMockPriceFeedsWithSlots(publishTime, 3);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
|
|
|
vm.prank(pusher);
|
|
|
@@ -1443,7 +1443,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
PythStructs.PriceFeed[] memory priceFeeds;
|
|
|
uint64[] memory slots;
|
|
|
(priceFeeds, slots) = createMockPriceFeedsWithSlots(publishTime, 2);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
bytes32[] memory priceIds = params.priceIds;
|
|
|
|
|
|
@@ -1488,7 +1488,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
publishTime,
|
|
|
priceIds.length
|
|
|
);
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
|
|
|
vm.prank(pusher);
|
|
|
@@ -1555,7 +1555,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
|
|
|
priceFeeds[i].emaPrice.expo = priceFeeds[i].price.expo;
|
|
|
}
|
|
|
|
|
|
- mockParsePriceFeedUpdatesWithSlots(pyth, priceFeeds, slots);
|
|
|
+ mockParsePriceFeedUpdatesWithSlotsStrict(pyth, priceFeeds, slots);
|
|
|
bytes[] memory updateData = createMockUpdateData(priceFeeds);
|
|
|
|
|
|
vm.prank(pusher);
|