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

Ensure that swap approve tx and swap tx always have the same gas price #10501

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

danjm
Copy link
Contributor

@danjm danjm commented Feb 23, 2021

This PR fixes a bug whereby the approve tx and swap tx created within our swaps feature could each have a different gas price. This would happen in the case when there is no custom gas price set, and the call to the swaps /gasPrices api fails. In such a case, both would get their gas price from the eth_gasPrice method, but at different times (swap tx at the time quotes are requested, and approve tx at the time the swap is submitted).

This PR fixes that by having both gas prices set by calling the same selector getUsedSwapsGasPrice

@danjm danjm requested a review from a team as a code owner February 23, 2021 15:59
@danjm danjm requested a review from darkwing February 23, 2021 15:59
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@darkwing
Copy link
Contributor

Good catch!

@metamaskbot
Copy link
Collaborator

Builds ready [29990d9]
Page Load Metrics (584 ± 37 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint48815994
domContentLoaded3757095837737
load3767105847737
domInteractive3757095827737

@danjm danjm merged commit 9c4af85 into develop Feb 23, 2021
@danjm danjm deleted the fix-possible-swap-tx-price-mismatch branch February 23, 2021 16:51
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants