-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 estimations #2408
Fix/gas estimations #2408
Conversation
@andrepimenta notifying here to ensure we handle this case:
|
// Check if either no basicGasEstimates were provided or less than 3 options were provided (for example, only the average gas price) | ||
const noBasicGasEstimates = !basicGasEstimates || Object.keys(basicGasEstimates).length < 3; | ||
return isNotMainnet || noBasicGasEstimates; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also we're calling this method like 3 times, maybe it could be a good idea to set state or a const on didmount ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there might be some situations where basicGasEstimates is not available at mount?
Since this is a very simple check I think it's fine to keep it as a method, wdyt?
We're still showing speed up/cancel option, just wanted to make sure if this was a requirement or not (taken from #2316 (comment)) |
If a user attempts to edit the gas price while on a custom network, there is an exception that pops up seen here = https://recordit.co/wjjSR1Ws9z |
@omnat I just tested this use case, and we hide the basic gas options in this case and only show advanced (as we do on other non-mainnet networks in this PR) |
# Conflicts: # app/components/UI/CustomGas/index.js # app/components/UI/TransactionEditor/index.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA Passed 👍🏽
* initial implementation * Only display advanced * Approve transaction gas estimation * Fix custom gas input * Hide transaction actions for non-mainnet * Fix typo * Fix gas estimations for dapp transactions * Typo: Chain id as prop * Add test * Improve test * Fix Transactions UI test * Move to chainId * Added fallback to network gas price for mainnet basic estimates error * Update tests * Move code to util & fix custom gas component & timeout * Remove unused getBasicGasEstimatesWithHardcodedFallback
Description
This fixes gas estimations for non-mainnet networks.
Checklist
Issue
Resolves #2316