-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CERT 7009 Add Chronicle Price Feed #16
Conversation
…ertora/Quorum into niv/CERT-7009-Add-Chronicle-Price-Feed
def __init__(self): | ||
self.session = requests.Session() | ||
self.memory = defaultdict(list) | ||
self.info_url = "https://chroniclelabs.org/api/median/info/{}/{}/?testnet=false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either define this url in get_price_feeds_info
or define the url from __process_pairs
here. It looks funky that you treat urls differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Quorum/checks/feed_price.py
Outdated
price_feeds = self.api.get_price_feeds_info(self.chain) | ||
self.price_feeds_dict = {feed.contractAddress: feed for feed in price_feeds} | ||
self.price_feeds_dict.update({feed.proxyAddress: feed for feed in price_feeds if feed.proxyAddress}) | ||
price_feeds = self.chainlink_api.get_price_feeds_info(self.chain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chainlink_price_feeds
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
…ertora/Quorum into niv/CERT-7009-Add-Chronicle-Price-Feed
pairs = requests.get( | ||
"https://chroniclelabs.org/api/pairs?testnet=false" | ||
).json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any retries or raise_for_status needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks added raise_for_status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment for improvement but looks good
…ertora/Quorum into niv/CERT-7009-Add-Chronicle-Price-Feed
📢 PR Summary: Integrate
ChronicleAPI
and Enhance Feed Price Verification🔧 Key Changes:
Quorum/apis/price_feeds/__init__.py
:ChainLinkAPI
andChronicleAPI
for centralized access.__all__ = [ChainLinkAPI, ChronicleAPI]
for clear API exposure.ChainLinkAPI
:Quorum/apis/chainlink_api.py
toQuorum/apis/price_feeds/chainlink_api.py
for better organization within theprice_feeds
package.git_api
:Quorum/git_api
toQuorum/apis/git_api
for better organization.ChronicleAPI
:Quorum/apis/price_feeds/chronicle_api.py
to interact with the Chronicle data feed API.ChronicleAPI
as a singleton to efficiently manage API requests and cache price feed data.Feed Price Verification Enhancements:
Quorum/checks/feed_price.py
:ChainLinkAPI
andChronicleAPI
: Adjusted import paths to the newprice_feeds
package.chainlink_api = ChainLinkAPI()
chronicle_api = ChronicleAPI()
Utility Updates:
Quorum/utils/chain_enum.py
:SCR
➔SCROLL
ZK
➔ZKSYNC
✅ Benefits:
ChronicleAPI
alongsideChainLinkAPI
allows the tool to verify price feeds against multiple authoritative sources, enhancing reliability.price_feeds
package promotes better maintainability and scalability.