MetaMask / web3-provider-engine

A JavaScript library for composing Ethereum provider objects using middleware modules
MIT License
598 stars 327 forks source link

fix: filter empty transactions when calculating gas price #392

Closed martinheidegger closed 1 year ago

martinheidegger commented 2 years ago

We noticed that empty transactions may occur in the price calculation, filtering them out fixes the calculation.

Note: This is part of a bunch of PR's, that should upstream fixes we needed for wpe to work in our environment.

mcmire commented 2 years ago

Hi @martinheidegger, sorry for the delay in replying. This seems like a reasonable change. Would you mind adding some tests for this? I know we do not presently have some tests for the GaspriceProvider (and they are written using tape) but hopefully you can take a look at some of the other tests for the subproviders to get an idea of how to write them. Let me know if you need assistance however.

mcmire commented 1 year ago

Revisiting this pull request... Thank you for the submission, but we are actively phasing out this package in favor of json-rpc-engine and its related packages, so I'm going to close this. As for the changes here, we no longer have a middleware devoted to obtaining the current gas price. You may wish to make a new package that incorporates this behavior and plugs into our new middleware pipeline.