Skip to content
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

fix(gas-fee): catch estimation errors #1121

Merged
merged 3 commits into from
Jun 30, 2023
Merged

Conversation

alexandre-abrioux
Copy link
Member

@alexandre-abrioux alexandre-abrioux commented Jun 30, 2023

Description of the changes

It can happen, rarely, that @rainbow-me/fee-suggestions fails to estimate gas fees, especially on chains other than Ethereum mainnet (related to rainbow-me/fee-suggestions#23).

This PR catches, logs, and handles those errors by returning an empty object, thus letting the RPC provider choose how to configure gas fee / gas price (either by using defaults for the EIP-1559 transaction fields or falling back to a legacy, non-EIP 1559, transaction).

Copy link
Contributor

@benjlevesque benjlevesque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great. If you need to test, this block has the issue

packages/utils/src/estimate-gas-fees.ts Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jun 30, 2023

Coverage Status

coverage: 87.476% (-0.04%) from 87.511% when pulling 7681489 on fix-gas-fee-suggestion into 411d258 on master.

@alexandre-abrioux alexandre-abrioux enabled auto-merge (squash) June 30, 2023 11:06
@alexandre-abrioux alexandre-abrioux merged commit e0e9151 into master Jun 30, 2023
@alexandre-abrioux alexandre-abrioux deleted the fix-gas-fee-suggestion branch June 30, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants