Skip to content

fix: hides fromtoken from the totokenpicker #33857

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 2 commits into from
Jun 25, 2025

Conversation

ghgoodreau
Copy link
Contributor

@ghgoodreau ghgoodreau commented Jun 23, 2025

Description

Fixes a bug where you can select the same fromToken and toToken on Solana during swapping.

Open in GitHub Codespaces

Related issues

Fixes: #32668

Manual testing steps

  1. Go to Solana swap page
  2. Try to select the same from and toTokens
  3. Should be impossible with native (SOL) and non-native (USDC) tokens

Screenshots/Recordings

Before

With SOL as source token:
Screenshot 2025-06-25 at 12 36 35 PM

After

With SOL as source token:
Screenshot 2025-06-25 at 12 37 55 PM

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-swaps-and-bridge For issues with Swaps or Bridging label Jun 23, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Jun 23, 2025

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (1 files, +30 -12)
  • 📁 ui/
    • 📁 hooks/
      • 📁 bridge/
        • 📄 useTokensWithFiltering.ts +30 -12

@metamaskbot
Copy link
Collaborator

Builds ready [59ffda2]
UI Startup Metrics (1310 ± 83 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1310117715278313671457
load112397713478411831294
domContentLoaded111697013368311741287
domInteractive19154361833
firstPaint71687134346511441271
backgroundConnect84263814
firstReactRender2417165162339
getState1664882132
initialActions001001
loadScripts8557201078829091005
setupStore106365926
WebpackHomeuiStartup21791763267620722632640
load16551275210517517541987
domContentLoaded16491269209917417461973
domInteractive171279141356
firstPaint1656141373185308
backgroundConnect229271262139
firstReactRender25290544120383406
getState1143051320
initialActions316134
loadScripts16461265209017217431962
setupStore1574161825
FirefoxBrowserifyHomeuiStartup1335119516779913721567
load1172105113887012161302
domContentLoaded1172105113887012161302
domInteractive1143550171119280
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect19136762029
firstReactRender23205042330
getState10510912928
initialActions001001
loadScripts1155103413746911951283
setupStore1046913946
WebpackHomeuiStartup16971469225917018072071
load14611229193314615971693
domContentLoaded14611228193314615961693
domInteractive98333405896310
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23174652532
firstReactRender46376544853
getState148105111435
initialActions102111
loadScripts14401212190514615741673
setupStore1054261023
cc: @HowardBraham
Benchmark value 1311 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1123 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1116 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 25 exceeds gate value 23 for chrome browserify home mean firstReactRender
Benchmark value 16 exceeds gate value 15 for chrome browserify home mean getState
Benchmark value 855 exceeds gate value 830 for chrome browserify home mean loadScripts
Benchmark value 1457 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 1294 exceeds gate value 1190 for chrome browserify home p95 load
Benchmark value 1287 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded
Benchmark value 1271 exceeds gate value 1180 for chrome browserify home p95 firstPaint
Benchmark value 1005 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 26 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 253 exceeds gate value 235 for chrome webpack home mean firstReactRender
Benchmark value 2640 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 406 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 114 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 280 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 28 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 46 exceeds gate value 27 for firefox browserify home p95 setupStore
Benchmark value 1698 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1462 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1461 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 47 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1441 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 2071 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1693 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1693 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 310 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 53 exceeds gate value 50 for firefox webpack home p95 firstReactRender
Benchmark value 35 exceeds gate value 32 for firefox webpack home p95 getState
Benchmark value 1673 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 572ms | Sum of p95 exceeds: 1203ms
Sum of all benchmark exceeds: 1775ms

Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 50 Bytes (0%)
  • common: 0 Bytes (0%)

@ghgoodreau ghgoodreau changed the title fix: hides fromtoken from the dotokenpicker fix: hides fromtoken from the totokenpicker Jun 24, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [67e0b81]
UI Startup Metrics (1195 ± 71 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1195108113697112411339
load103090912227310801155
domContentLoaded102490312167210731148
domInteractive17133851731
firstPaint65274122041610381131
backgroundConnect74213711
firstReactRender22164452338
getState1363871726
initialActions001001
loadScripts821703101272867943
setupStore85243917
WebpackHomeuiStartup21711747267120722752602
load16631289205817917561951
domContentLoaded16571285205217817531948
domInteractive171171141361
firstPaint1686442066209288
backgroundConnect2813282452242
firstReactRender21689416119367400
getState134310301126
initialActions215134
loadScripts16541284204317617511946
setupStore217303461725
FirefoxBrowserifyHomeuiStartup1412126516889714581635
load1237110914237512901379
domContentLoaded1237110914237512901378
domInteractive1123629936126179
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect28141882626101
firstReactRender25225142530
getState1159313920
initialActions001001
loadScripts1213109313997512641363
setupStore949714726
WebpackHomeuiStartup15891361224617916781968
load13831172194915214841674
domContentLoaded13821172194915214831674
domInteractive100314736993286
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21154352235
firstReactRender40314934247
getState1273761130
initialActions002111
loadScripts13641155191915114641656
setupStore85345818
Benchmark value 944 exceeds gate value 940 for chrome browserify home p95 loadScripts
Benchmark value 2602 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 62 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 400 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 1413 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 112 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 29 exceeds gate value 25 for firefox browserify home mean backgroundConnect
Benchmark value 26 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 101 exceeds gate value 70 for firefox browserify home p95 backgroundConnect
Benchmark value 1383 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1383 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1365 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 1968 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1674 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1674 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 286 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 1656 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 30ms | Sum of p95 exceeds: 435ms
Sum of all benchmark exceeds: 465ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 159.97 KiB (2.99%)
  • ui: 7.1 KiB (0.1%)
  • common: 21.1 KiB (0.25%)

@ghgoodreau ghgoodreau marked this pull request as ready for review June 25, 2025 19:06
@ghgoodreau ghgoodreau requested a review from a team as a code owner June 25, 2025 19:06
@ghgoodreau ghgoodreau added this pull request to the merge queue Jun 25, 2025
Merged via the queue into main with commit ee356a2 Jun 25, 2025
155 checks passed
@ghgoodreau ghgoodreau deleted the MMS-2643-from-and-to-addrs-fix branch June 25, 2025 19:57
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2025
@metamaskbot metamaskbot added the release-12.23.0 Issue or pull request that will be included in release 12.23.0 label Jun 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.23.0 Issue or pull request that will be included in release 12.23.0 team-swaps-and-bridge For issues with Swaps or Bridging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Solana - Swap - I am able to select the same from and destination tokens on the Swap page
4 participants