Skip to content

fix: on send recipient page filter addresses by chain#24262

Merged
jpuri merged 2 commits intomainfrom
send_address_filtering
Jan 6, 2026
Merged

fix: on send recipient page filter addresses by chain#24262
jpuri merged 2 commits intomainfrom
send_address_filtering

Conversation

@jpuri
Copy link
Copy Markdown
Contributor

@jpuri jpuri commented Jan 6, 2026

Description

On send recipient page filter addresses by chain id.

Changelog

CHANGELOG entry:

Related issues

Fixes: #22810

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Screenshot 2026-01-06 at 5 06 44 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.

Note

Narrows recipient suggestions to the active chain.

  • useContacts now reads chainId from useSendContext and returns contacts only from addressBook[chainId], deduplicated
  • Preserves EVM-only validation (0x prefix, 42 chars, excludes LOWER_CASED_BURN_ADDRESSES); returns [] for isNonEvmSendType
  • Updates memo deps to include chainId
  • Test suite updated to mock useSendContext, expect chain-scoped results, handle hex chain IDs (e.g., 0x1), and cover burn/invalid address filtering and empty/edge cases

Written by Cursor Bugbot for commit b12adcf. This will update automatically on new commits. Configure here.

@jpuri jpuri requested a review from a team as a code owner January 6, 2026 11:44
@jpuri jpuri added team-confirmations Push issues to confirmations team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Jan 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 6, 2026

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.

@github-actions github-actions bot added the size-S label Jan 6, 2026
@jpuri jpuri enabled auto-merge January 6, 2026 11:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 6, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmationsRedesigned
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

The changes modify the useContacts hook in the confirmations/send flow to filter contacts by the current chainId instead of showing all contacts from all chains. This is a behavioral change that affects how recipients are displayed in the send flow.

Key changes:

  1. useContacts.ts now uses useSendContext to get the current chainId and filters the address book to only show contacts for that specific chain
  2. The test file has been updated to reflect this new chain-specific filtering behavior

The change is well-scoped to the confirmations send flow and has corresponding unit test updates. The useContacts hook is used by the Recipient component which is part of the send confirmation flow.

Since this directly affects the confirmation/send flow UI and behavior, the SmokeConfirmationsRedesigned tag is the most appropriate to verify this change works correctly in E2E tests.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Jan 6, 2026

@jpuri jpuri added this pull request to the merge queue Jan 6, 2026
Merged via the queue into main with commit 895b7b7 Jan 6, 2026
92 checks passed
@jpuri jpuri deleted the send_address_filtering branch January 6, 2026 12:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2026
@metamaskbot metamaskbot added the release-7.62.0 Issue or pull request that will be included in release 7.62.0 label Jan 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.62.0 Issue or pull request that will be included in release 7.62.0 size-S team-confirmations Push issues to confirmations team

Projects

None yet

3 participants