Skip to content

Commit c5d02af

Browse files
committed
fix(ethereum): emit update event on parse* methods in MockPyth
1 parent ab10b9f commit c5d02af

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

target_chains/ethereum/sdk/js/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-evm-js",
3-
"version": "1.29.3",
3+
"version": "1.29.4",
44
"description": "Pyth Network EVM Utils in JS",
55
"homepage": "https://pyth.network",
66
"author": {

target_chains/ethereum/sdk/solidity/MockPyth.sol

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ contract MockPyth is AbstractPyth {
5858
priceFeeds[priceFeed.id] = priceFeed;
5959
emit PriceFeedUpdate(
6060
priceFeed.id,
61-
uint64(lastPublishTime),
61+
uint64(priceFeed.price.publishTime),
6262
priceFeed.price.price,
6363
priceFeed.price.conf
6464
);
@@ -101,6 +101,12 @@ contract MockPyth is AbstractPyth {
101101
uint publishTime = feeds[i].price.publishTime;
102102
if (priceFeeds[feeds[i].id].price.publishTime < publishTime) {
103103
priceFeeds[feeds[i].id] = feeds[i];
104+
emit PriceFeedUpdate(
105+
feeds[i].id,
106+
uint64(publishTime),
107+
feeds[i].price.price,
108+
feeds[i].price.conf
109+
);
104110
}
105111

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

0 commit comments

Comments
 (0)