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: swap src token balance on multichain network #30622

Merged
merged 6 commits into from
Feb 28, 2025

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Feb 27, 2025

Description

Changes include

  • Follow up changes to 30313 for addressing comments by @darkwing
  • Pass a srcChainId to AssetPicker when swapping so that the selected asset's balance is included in data

Open in GitHub Codespaces

Related issues

Fixes: N/A

Manual testing steps

  1. Open in Flask
  2. Go to Solana
  3. Select a token
  4. balance should be visible

Screenshots/Recordings

Before

After

Screenshot 2025-02-27 at 3 25 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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Team swaps and bridge label Feb 27, 2025
}
networkProps={{
network: fromChain,
networks: isSwap ? undefined : fromChains,
Copy link
Member Author

Choose a reason for hiding this comment

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

Main change here is to pass undefined networks bc user shouldn't be able to select from a list anyway

allNetworks[currentChainId as keyof typeof allNetworks];
const currentNetwork = useMultichainSelector(getMultichainCurrentNetwork);
const selectedNetwork = networkProps?.network ?? currentNetwork_;
const currentNetworkProviderConfig = useMultichainSelector(
Copy link
Member Author

Choose a reason for hiding this comment

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

Renaming variables here

@micaelae micaelae changed the title Mms fix sol swap balance fix: swap src token balance on multichain network Feb 27, 2025
@micaelae micaelae marked this pull request as ready for review February 27, 2025 22:30
@micaelae micaelae requested review from a team as code owners February 27, 2025 22:30
@micaelae micaelae enabled auto-merge February 27, 2025 22:37
ghgoodreau
ghgoodreau previously approved these changes Feb 27, 2025
ejwessel
ejwessel previously approved these changes Feb 27, 2025
GustavoRSSilva
GustavoRSSilva previously approved these changes Feb 27, 2025
darkwing
darkwing previously approved these changes Feb 27, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [5681b23]
Page Load Metrics (1706 ± 145 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint25020751461485233
domContentLoaded144527291678302145
load145527341706301145
domInteractive15127392713
backgroundConnect1066352110
firstReactRender147429199
getState46415189
initialActions01000
loadScripts101621121229252121
setupStore76817178
uiStartup161730671956345166
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 12 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [cde531e]
Page Load Metrics (1518 ± 37 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30316591455275132
domContentLoaded1372164615027536
load1380165915187737
domInteractive238240189
backgroundConnect94821147
firstReactRender1472282210
getState44810126
initialActions01000
loadScripts1000124011096732
setupStore75915168
uiStartup1587191017278641
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 12 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@micaelae micaelae added this pull request to the merge queue Feb 28, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [2233b98]
Page Load Metrics (1651 ± 52 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint35418471593303146
domContentLoaded1414180016249747
load14491845165110852
domInteractive259841199
backgroundConnect781282110
firstReactRender1470412512
getState54911126
initialActions01000
loadScripts1030138112019344
setupStore75411105
uiStartup16322317188115474
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 12 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Merged via the queue into main with commit 7c69fed Feb 28, 2025
79 checks passed
@micaelae micaelae deleted the mms-fix-sol-swap-balance branch February 28, 2025 00:41
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2025
@metamaskbot metamaskbot added the release-12.15.0 Issue or pull request that will be included in release 12.15.0 label Feb 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.15.0 Issue or pull request that will be included in release 12.15.0 team-swaps-and-bridge Team swaps and bridge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants