Skip to content

fix: Fix useTransactionGasFeeEstimate to calculate gas estimate properly #31469

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

Merged
merged 3 commits into from
Apr 2, 2025

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Apr 1, 2025

Description

This PR fixes a bug where useTransactionGasFeeEstimate treats estimatedBaseFee as WEI hex. However this value is GWEI decimal.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4563

Manual testing steps

No user flow changes

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@OGPoyraz OGPoyraz requested a review from a team as a code owner April 1, 2025 08:47
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Apr 1, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

✅ @MetaMask/confirmations

  • ui/pages/confirmations/components/confirm/info/hooks/useTransactionGasFeeEstimate.test.ts
  • ui/pages/confirmations/components/confirm/info/hooks/useTransactionGasFeeEstimate.ts

@metamaskbot
Copy link
Collaborator

Builds ready [fa038ec]
UI Startup Metrics (1181 ± 57 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1181104313535712171304
load10329301184531155975
domContentLoaded1026917117853917988
domInteractive16124051527
firstPaint7691291183392236953
backgroundConnect96274910
firstReactRender18155251832
getState11444868
initialActions001001
loadScripts81471196652849907
setupStore7520278
WebpackHomeuiStartup994722131493975994
load832543118187876921
domContentLoaded826528117688867916
domInteractive15124161433
firstPaint2765892129079592
backgroundConnect18134581640
firstReactRender17123751729
getState6320358
initialActions001000
loadScripts823527117288860915
setupStore8514279
FirefoxBrowserifyHomeuiStartup13761214198016114131785
load12351058181614912731623
domContentLoaded12351058181514912731622
domInteractive10243216278996
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect241691102537
firstReactRender23194742429
getState7417278
initialActions001001
loadScripts12121040179214812551596
setupStore6428369
WebpackHomeuiStartup9858301519173877944
load8617301309150794922
domContentLoaded8607301309150794921
domInteractive124301852414289
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2113100132133
firstReactRender18163031925
getState104771378
initialActions001001
loadScripts8437161288146780921
setupStore85851079
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 33 Bytes (0%)
  • common: 0 Bytes (0%)

@OGPoyraz OGPoyraz enabled auto-merge April 1, 2025 11:00
@metamaskbot
Copy link
Collaborator

Builds ready [4813373]
UI Startup Metrics (1209 ± 54 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1209111313375412491295
load10529561171521134979
domContentLoaded10469511166511141985
domInteractive17133651630
firstPaint754901175409230979
backgroundConnect96283910
firstReactRender19154241926
getState12436868
initialActions001001
loadScripts82874295150871910
setupStore7515279
WebpackHomeuiStartup1000729127580976995
load84458399075890953
domContentLoaded83757998776883947
domInteractive16124171434
firstPaint34656973332837920
backgroundConnect18135781640
firstReactRender16123351628
getState5313256
initialActions001000
loadScripts83557798576878945
setupStore7517279
FirefoxBrowserifyHomeuiStartup13581165197215813841746
load12221051183314912681576
domContentLoaded12211051183214912681576
domInteractive10041237279197
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23166072438
firstReactRender22183642530
getState7431479
initialActions001001
loadScripts12001035180314612481539
setupStore6422369
WebpackHomeuiStartup9728151494157884988
load8527131296141801909
domContentLoaded8527131296141801909
domInteractive120422012314196
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect19136382133
firstReactRender18162621823
getState8462978
initialActions001001
loadScripts8357001273136797952
setupStore105911478
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 33 Bytes (0%)
  • common: 0 Bytes (0%)

@OGPoyraz OGPoyraz added this pull request to the merge queue Apr 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 2, 2025
@OGPoyraz OGPoyraz added this pull request to the merge queue Apr 2, 2025
Merged via the queue into main with commit 523d163 Apr 2, 2025
147 checks passed
@OGPoyraz OGPoyraz deleted the fix/decimal-estimated-base-fee branch April 2, 2025 08:37
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2025
@metamaskbot metamaskbot added the release-12.17.0 Issue or pull request that will be included in release 12.17.0 label Apr 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.17.0 Issue or pull request that will be included in release 12.17.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants