@@ -86,8 +86,7 @@ contract GasBenchmark is Test, WormholeTestUtils, PythTestUtils {
86
86
87
87
function generateUpdateDataAndFee (PythStructs.Price[] memory prices ) internal returns (bytes [] memory updateData , uint updateFee ) {
88
88
bytes memory vaa = generatePriceFeedUpdateVAA (
89
- priceIds,
90
- prices,
89
+ pricesToPriceAttestations (priceIds, prices),
91
90
sequence,
92
91
NUM_GUARDIAN_SIGNERS
93
92
);
@@ -122,6 +121,29 @@ contract GasBenchmark is Test, WormholeTestUtils, PythTestUtils {
122
121
pyth.updatePriceFeedsIfNecessary {value: cachedPricesUpdateFee}(cachedPricesUpdateData, priceIds, cachedPricesPublishTimes);
123
122
}
124
123
124
+ function testBenchmarkParsePriceFeedUpdatesForOnePriceFeed () public {
125
+ bytes32 [] memory ids = new bytes32 [](1 );
126
+ ids[0 ] = priceIds[0 ];
127
+
128
+ pyth.parsePriceFeedUpdates {value: freshPricesUpdateFee}(freshPricesUpdateData, ids, 0 , 50 );
129
+ }
130
+
131
+ function testBenchmarkParsePriceFeedUpdatesForTwoPriceFeed () public {
132
+ bytes32 [] memory ids = new bytes32 [](2 );
133
+ ids[0 ] = priceIds[0 ];
134
+ ids[1 ] = priceIds[1 ];
135
+
136
+ pyth.parsePriceFeedUpdates {value: freshPricesUpdateFee}(freshPricesUpdateData, ids, 0 , 50 );
137
+ }
138
+
139
+ function testBenchmarkParsePriceFeedUpdatesForOnePriceFeedNotWithinRange () public {
140
+ bytes32 [] memory ids = new bytes32 [](1 );
141
+ ids[0 ] = priceIds[0 ];
142
+
143
+ vm.expectRevert (bytes ("1 or more price feeds are not found in the updateData or they are out of the given time range " ));
144
+ pyth.parsePriceFeedUpdates {value: freshPricesUpdateFee}(freshPricesUpdateData, ids, 50 , 100 );
145
+ }
146
+
125
147
function testBenchmarkGetPrice () public {
126
148
// Set the block timestamp to 0. As prices have < 10 timestamp and staleness
127
149
// is set to 60 seconds, the getPrice should work as expected.
0 commit comments