Skip to content

Commit

Permalink
fix(ethereum): emit update event on parse* methods in MockPyth
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-bahjati committed Jan 23, 2024
1 parent ab10b9f commit c5d02af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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 target_chains/ethereum/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-evm-js",
"version": "1.29.3",
"version": "1.29.4",
"description": "Pyth Network EVM Utils in JS",
"homepage": "https://pyth.network",
"author": {
Expand Down
8 changes: 7 additions & 1 deletion target_chains/ethereum/sdk/solidity/MockPyth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract MockPyth is AbstractPyth {
priceFeeds[priceFeed.id] = priceFeed;
emit PriceFeedUpdate(
priceFeed.id,
uint64(lastPublishTime),
uint64(priceFeed.price.publishTime),
priceFeed.price.price,
priceFeed.price.conf
);
Expand Down Expand Up @@ -101,6 +101,12 @@ contract MockPyth is AbstractPyth {
uint publishTime = feeds[i].price.publishTime;
if (priceFeeds[feeds[i].id].price.publishTime < publishTime) {
priceFeeds[feeds[i].id] = feeds[i];
emit PriceFeedUpdate(
feeds[i].id,
uint64(publishTime),
feeds[i].price.price,
feeds[i].price.conf
);
}

if (feeds[i].id == priceIds[i]) {
Expand Down

0 comments on commit c5d02af

Please sign in to comment.