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

feat(snaps): Add getAddressDisplayName selector #27868

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

GuillaumeRx
Copy link
Contributor

@GuillaumeRx GuillaumeRx commented Oct 15, 2024

Description

This PR adds a selector to get the display name or the address book entry for an address (in CAIP-10 or Hex format).

Open in GitHub Codespaces

Related issues

Manual testing steps

Screenshots/Recordings

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.

Copy link
Contributor

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 team-snaps-platform Snaps Platform team label Oct 15, 2024
@GuillaumeRx GuillaumeRx changed the title Add getAddressDisplayName selector feat(snaps): Add getAddressDisplayName selector Oct 16, 2024
@GuillaumeRx GuillaumeRx marked this pull request as ready for review October 16, 2024 09:58
@GuillaumeRx GuillaumeRx requested a review from a team as a code owner October 16, 2024 09:58
@GuillaumeRx GuillaumeRx force-pushed the gr/multichain-address-display-name branch from 3037ac7 to 240d3df Compare October 16, 2024 10:25
@metamaskbot
Copy link
Collaborator

Builds ready [240d3df]
Page Load Metrics (1667 ± 140 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint147229031668292140
domContentLoaded146028491636287138
load147428991667291140
domInteractive196531115
backgroundConnect1092332211
firstReactRender44196853215
getState55414157
initialActions00000
loadScripts10191969121818890
setupStore119220199
uiStartup161130481855304146
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 712 Bytes (0.01%)

david0xd
david0xd previously approved these changes Oct 16, 2024
);

return (
(accountName === '' ? undefined : accountName) ??
Copy link
Contributor Author

Choose a reason for hiding this comment

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

export function getAccountName(accounts, accountAddress) {
😅

Copy link
Member

Choose a reason for hiding this comment

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

Oh well, maybe good reason to use || then, Just leave a comment about why

@GuillaumeRx GuillaumeRx force-pushed the gr/multichain-address-display-name branch from f23eff0 to 6a45a0e Compare October 16, 2024 13:10
* @param {string} address - The address to get the display name for in a CAIP-10 format.
* @returns {string} The display name for the address.
*/
export const getAddressDisplayName = createDeepEqualSelector(
Copy link
Member

Choose a reason for hiding this comment

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

I don' think the memoization will be effective if we pass in the entire raw state. Wondering how we can structure this to only reference the state we need 🤔

Copy link

sonarcloud bot commented Oct 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants