@@ -256,7 +256,11 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
256
256
numInitialFeeds
257
257
);
258
258
259
- mockParsePriceFeedUpdatesWithSlots (pyth, initialPriceFeeds, slots);
259
+ mockParsePriceFeedUpdatesWithSlotsStrict (
260
+ pyth,
261
+ initialPriceFeeds,
262
+ slots
263
+ );
260
264
bytes [] memory updateData = createMockUpdateData (initialPriceFeeds);
261
265
262
266
vm.prank (pusher);
@@ -830,7 +834,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
830
834
priceIds.length
831
835
);
832
836
833
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds1, slots);
837
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds1, slots);
834
838
bytes [] memory updateData1 = createMockUpdateData (priceFeeds1);
835
839
836
840
// Perform first update
@@ -881,7 +885,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
881
885
priceFeeds2[i].emaPrice.publishTime = publishTime2;
882
886
}
883
887
884
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds2, slots); // Mock for the second call
888
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds2, slots); // Mock for the second call
885
889
bytes [] memory updateData2 = createMockUpdateData (priceFeeds2);
886
890
887
891
// Perform second update
@@ -942,7 +946,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
942
946
);
943
947
944
948
uint256 mockPythFee = MOCK_PYTH_FEE_PER_FEED * params.priceIds.length ;
945
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
949
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
946
950
bytes [] memory updateData = createMockUpdateData (priceFeeds);
947
951
948
952
// Get state before
@@ -1027,7 +1031,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1027
1031
priceIds.length
1028
1032
);
1029
1033
uint256 mockPythFee = MOCK_PYTH_FEE_PER_FEED * priceIds.length ;
1030
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1034
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1031
1035
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1032
1036
1033
1037
// Calculate minimum keeper fee (overhead + feed-specific fee)
@@ -1085,7 +1089,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1085
1089
PythStructs.PriceFeed[] memory priceFeeds1;
1086
1090
uint64 [] memory slots1;
1087
1091
(priceFeeds1, slots1) = createMockPriceFeedsWithSlots (publishTime1, 2 );
1088
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds1, slots1);
1092
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds1, slots1);
1089
1093
bytes [] memory updateData1 = createMockUpdateData (priceFeeds1);
1090
1094
vm.prank (pusher);
1091
1095
scheduler.updatePriceFeeds (subscriptionId, updateData1);
@@ -1096,7 +1100,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1096
1100
PythStructs.PriceFeed[] memory priceFeeds2;
1097
1101
uint64 [] memory slots2;
1098
1102
(priceFeeds2, slots2) = createMockPriceFeedsWithSlots (publishTime2, 2 );
1099
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds2, slots2);
1103
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds2, slots2);
1100
1104
bytes [] memory updateData2 = createMockUpdateData (priceFeeds2);
1101
1105
1102
1106
// Expect revert because heartbeat condition is not met
@@ -1132,7 +1136,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1132
1136
PythStructs.PriceFeed[] memory priceFeeds1;
1133
1137
uint64 [] memory slots;
1134
1138
(priceFeeds1, slots) = createMockPriceFeedsWithSlots (publishTime1, 2 );
1135
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds1, slots);
1139
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds1, slots);
1136
1140
bytes [] memory updateData1 = createMockUpdateData (priceFeeds1);
1137
1141
vm.prank (pusher);
1138
1142
scheduler.updatePriceFeeds (subscriptionId, updateData1);
@@ -1158,7 +1162,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1158
1162
priceFeeds2[i].price.publishTime = publishTime2;
1159
1163
}
1160
1164
1161
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds2, slots);
1165
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds2, slots);
1162
1166
bytes [] memory updateData2 = createMockUpdateData (priceFeeds2);
1163
1167
1164
1168
// Expect revert because deviation condition is not met
@@ -1183,7 +1187,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1183
1187
PythStructs.PriceFeed[] memory priceFeeds1;
1184
1188
uint64 [] memory slots1;
1185
1189
(priceFeeds1, slots1) = createMockPriceFeedsWithSlots (publishTime1, 2 );
1186
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds1, slots1);
1190
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds1, slots1);
1187
1191
bytes [] memory updateData1 = createMockUpdateData (priceFeeds1);
1188
1192
1189
1193
vm.prank (pusher);
@@ -1195,7 +1199,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1195
1199
uint64 [] memory slots2;
1196
1200
(priceFeeds2, slots2) = createMockPriceFeedsWithSlots (publishTime2, 2 );
1197
1201
// Mock Pyth response to return feeds with the older timestamp
1198
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds2, slots2);
1202
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds2, slots2);
1199
1203
bytes [] memory updateData2 = createMockUpdateData (priceFeeds2);
1200
1204
1201
1205
// Expect revert with TimestampOlderThanLastUpdate (checked in _validateShouldUpdatePrices)
@@ -1235,7 +1239,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1235
1239
slots[1 ] = 200 ; // Different slot
1236
1240
1237
1241
// Mock Pyth response to return these feeds with mismatched slots
1238
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1242
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1239
1243
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1240
1244
1241
1245
// Expect revert with PriceSlotMismatch error
@@ -1350,7 +1354,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1350
1354
PythStructs.PriceFeed[] memory priceFeeds_reduce ,
1351
1355
uint64 [] memory slots_reduce
1352
1356
) = createMockPriceFeedsWithSlots (publishTime + (i * 60 ), 2 );
1353
- mockParsePriceFeedUpdatesWithSlots (
1357
+ mockParsePriceFeedUpdatesWithSlotsStrict (
1354
1358
pyth,
1355
1359
priceFeeds_reduce,
1356
1360
slots_reduce
@@ -1422,7 +1426,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1422
1426
PythStructs.PriceFeed[] memory priceFeeds;
1423
1427
uint64 [] memory slots;
1424
1428
(priceFeeds, slots) = createMockPriceFeedsWithSlots (publishTime, 2 );
1425
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1429
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1426
1430
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1427
1431
1428
1432
vm.prank (pusher);
@@ -1464,7 +1468,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1464
1468
PythStructs.PriceFeed[] memory priceFeeds;
1465
1469
uint64 [] memory slots;
1466
1470
(priceFeeds, slots) = createMockPriceFeedsWithSlots (publishTime, 3 );
1467
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1471
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1468
1472
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1469
1473
1470
1474
vm.prank (pusher);
@@ -1519,7 +1523,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1519
1523
PythStructs.PriceFeed[] memory priceFeeds;
1520
1524
uint64 [] memory slots;
1521
1525
(priceFeeds, slots) = createMockPriceFeedsWithSlots (publishTime, 2 );
1522
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1526
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1523
1527
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1524
1528
1525
1529
vm.prank (pusher);
@@ -1563,7 +1567,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1563
1567
publishTime,
1564
1568
priceIds.length
1565
1569
);
1566
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1570
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1567
1571
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1568
1572
1569
1573
vm.prank (pusher);
@@ -1630,7 +1634,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1630
1634
priceFeeds[i].emaPrice.expo = priceFeeds[i].price.expo;
1631
1635
}
1632
1636
1633
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1637
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1634
1638
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1635
1639
1636
1640
vm.prank (pusher);
@@ -1935,7 +1939,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1935
1939
slots[1 ] = 100 ; // Same slot
1936
1940
1937
1941
// Mock Pyth response (should succeed in the real world as minValidTime is 0)
1938
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1942
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1939
1943
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1940
1944
1941
1945
// Expect PricesUpdated event with the latest valid timestamp
@@ -1988,7 +1992,7 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
1988
1992
slots[1 ] = 100 ; // Same slot
1989
1993
1990
1994
// Mock Pyth response (should succeed in the real world as minValidTime is 0)
1991
- mockParsePriceFeedUpdatesWithSlots (pyth, priceFeeds, slots);
1995
+ mockParsePriceFeedUpdatesWithSlotsStrict (pyth, priceFeeds, slots);
1992
1996
bytes [] memory updateData = createMockUpdateData (priceFeeds);
1993
1997
1994
1998
// Expect revert with TimestampTooOld (checked in _validateShouldUpdatePrices)
0 commit comments