Skip to content

enhance, cleanup, rename chain agnostic permission utilities#31748

Merged
adonesky1 merged 4 commits intosip-26from
ad/sip-26-enhance-chain-agnostic-permission-utilities
Apr 9, 2025
Merged

enhance, cleanup, rename chain agnostic permission utilities#31748
adonesky1 merged 4 commits intosip-26from
ad/sip-26-enhance-chain-agnostic-permission-utilities

Conversation

@adonesky1
Copy link
Copy Markdown
Contributor

@adonesky1 adonesky1 commented Apr 8, 2025

Attempt to address some concerns about time complexity raised by @FrederikBolding

rename and reorganize these helpers for easier navigation.

I have an open PR against core here where I've made the improvements + name changes that can be reviewed and merged immediately after 12.17.0 cut

@adonesky1 adonesky1 requested a review from a team as a code owner April 8, 2025 21:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2025

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.

@metamaskbot metamaskbot added team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead INVALID-PR-TEMPLATE PR's body doesn't match template labels Apr 8, 2025
@metamaskbot
Copy link
Copy Markdown
Collaborator

✨ Files requiring CODEOWNER review ✨

🖥️ @MetaMask/wallet-ux

  • ui/components/multichain/connected-status/connected-status.tsx

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previously getAllAccountIdsFromCaip25CaveatValue

Comment on lines 17 to 31
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previously was:

export function getAllAccountsFromScopesObjects(
  scopesObjects: InternalScopesObject[],
): CaipAccountId[] {
  return Array.from(
    new Set([...scopesObjects.flatMap(getAllAccountsFromScopesObject)]),
  );
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The main thing that needed to be removed was the two extra uniques, which this does

Comment on lines 20 to 32
Copy link
Copy Markdown
Contributor Author

@adonesky1 adonesky1 Apr 8, 2025

Choose a reason for hiding this comment

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

Previously was:

export function getAllScopesFromScopesObjects(
  scopesObjects: InternalScopesObject[],
): InternalScopeString[] {
  return Array.from(
    new Set([...scopesObjects.flatMap(getAllScopesFromScopesObject)]),
  );
}

@adonesky1 adonesky1 mentioned this pull request Apr 9, 2025
7 tasks
@adonesky1 adonesky1 force-pushed the ad/sip-26-enhance-chain-agnostic-permission-utilities branch from f208507 to 2946089 Compare April 9, 2025 16:06
@adonesky1 adonesky1 force-pushed the ad/sip-26-enhance-chain-agnostic-permission-utilities branch from 2946089 to cdfb8b3 Compare April 9, 2025 16:21
@adonesky1 adonesky1 merged commit 1d9aa2f into sip-26 Apr 9, 2025
9 of 11 checks passed
@adonesky1 adonesky1 deleted the ad/sip-26-enhance-chain-agnostic-permission-utilities branch April 9, 2025 17:01
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2025
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [cdfb8b3]
UI Startup Metrics (1232 ± 70 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1232110815867012681353
load10759311401741177987
domContentLoaded10699251397741213993
domInteractive17135961628
firstPaint724791401436249975
backgroundConnect7422279
firstReactRender19154861930
getState13534779
initialActions001001
loadScripts826686109471847932
setupStore8516279
WebpackHomeuiStartup21901708267117523072467
load17521370227015818092096
domContentLoaded17411365226115018012020
domInteractive171272111448
firstPaint161722975424291
backgroundConnect359279404289
firstReactRender15255348995988
getState27431458519
initialActions318135
loadScripts17331362222614717911990
setupStore24627137329
FirefoxBrowserifyHomeuiStartup14101201193513014771670
load12661044180713413291540
domContentLoaded12651043180613413291539
domInteractive10240188278696
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect20146982034
firstReactRender23205152431
getState7425388
initialActions001001
loadScripts12471031179313413151522
setupStore6436567
WebpackHomeuiStartup15141316179510815781732
load1307114515639713751500
domContentLoaded1307114515629713751500
domInteractive9340226268798
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22158082239
firstReactRender34284753744
getState1243263279
initialActions002111
loadScripts1289112715429613601478
setupStore8549589

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants