Skip to content

Commit 660717e

Browse files
committed
removed slots strict function
1 parent f604a13 commit 660717e

File tree

8 files changed

+28
-100
lines changed

8 files changed

+28
-100
lines changed

target_chains/ethereum/contracts/contracts/pulse/Scheduler.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,14 @@ abstract contract Scheduler is IScheduler, SchedulerState {
308308
(
309309
PythStructs.PriceFeed[] memory priceFeeds,
310310
uint64[] memory slots
311-
) = pyth.parsePriceFeedUpdatesWithSlotsStrict{value: pythFee}(
311+
) = pyth.parsePriceFeedUpdatesWithConfig{value: pythFee}(
312312
updateData,
313313
params.priceIds,
314314
0, // We enforce the past max validity ourselves in _validateShouldUpdatePrices
315-
curTime + FUTURE_TIMESTAMP_MAX_VALIDITY_PERIOD
315+
curTime + FUTURE_TIMESTAMP_MAX_VALIDITY_PERIOD,
316+
false,
317+
true,
318+
false
316319
);
317320

318321
// Verify all price feeds have the same Pythnet slot.

target_chains/ethereum/contracts/contracts/pyth/Pyth.sol

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -411,36 +411,10 @@ abstract contract Pyth is
411411
maxPublishTime,
412412
false,
413413
false,
414-
true
414+
false
415415
);
416416
}
417417

418-
function parsePriceFeedUpdatesWithSlotsStrict(
419-
bytes[] calldata updateData,
420-
bytes32[] calldata priceIds,
421-
uint64 minPublishTime,
422-
uint64 maxPublishTime
423-
)
424-
external
425-
payable
426-
override
427-
returns (
428-
PythStructs.PriceFeed[] memory priceFeeds,
429-
uint64[] memory slots
430-
)
431-
{
432-
return
433-
parsePriceFeedUpdatesWithConfig(
434-
updateData,
435-
priceIds,
436-
minPublishTime,
437-
maxPublishTime,
438-
false,
439-
true,
440-
true
441-
);
442-
}
443-
444418
function extractTwapPriceInfos(
445419
bytes calldata updateData
446420
)
@@ -648,7 +622,7 @@ abstract contract Pyth is
648622
maxPublishTime,
649623
true,
650624
false,
651-
true
625+
false
652626
);
653627
}
654628

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ contract GasBenchmark is Test, WormholeTestUtils, PythTestUtils {
251251
50,
252252
false,
253253
true, // check minimal
254-
true
254+
false
255255
);
256256
}
257257

@@ -266,7 +266,7 @@ contract GasBenchmark is Test, WormholeTestUtils, PythTestUtils {
266266
50,
267267
false,
268268
true, // check minimal
269-
true
269+
false
270270
);
271271
}
272272

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,14 @@ contract PythTest is Test, WormholeTestUtils, PythTestUtils {
361361
(
362362
PythStructs.PriceFeed[] memory priceFeeds,
363363
uint64[] memory slots
364-
) = pyth.parsePriceFeedUpdatesWithSlotsStrict{value: updateFee}(
364+
) = pyth.parsePriceFeedUpdatesWithConfig{value: updateFee}(
365365
updateData,
366366
priceIds,
367367
0,
368-
MAX_UINT64
368+
MAX_UINT64,
369+
false,
370+
true,
371+
false
369372
);
370373

371374
assertEq(priceFeeds.length, numMessages);
@@ -527,11 +530,14 @@ contract PythTest is Test, WormholeTestUtils, PythTestUtils {
527530

528531
// Should revert in strict mode
529532
vm.expectRevert(PythErrors.InvalidArgument.selector);
530-
pyth.parsePriceFeedUpdatesWithSlotsStrict{value: updateFee}(
533+
pyth.parsePriceFeedUpdatesWithConfig{value: updateFee}(
531534
updateData,
532535
requestedPriceIds,
533536
0,
534-
MAX_UINT64
537+
MAX_UINT64,
538+
false,
539+
true,
540+
false
535541
);
536542
}
537543

@@ -564,11 +570,14 @@ contract PythTest is Test, WormholeTestUtils, PythTestUtils {
564570

565571
// Should revert in strict mode because we have fewer updates than price IDs
566572
vm.expectRevert(PythErrors.InvalidArgument.selector);
567-
pyth.parsePriceFeedUpdatesWithSlotsStrict{value: updateFee}(
573+
pyth.parsePriceFeedUpdatesWithConfig{value: updateFee}(
568574
updateData,
569575
requestedPriceIds,
570576
0,
571-
MAX_UINT64
577+
MAX_UINT64,
578+
false,
579+
true,
580+
false
572581
);
573582
}
574583

target_chains/ethereum/contracts/forge-test/utils/MockPriceFeedTestUtils.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ abstract contract MockPriceFeedTestUtils is Test {
187187
pyth,
188188
expectedFee,
189189
abi.encodeWithSelector(
190-
IPyth.parsePriceFeedUpdatesWithSlotsStrict.selector
190+
IPyth.parsePriceFeedUpdatesWithConfig.selector
191191
),
192192
abi.encode(priceFeeds, slots)
193193
);

target_chains/ethereum/sdk/solidity/AbstractPyth.sol

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,6 @@ abstract contract AbstractPyth is IPyth {
136136
override
137137
returns (PythStructs.PriceFeed[] memory priceFeeds);
138138

139-
function parsePriceFeedUpdatesWithSlotsStrict(
140-
bytes[] calldata updateData,
141-
bytes32[] calldata priceIds,
142-
uint64 minPublishTime,
143-
uint64 maxPublishTime
144-
)
145-
external
146-
payable
147-
virtual
148-
override
149-
returns (
150-
PythStructs.PriceFeed[] memory priceFeeds,
151-
uint64[] memory slots
152-
);
153-
154139
function parseTwapPriceFeedUpdates(
155140
bytes[] calldata updateData,
156141
bytes32[] calldata priceIds

target_chains/ethereum/sdk/solidity/IPyth.sol

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -202,24 +202,4 @@ interface IPyth is IPythEvents {
202202
uint64 minPublishTime,
203203
uint64 maxPublishTime
204204
) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);
205-
206-
/// @dev Same as `parsePriceFeedUpdates`, but checks that the updateData is minimal and also returns the Pythnet slots.
207-
/// @param updateData Array of price update data.
208-
/// @param priceIds Array of price ids.
209-
/// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
210-
/// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
211-
/// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
212-
/// @return slots Array of the Pythnet slot corresponding to the given `priceIds` (with the same order).
213-
function parsePriceFeedUpdatesWithSlotsStrict(
214-
bytes[] calldata updateData,
215-
bytes32[] calldata priceIds,
216-
uint64 minPublishTime,
217-
uint64 maxPublishTime
218-
)
219-
external
220-
payable
221-
returns (
222-
PythStructs.PriceFeed[] memory priceFeeds,
223-
uint64[] memory slots
224-
);
225205
}

target_chains/ethereum/sdk/solidity/MockPyth.sol

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ contract MockPyth is AbstractPyth {
8686
return singleUpdateFeeInWei * updateData.length;
8787
}
8888

89-
function parsePriceFeedUpdatesWithConfig(
89+
function parsePriceFeedUpdatesWithConfig(
9090
bytes[] calldata updateData,
9191
bytes32[] calldata priceIds,
9292
uint64 minAllowedPublishTime,
@@ -159,7 +159,7 @@ contract MockPyth is AbstractPyth {
159159
maxPublishTime,
160160
false,
161161
true,
162-
true
162+
false
163163
);
164164
}
165165

@@ -176,30 +176,7 @@ contract MockPyth is AbstractPyth {
176176
maxPublishTime,
177177
false,
178178
true,
179-
true
180-
);
181-
}
182-
183-
function parsePriceFeedUpdatesWithSlotsStrict(
184-
bytes[] calldata updateData,
185-
bytes32[] calldata priceIds,
186-
uint64 minPublishTime,
187-
uint64 maxPublishTime
188-
)
189-
external
190-
payable
191-
override
192-
returns (PythStructs.PriceFeed[] memory feeds, uint64[] memory slots)
193-
{
194-
return
195-
parsePriceFeedUpdatesWithConfig(
196-
updateData,
197-
priceIds,
198-
minPublishTime,
199-
maxPublishTime,
200-
false,
201-
true,
202-
true
179+
false
203180
);
204181
}
205182

0 commit comments

Comments
 (0)