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 (patch): erc20 token prices on non-ETH networks #26450

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Aug 15, 2024

Description

Fixes an issue with erc20 token prices on networks where ETH is not the native currency.

When the price API does not support the native currency (e.g. MATIC), prices are fetched in ETH and an additional conversion hop is performed. But the extension was using the raw value without this additional hop.

This PR patches the relevant parts of MetaMask/core#4364.

Because that change is already in 12.1.0, this patch will no longer be needed in that version.

Open in GitHub Codespaces

Related issues

Manual testing steps

  1. Load a wallet on polygon with erc20 tokens
  2. Verify fiat prices are correct

Screenshots/Recordings

Before

Screenshot 2024-08-15 at 11 19 43 AM

After

Screenshot 2024-08-15 at 11 15 00 AM

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.

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.

@bergeron bergeron marked this pull request as ready for review August 15, 2024 18:21
@bergeron bergeron requested a review from a team as a code owner August 15, 2024 18:21
@@ -0,0 +1,52 @@
diff --git a/dist/chunk-6W5EQ3JQ.js b/dist/chunk-6W5EQ3JQ.js
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I patched both the .js and .mjs files, because I wasn't sure which was necessary

@bergeron bergeron requested a review from danjm August 15, 2024 19:04
@metamaskbot
Copy link
Collaborator

Builds ready [ece9eff]
Page Load Metrics (139 ± 177 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7312789147
domContentLoaded8171121
load411748139369177
domInteractive8171121

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.75%. Comparing base (985862b) to head (ece9eff).
Report is 1 commits behind head on Version-v12.0.5.

Additional details and impacted files
@@               Coverage Diff                @@
##           Version-v12.0.5   #26450   +/-   ##
================================================
  Coverage            65.75%   65.75%           
================================================
  Files                 1372     1372           
  Lines                54782    54782           
  Branches             14262    14262           
================================================
  Hits                 36020    36020           
  Misses               18762    18762           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danjm danjm merged commit e29f2cf into Version-v12.0.5 Aug 16, 2024
73 checks passed
@danjm danjm deleted the brian/patch-fallback-conversion-rate2 branch August 16, 2024 00:27
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants