Skip to content

Commit bc8a523

Browse files
authored
chore(runway): cherry-pick fix: prevent quote error during bridge destination account selection (#15617)
- fix: cp-7.47.0 prevent quote error during bridge destination account selection (#15594) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Fixes bug where a quote fetch error was being thrown during the destination account selection process of EVM <> bridges. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Related issues** Fixes: ## **Manual testing steps** 1. Open the Bridge screen. 2. Select a source token (e.g., SOL) and enter an amount (e.g., 0.01). 3. Select a destination token (e.g., ETH) — quote is fetched. 4. Now change the destination address (account). 5. Observe no error message shown at the bottom. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** ![image](https://github.com/user-attachments/assets/7cb09b12-cb87-4188-8b79-e5b07c96ecd0) https://github.com/user-attachments/assets/35665580-7504-4bd4-9b1c-ff95ea440741 <!-- [screenshots/recordings] --> ### **After** <img width="340" alt="Screenshot 2025-05-23 at 13 14 48" src="https://github.com/user-attachments/assets/0dfbe35b-28d1-4a16-b109-cf1e6b3c50cc" /> <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. [57762d7](57762d7)
2 parents b2a824d + 3aa9c53 commit bc8a523

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5050
- fix(bridge): show "Auto" slippage for Solana swaps
5151
- fix(bridge): add insufficient balance check for Solana swaps
5252
- fix(bridge): disable Solana as destination network if no Solana account exists
53+
- fix(bridge): prevent quote error during bridge destination account selection
5354

5455
## [7.46.0]
5556

app/components/UI/Bridge/Views/BridgeView/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
selectIsSubmittingTx,
3838
setIsSubmittingTx,
3939
selectIsSolanaToEvm,
40+
selectDestAddress,
4041
} from '../../../../../core/redux/slices/bridge';
4142
import {
4243
useNavigation,
@@ -105,6 +106,7 @@ const BridgeView = () => {
105106
const sourceToken = useSelector(selectSourceToken);
106107
const destToken = useSelector(selectDestToken);
107108
const destChainId = useSelector(selectSelectedDestChainId);
109+
const destAddress = useSelector(selectDestAddress);
108110
const {
109111
activeQuote,
110112
isLoading,
@@ -153,7 +155,12 @@ const BridgeView = () => {
153155
sourceAmount !== undefined && sourceAmount !== '.' && sourceToken?.decimals;
154156

155157
const hasValidBridgeInputs =
156-
isValidSourceAmount && !!sourceToken && !!destToken;
158+
isValidSourceAmount &&
159+
!!sourceToken &&
160+
!!destToken &&
161+
// Prevent quote fetching when destination address is not set
162+
// Destinations address is only needed for EVM <> Solana bridges
163+
(!isEvmSolanaBridge || (isEvmSolanaBridge && !!destAddress));
157164

158165
const hasInsufficientBalance = useIsInsufficientBalance({
159166
amount: sourceAmount,

0 commit comments

Comments
 (0)