Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We would like to introduce another fallback to how we estimate gas fees in a future commit — namely, we want to use `eth_feeHistory` for EIP-1559 networks if the usual API is down. To do this, the existing code around gas fee estimates needs to be refactored. This is the first in a two-part refactor, extracting the majority of the code in `GasFeeController._fetchGasFeeEstimateData` to `gas-util`. In addition to making room for more changes, this also allows us to test this code in isolation from the polling code that already exists in GasFeeController. Note that I am using the term "suggestions" to encompass the data that `_fetchGasFeeEstimateData` returns. This is because `gasFeeEstimates` is an intermediate value that can also be packaged with `estimatedGasFeeTimeBounds`, so "estimates" could be confusing. Also, I replaced "fetch" with "determine" as in the future we may be performing calculations that APIs have done for us in the past ("fetch" seems like a more low-level action).
- Loading branch information