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

Handling the error when eth_estimateGas fails #920

Merged
merged 12 commits into from
Oct 11, 2022

Conversation

tommasini
Copy link
Contributor

Handling error when eth_estimateGas fails

Description
When we did a transaction with binance smart chain and the dapp doesn't send a gas value, we were not being able to execute the eth_estimateGas, it was falling do a general RPC error.

Proposed solution
Handle the error like the extension does it. Added a value to the Transaction object to be filled with an error if the eth_estimateGas fails.

Checklist

  • Tests are included if applicable
  • Any added code is fully documented

Issue

Resolves #???

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Hi @tommasini, left a few suggestions.

src/transaction/TransactionController.test.ts Outdated Show resolved Hide resolved
src/transaction/TransactionController.test.ts Outdated Show resolved Hide resolved
src/transaction/TransactionController.ts Show resolved Hide resolved
@tommasini tommasini force-pushed the fix/4646-bns-estimate-gas-rpc-error branch from 638715e to 9a48838 Compare October 6, 2022 09:50
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Have a few more suggestions (just typos in test names) but this is looking good. Clearly there's more we need to do to improve these tests, and I think it would really help if we could simplify estimateGas because it does SO MUCH, but there's only so much you can do here, so I think what you have makes sense :)

src/transaction/TransactionController.test.ts Outdated Show resolved Hide resolved
src/transaction/TransactionController.test.ts Outdated Show resolved Hide resolved
src/transaction/TransactionController.test.ts Outdated Show resolved Hide resolved
@tommasini
Copy link
Contributor Author

@mcmire Thank you a lot for helping this PR have more quality!
I agree with you, I want to do a refactor in a future PR 🚀

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

LGTM.

@mcmire mcmire merged commit 4fec100 into MetaMask:main Oct 11, 2022
@adonesky1 adonesky1 mentioned this pull request Oct 12, 2022
gantunesr pushed a commit that referenced this pull request Dec 8, 2022
When we did a transaction with binance smart chain and the dapp doesn't send a gas value, we were not being able to execute the eth_estimateGas, it was falling do a general RPC error.

Handle the error like the extension does it. Added a value to the Transaction object to be filled with an error if the eth_estimateGas fails.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
When we did a transaction with binance smart chain and the dapp doesn't send a gas value, we were not being able to execute the eth_estimateGas, it was falling do a general RPC error.

Handle the error like the extension does it. Added a value to the Transaction object to be filled with an error if the eth_estimateGas fails.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
When we did a transaction with binance smart chain and the dapp doesn't send a gas value, we were not being able to execute the eth_estimateGas, it was falling do a general RPC error.

Handle the error like the extension does it. Added a value to the Transaction object to be filled with an error if the eth_estimateGas fails.
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.

3 participants