-
Notifications
You must be signed in to change notification settings - Fork 66
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
Caching api prices to lower credits usage #112
Comments
In your design would the gas reporter need to know when the last One way to manage this on your end would be in
and set the // hardhat.config.ts
gasReporter: {
...
coinmarketcap: (process.env.PRICE_DATA) ? `${process.env..CMC_API_KEY}` : undefined
} |
Hi, thank you for the quick response; I see the tracking of the request from another perspective: not when the last test suite was run, but when the last request to the pricing service has been made. I have already setup the kind of condition you mentioned but this will probably cause the price reporter to be off for very long intervals before actually checking the prices: this could lead to long times before noticing that the implementation is very expensive. -- Basically in my opinion I fall in this possible scenarios:
|
I see... so the reporter would cache timestamped prices in a local file (e.g
Ok, that makes sense - I think the case you've made here is reasonable. |
It's my impression that the calls are being made for each test execution;
While this is extremely useful the closer you get to the go-live, it's very credit consuming on all the previous phases.
Disabling the reporting totally could lead to very costly implementation not being noticed in time.
Is there the possibility to add a caching like 1 fetch every X minutes instead ?
The text was updated successfully, but these errors were encountered: