Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit 2203797

Browse files
committed
Update getUpdateFee signature to take updateData
1 parent 88b6d72 commit 2203797

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

IPyth.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ interface IPyth {
113113
function updatePriceFeedsIfNecessary(bytes[] calldata updateData, bytes32[] calldata priceIds, uint64[] calldata publishTimes) external payable;
114114

115115
/// @notice Returns the required fee to update an array of price updates.
116-
/// @param updateDataSize Number of price updates.
116+
/// @param updateData Array of price update data.
117117
/// @return feeAmount The required fee in Wei.
118-
function getUpdateFee(uint updateDataSize) external view returns (uint feeAmount);
118+
function getUpdateFee(bytes[] calldata updateData) external view returns (uint feeAmount);
119119
}

MockPyth.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ contract MockPyth is AbstractPyth {
3333
// You can create this data either by calling createPriceFeedData or
3434
// by using web3.js or ethers abi utilities.
3535
function updatePriceFeeds(bytes[] calldata updateData) public override payable {
36-
uint requiredFee = getUpdateFee(updateData.length);
36+
uint requiredFee = getUpdateFee(updateData);
3737
require(msg.value >= requiredFee, "Insufficient paid fee amount");
3838

3939
if (msg.value > requiredFee) {
@@ -74,8 +74,8 @@ contract MockPyth is AbstractPyth {
7474
emit UpdatePriceFeeds(msg.sender, 1, requiredFee);
7575
}
7676

77-
function getUpdateFee(uint updateDataSize) public override view returns (uint feeAmount) {
78-
return singleUpdateFeeInWei * updateDataSize;
77+
function getUpdateFee(bytes[] calldata updateData) public override view returns (uint feeAmount) {
78+
return singleUpdateFeeInWei * updateData.length;
7979
}
8080

8181
function createPriceFeedUpdateData(

abis/AbstractPyth.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@
369369
{
370370
"inputs": [
371371
{
372-
"internalType": "uint256",
373-
"name": "updateDataSize",
374-
"type": "uint256"
372+
"internalType": "bytes[]",
373+
"name": "updateData",
374+
"type": "bytes[]"
375375
}
376376
],
377377
"name": "getUpdateFee",

abis/IPyth.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@
369369
{
370370
"inputs": [
371371
{
372-
"internalType": "uint256",
373-
"name": "updateDataSize",
374-
"type": "uint256"
372+
"internalType": "bytes[]",
373+
"name": "updateData",
374+
"type": "bytes[]"
375375
}
376376
],
377377
"name": "getUpdateFee",

abis/MockPyth.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@
434434
{
435435
"inputs": [
436436
{
437-
"internalType": "uint256",
438-
"name": "updateDataSize",
439-
"type": "uint256"
437+
"internalType": "bytes[]",
438+
"name": "updateData",
439+
"type": "bytes[]"
440440
}
441441
],
442442
"name": "getUpdateFee",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/pyth-sdk-solidity",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "Read prices from the Pyth oracle",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)