Skip to content

feat: add selector helpers#29625

Merged
n3ps merged 3 commits into
mainfrom
n3ps/extract-selector-changes-5d9b
May 4, 2026
Merged

feat: add selector helpers#29625
n3ps merged 3 commits into
mainfrom
n3ps/extract-selector-changes-5d9b

Conversation

@n3ps

@n3ps n3ps commented May 1, 2026

Copy link
Copy Markdown
Contributor

Description

Create selectors to be used for the Accounts v4 API migration of the Activity list

Part of breaking down the PR into smaller chunks

Changelog

CHANGELOG entry: null

Related issues

Fixes:

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

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Low Risk
Low risk: adds two small selectors and unit tests without changing existing selection logic or mutating state. Main risk is minor formatting/edge cases when converting hex chain IDs to CAIP strings.

Overview
Adds selectEvmAddress to return the currently selected account address only when the selected internal account is EVM (otherwise undefined).

Adds selectEvmEnabledCaipNetworks to expose enabled EVM networks as CAIP chain IDs by converting the hex eip155 chain IDs returned from selectEVMEnabledNetworks into decimal CAIP strings, with focused unit tests for both selectors.

Reviewed by Cursor Bugbot for commit c7dac4b. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@n3ps n3ps added the team-core-extension-ux Core Extension UX team label May 1, 2026
@n3ps n3ps enabled auto-merge May 1, 2026 18:25
@github-actions github-actions Bot added the size-S label May 1, 2026
@n3ps n3ps changed the title feat: add EVM account selector helpers feat: add account selector helpers May 1, 2026
@n3ps n3ps changed the title feat: add account selector helpers feat: add selector helpers May 1, 2026
cursoragent and others added 2 commits May 1, 2026 18:49
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR adds two new memoized selectors:

  1. selectEvmAddress in app/selectors/accountsController.ts - Returns the EVM address of the selected internal account, or undefined for non-EVM accounts (e.g., Solana). This is a purely additive export.

  2. selectEvmEnabledCaipNetworks in app/selectors/networkEnablementController/index.ts - Converts enabled EVM network chain IDs to CAIP format strings (e.g., eip155:1). Also purely additive.

Key findings from investigation:

  • Both new selectors are ONLY referenced in their respective unit test files (confirmed via grep_codebase). No components, hooks, or other modules consume them yet.
  • No existing selectors were modified - these are pure additions.
  • The changes carry no risk to existing functionality since nothing depends on them.
  • The test files are unit tests (.test.ts), not E2E tests.

Since these selectors have no consumers yet and no existing code was modified, there is no user-facing behavior change that requires E2E validation. No E2E test tags are needed.

Performance Test Selection:
The changes are purely additive new selector exports with no consumers yet. They don't affect any UI rendering, data loading pipelines, or critical user flows. No performance impact is expected.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 1, 2026

Copy link
Copy Markdown

@n3ps n3ps added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 5ac9bdf May 4, 2026
61 checks passed
@n3ps n3ps deleted the n3ps/extract-selector-changes-5d9b branch May 4, 2026 14:27
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-S team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants