Skip to content

Commit 7b76ec5

Browse files
committed
test: fix test
1 parent 7f91566 commit 7b76ec5

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

target_chains/ethereum/contracts/forge-test/PulseScheduler.t.sol

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,28 +1335,23 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
13351335
);
13361336

13371337
// Deplete the balance by updating price feeds multiple times
1338-
(
1339-
PythStructs.PriceFeed[] memory priceFeeds_reduce,
1340-
uint64[] memory slots_reduce
1341-
) = createMockPriceFeedsWithSlots(
1342-
SafeCast.toUint64(block.timestamp),
1343-
2
1338+
uint64 publishTime = SafeCast.toUint64(block.timestamp);
1339+
for (uint i = 0; i < 50; i++) {
1340+
// Advance publish time by 60s for each update to satisfy update criteria
1341+
(
1342+
PythStructs.PriceFeed[] memory priceFeeds_reduce,
1343+
uint64[] memory slots_reduce
1344+
) = createMockPriceFeedsWithSlots(publishTime + (i * 60), 2);
1345+
mockParsePriceFeedUpdatesWithSlots(
1346+
pyth,
1347+
priceFeeds_reduce,
1348+
slots_reduce
1349+
);
1350+
bytes[] memory updateData_reduce = createMockUpdateData(
1351+
priceFeeds_reduce
13441352
);
1345-
mockParsePriceFeedUpdatesWithSlots(
1346-
pyth,
1347-
priceFeeds_reduce,
1348-
slots_reduce
1349-
);
1350-
bytes[] memory updateData_reduce = createMockUpdateData(
1351-
priceFeeds_reduce
1352-
);
1353-
1354-
// Update price feeds multiple times to deplete balance
1355-
for (uint i = 0; i < 10; i++) {
13561353
vm.prank(pusher);
13571354
scheduler.updatePriceFeeds(subId_reduce, updateData_reduce);
1358-
// Advance time to make updates valid
1359-
vm.warp(block.timestamp + 60);
13601355
}
13611356

13621357
// Check that balance is now below minimum for 1 feed

0 commit comments

Comments
 (0)