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: fix usd amount in swap notifications #25444

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

matteoscurati
Copy link
Contributor

@matteoscurati matteoscurati commented Jun 20, 2024

Description

This PR fixes the fiat (USD) conversion for the values displayed in the Swap notifications.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

image

After

Screenshot 2024-06-20 at 18 00 31

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.

@matteoscurati matteoscurati added the team-notifications Notifications team label Jun 20, 2024
@matteoscurati matteoscurati marked this pull request as ready for review June 20, 2024 16:14
@matteoscurati matteoscurati requested review from a team as code owners June 20, 2024 16:14
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.

Comment on lines +263 to +266
const amountInEther = calcTokenAmount(
amount,
parseFloat(decimals),
).toNumber();
Copy link
Contributor

Choose a reason for hiding this comment

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

My only concern is how this is a different method compared to portfolio.

In portfolio we are using Ethers+BigNumber.js so little conversion loss.
But extension may have some formatting.

... we can deal with this in the future lolol

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.96%. Comparing base (9e810ee) to head (7797d88).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25444      +/-   ##
===========================================
+ Coverage    64.95%   64.96%   +0.01%     
===========================================
  Files         1385     1385              
  Lines        54925    54925              
  Branches     14408    14408              
===========================================
+ Hits         35673    35678       +5     
+ Misses       19252    19247       -5     

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

@metamaskbot
Copy link
Collaborator

Builds ready [7797d88]
Page Load Metrics (222 ± 252 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint63196892813
domContentLoaded9141011
load391951222525252
domInteractive9141011
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 38 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@matteoscurati matteoscurati merged commit f26f4bb into develop Jun 20, 2024
74 checks passed
@matteoscurati matteoscurati deleted the fix/fix-usd-amount-for-swap-notifications branch June 20, 2024 17:11
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-notifications Notifications team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants