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

Abehjati/fix-events-problems #20

Merged
merged 4 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions IPyth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,25 @@ interface IPyth {
/// @param chainId ID of the source chain that the batch price update containing this price.
/// This value comes from Wormhole, and you can find the corresponding chains at https://docs.wormholenetwork.com/wormhole/contracts.
/// @param sequenceNumber Sequence number of the batch price update containing this price.
/// @param lastPublsihTime Publish time of the previously stored price.
/// @param lastPublishTime Publish time of the previously stored price.
/// @param publishTime Publish time of the given price update.
/// @param price Current price of the given price update.
/// @param conf Current confidence interval of the given price update.
event PriceFeedUpdate(bytes32 indexed id, bool indexed fresh, int8 chainId, uint64 sequenceNumber, uint64 lastPublsihTime, uint64 publishTime, int64 price, uint64 conf);
event PriceFeedUpdate(bytes32 indexed id, bool indexed fresh, uint16 chainId, uint64 sequenceNumber, uint64 lastPublishTime, uint64 publishTime, int64 price, uint64 conf);

/// @dev Emitted when a batch price update is processed successfully.
/// @param chainId ID of the source chain that the batch price update comes from.
/// @param sequenceNumber Sequence number of the batch price update.
/// @param batchSize Number of prices within the batch price update.
/// @param freshPricesInBatch Number of prices that were more recent and were stored.
event BatchPriceFeedUpdate(int8 chainId, uint64 sequenceNumber, uint batchSize, uint freshPricesInBatch);
event BatchPriceFeedUpdate(uint16 chainId, uint64 sequenceNumber, uint batchSize, uint freshPricesInBatch);

/// @dev Emitted when a call to `updatePriceFeeds` is processed successfully.
/// @param sender Sender of the call (`msg.sender`).
/// @param batchCount Number of batches that this function processed.
/// @param fee Amount of paid fee for updating the prices.
event UpdatePriceFeeds(address indexed sender, uint batchCount, uint fee);


/// @notice Returns the current price and confidence interval.
/// @dev Reverts if the current price is not available.
/// @param id The Pyth Price Feed ID of which to fetch the current price and confidence interval.
Expand Down
10 changes: 5 additions & 5 deletions IPythAbi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"inputs": [
{
"indexed": false,
"internalType": "int8",
"internalType": "uint16",
"name": "chainId",
"type": "int8"
"type": "uint16"
},
{
"indexed": false,
Expand Down Expand Up @@ -47,9 +47,9 @@
},
{
"indexed": false,
"internalType": "int8",
"internalType": "uint16",
"name": "chainId",
"type": "int8"
"type": "uint16"
},
{
"indexed": false,
Expand All @@ -60,7 +60,7 @@
{
"indexed": false,
"internalType": "uint64",
"name": "lastPublsihTime",
"name": "lastPublishTime",
"type": "uint64"
},
{
Expand Down
2 changes: 1 addition & 1 deletion MockPyth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract MockPyth is AbstractPyth {

// Chain ID is id of the source chain that the price update comes from. Since it is just a mock contract
// We set it to 1.
int8 chainId = 1;
uint16 chainId = 1;

for(uint i = 0; i < updateData.length; i++) {
PythStructs.PriceFeed memory priceFeed = abi.decode(updateData[i], (PythStructs.PriceFeed));
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-sdk-solidity",
"version": "0.3.0",
"version": "0.4.0-beta.0",
"description": "Read prices from the Pyth oracle",
"repository": {
"type": "git",
Expand Down