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 estimate for tokens #7753

Merged
merged 3 commits into from
Jan 10, 2020
Merged

Fix gas estimate for tokens #7753

merged 3 commits into from
Jan 10, 2020

Conversation

danjm
Copy link
Contributor

@danjm danjm commented Jan 7, 2020

fixes #7709

This PR fixes an outstanding issue with the send token screen. When advanced gas inputs were showing and token amounts where change, the newly estimated gas value would not be the submitted gas value if there was no blur event before clicking "Submit".

This PR ensures that the gas value is updated on a debounced change of the amount field so that the correct estimate is submitted.

@danjm danjm requested review from Gudahtt and whymarrh as code owners January 7, 2020 15:27
@danjm danjm force-pushed the fix-gas-limit-estimation branch 2 times, most recently from eb99c5c to 7be74b1 Compare January 9, 2020 13:57
@Gudahtt Gudahtt force-pushed the fix-gas-limit-estimation branch 3 times, most recently from 643239f to f6f3d65 Compare January 9, 2020 21:10
@Gudahtt Gudahtt force-pushed the fix-gas-limit-estimation branch from f6f3d65 to 0237426 Compare January 9, 2020 21:22
@metamaskbot
Copy link
Collaborator

Builds ready [0237426]

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

I've fixed the test failures. This should be good to merge now

@danjm danjm merged commit d349bd6 into develop Jan 10, 2020
@whymarrh whymarrh deleted the fix-gas-limit-estimation branch January 10, 2020 14:24
Gudahtt added a commit that referenced this pull request Jan 10, 2020
* Make gas estimate update on debounced token amount change, not just on blur after change

* Updated tests

* Ensure `updateGas` is bound early

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
yqrashawn pushed a commit to yqrashawn/conflux-portal that referenced this pull request Jan 14, 2020
* Make gas estimate update on debounced token amount change, not just on blur after change

* Updated tests

* Ensure `updateGas` is bound early

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Gudahtt added a commit that referenced this pull request Jan 15, 2020
As of #7753, the `onBlur` prop is no longer used for the `token-input`
and `currency-input` components, and the associated wrapper components
and the shared underlying component. It as been removed from all of
them.
yqrashawn pushed a commit to Conflux-Chain/conflux-portal that referenced this pull request Jan 15, 2020
* Make gas estimate update on debounced token amount change, not just on blur after change

* Updated tests

* Ensure `updateGas` is bound early

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Gudahtt added a commit that referenced this pull request Jan 15, 2020
As of #7753, the `onBlur` prop is no longer used for the `token-input`
and `currency-input` components, and the associated wrapper components
and the shared underlying component. It as been removed from all of
them.
@BlinkyStitt
Copy link

I think this is still a problem with v7.7.2. I don't want to link my name here with my address/txs, but I just had some transactions that tried to transfer some tokens revert. I manually increased the gas limit and they succeeded.

@TomAFrench
Copy link

I've had this same issue just occur. 2 DAI transfers failing with gas limits of 43k and 50k which finally went through once the gas limit was raised to 70k (although ironically only 37k of gas was used)

@Gudahtt
Copy link
Member

Gudahtt commented Jan 29, 2020

Thanks for the feedback @wysenynja and @TomAFrench ; would either of you be willing to create a separate issue to track the problem you've encountered? Any more details about browser version, MetaMask version, and circumstances of the event would be greatly appreciated as well. I suspect it's a distinct problem, unrelated to the changes in this PR, that just happens to have a similar symptom.

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.

Failed txs caused by gas limit set too low for erc20 tokens
5 participants