From c5d02afe532b4eb3757a5cb19173f7bf3301832a Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Tue, 23 Jan 2024 10:17:31 +0100 Subject: [PATCH] fix(ethereum): emit update event on parse* methods in MockPyth --- package-lock.json | 2 +- target_chains/ethereum/sdk/js/package.json | 2 +- target_chains/ethereum/sdk/solidity/MockPyth.sol | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5a97dc5..40082f4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58589,7 +58589,7 @@ }, "target_chains/ethereum/sdk/js": { "name": "@pythnetwork/pyth-evm-js", - "version": "1.29.3", + "version": "1.29.4", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", diff --git a/target_chains/ethereum/sdk/js/package.json b/target_chains/ethereum/sdk/js/package.json index 053d8d64..1d3fe5e9 100644 --- a/target_chains/ethereum/sdk/js/package.json +++ b/target_chains/ethereum/sdk/js/package.json @@ -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": { diff --git a/target_chains/ethereum/sdk/solidity/MockPyth.sol b/target_chains/ethereum/sdk/solidity/MockPyth.sol index d4035446..c0b11747 100644 --- a/target_chains/ethereum/sdk/solidity/MockPyth.sol +++ b/target_chains/ethereum/sdk/solidity/MockPyth.sol @@ -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 ); @@ -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]) {