chore: checks if not undefined for non-evm conversion rates #30391
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently every time we initially create an account we get
null
values from formatNonEvmAssetCurrencyDisplay because theconversionRate
is zero0
for non-evm assets (BTC/SOL). And when this happens, since zero0
evaluates asfalse
we will get anull
from theformatNonEvmAssetCurrencyDisplay
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.yarn
shared/lib/accounts/solana-wallet-snap.ts
with:export const SOLANA_WALLET_SNAP_ID: SnapId = 'local:http://localhost:8080' as SnapId;
yarn start:flask
yarn
yarn start
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist