fix(rewards): resolve Ondo position swap account picker missing balances for checksummed token addresses cp-7.74.0#29039
Conversation
…ces for checksummed token addresses Token addresses in allTokenBalances are stored in EIP-55 checksummed form, but the lookup used a lowercased key — causing a case-sensitive miss. Switch to a case-insensitive Object.entries find in both getAccountsWithBalance and getGroupBalance. Also remove the stale selectedGroup dep from handleRowPress and drop the incorrect total-balance label from the account picker sheet header. Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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. |
Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…ap picker Re-introduce the subscription account guard in getAccountsWithBalance so only accounts enrolled in the active subscription are eligible for the account picker, regardless of whether they hold a token balance. Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Why no E2E tags are needed:
Performance Test Selection: |
|



Description
The account picker opens when tapping a position and the token balance is either spread across multiple accounts, or held entirely on an account other than the currently active one. This lets the user select which account's balance they want to swap from.
Changelog
CHANGELOG entry: null
Screenshots/Recordings
What is opened if a position is spread around more than 1 account, or if the position is completely tied to another account different then the active one.
Note
Medium Risk
Touches balance lookup and account-group selection branching for the Ondo swap flow; errors could cause incorrect picker behavior or misreported balances, but the change is localized and covered by new regression tests.
Overview
Fixes Ondo portfolio swap balance detection by making
allTokenBalanceslookups case-insensitive (so EIP-55 checksummed token-address keys no longer read as zero), affecting both per-account filtering and per-group balance totals.Updates the account-picker decision logic to only bypass the picker when the currently selected group is the sole group with balance (removing the implicit group-switch side effect), and simplifies the picker sheet header by dropping the incorrect total-balance label. Tests are updated/expanded to cover the checksummed-address regression, subscription filtering, and selected-group branching.
Reviewed by Cursor Bugbot for commit a73db3a. Bugbot is set up for automated code reviews on this repo. Configure here.