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

chore: checks if not undefined for non-evm conversion rates #30391

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zone-live
Copy link
Contributor

@zone-live zone-live commented Feb 18, 2025

Description

Currently every time we initially create an account we get null values from formatNonEvmAssetCurrencyDisplay because the conversionRate is zero 0 for non-evm assets (BTC/SOL). And when this happens, since zero 0 evaluates as false we will get a null from the formatNonEvmAssetCurrencyDisplay method.
Therefore we need to allow the initial zero value and just make sure it's not undefined.

Related issues

Fixes:

Manual testing steps

You can try to do a fresh install of flask extension in branch main vs this one, and add a Solana account.

  1. Checkout this branch and run yarn
  2. Update the file shared/lib/accounts/solana-wallet-snap.ts with:
    export const SOLANA_WALLET_SNAP_ID: SnapId = 'local:http://localhost:8080' as SnapId;
  3. Run the extension with yarn start:flask
  4. Run the Snap: https://github.com/MetaMask/snap-solana-wallet
    • Clone it
    • Run yarn
    • Run yarn start
  5. Go to http://localhost:3000/
  6. Install the Snap
  7. In the extension, go to the Settings > Experimental > Enable Solana account
  8. Add a Solana account
  9. Check for the UI differences

Screenshots/Recordings

Before

Screenshot 2025-02-18 at 14 00 31

After

Screenshot 2025-02-18 at 13 54 52

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.

@metamaskbot metamaskbot added the team-sol PRs from the Solana snap team label Feb 18, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [038db1c]
Page Load Metrics (1697 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14632102169713967
domContentLoaded14532071166713163
load14652106169714168
domInteractive246833136
backgroundConnect1075342110
firstReactRender1596342612
getState46415188
initialActions01000
loadScripts10451531121811756
setupStore75616168
uiStartup17912389196313665
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 12 Bytes (0.00%)

@zone-live zone-live changed the title chore: checks if undefined chore: checks if not undefined for non-evm conversion rates Feb 18, 2025
@zone-live zone-live marked this pull request as ready for review February 18, 2025 15:10
@zone-live zone-live requested a review from ccharly February 18, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-sol PRs from the Solana snap team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants