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

refactor(snap-keyring): refactor Snap keyring implementation #30244

Merged
merged 8 commits into from
Feb 18, 2025

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Feb 11, 2025

Description

Refactor the current implementation with better typing and by re-organizing things a bit.

We have some new modifications coming up soon on the Snap keyring flows/logic, so I'd like to have this small refactor to come first to ease the incoming PR reviews.

Requires this one to be merged first:

Open in GitHub Codespaces

Related issues

N/A

Manual testing steps

  1. Run yarn start:flask
  2. Install the SSK: https://metamask.github.io/snap-simple-keyring/latest/
  3. Creates an SSK account
  • You should see the usual dialogs for non-preinstalled Snaps (account renaming, confirmation dialogs to create the account)
  1. Creates a Bitcoin/Solana account
  • Those are preinstalled, so some dialogs will be skipped
  1. Remove those accounts
  • You should see a dialog (to confirm the account deletion) upon the removal of an SSK account
  • You should not see the same dialog for Bitcoin/Solana

Screenshots/Recordings

Before

After

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.

@ccharly ccharly self-assigned this Feb 11, 2025
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.

@ccharly ccharly force-pushed the refactor/snap-keyring-impl branch from 704bee8 to da3122d Compare February 11, 2025 11:43
@metamaskbot
Copy link
Collaborator

Builds ready [da3122d]
Page Load Metrics (1828 ± 65 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint42820751763335161
domContentLoaded15432024179712058
load15562080182813465
domInteractive26102442512
backgroundConnect991302512
firstReactRender1580352211
getState55615147
initialActions01000
loadScripts11091572132111455
setupStore66220199
uiStartup17952365208615775
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 12.42 KiB (0.21%)
  • ui: 0 Bytes (0.00%)
  • common: -33.51 KiB (-0.36%)

@ccharly ccharly force-pushed the refactor/snap-keyring-impl branch 2 times, most recently from 5ad24ac to c319f07 Compare February 11, 2025 15:12
@ccharly ccharly marked this pull request as ready for review February 11, 2025 15:14
@ccharly ccharly requested a review from a team as a code owner February 11, 2025 15:14
@metamaskbot
Copy link
Collaborator

Builds ready [c319f07]
Page Load Metrics (1966 ± 187 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint63723441821325156
domContentLoaded155634611928393189
load156934691966389187
domInteractive23251525125
backgroundConnect1396402612
firstReactRender1891582311
getState65919189
initialActions00000
loadScripts113626821417324155
setupStore891202411
uiStartup180039472301461221
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.76 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@ccharly ccharly force-pushed the refactor/snap-keyring-impl branch from c319f07 to d01d898 Compare February 11, 2025 17:51
@metamaskbot
Copy link
Collaborator

Builds ready [d01d898]
Page Load Metrics (1636 ± 50 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint47718671575273131
domContentLoaded14331853161210450
load14451872163610450
domInteractive2494432512
backgroundConnect107224189
firstReactRender1596502914
getState56112157
initialActions01000
loadScripts1018139911739345
setupStore870192010
uiStartup16822168190313866
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.76 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@ccharly ccharly force-pushed the refactor/snap-keyring-impl branch from d01d898 to 5e64564 Compare February 17, 2025 09:37
@ccharly ccharly force-pushed the refactor/snap-keyring-impl branch from 5e64564 to 2027dea Compare February 17, 2025 10:18
@metamaskbot
Copy link
Collaborator

Builds ready [85ff164]
Page Load Metrics (1632 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14712004163312460
domContentLoaded14571974161412058
load14732010163212560
domInteractive2392372010
backgroundConnect96020157
firstReactRender1473472612
getState45311147
initialActions00000
loadScripts10091509118310852
setupStore66111126
uiStartup16892272187913766
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.75 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Co-authored-by: Daniel Rocha <[email protected]>
danroc
danroc previously approved these changes Feb 18, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [f0bd0b6]
Page Load Metrics (1553 ± 73 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint13831877155914971
domContentLoaded13571857153414670
load13651875155315373
domInteractive238138199
backgroundConnect85921167
firstReactRender1371352311
getState45713157
initialActions01000
loadScripts9571365111211455
setupStore65615168
uiStartup15632153176317785
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.74 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

montelaidev
montelaidev previously approved these changes Feb 18, 2025
@gantunesr gantunesr added this pull request to the merge queue Feb 18, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [0783263]
Page Load Metrics (1721 ± 89 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint36419231623311149
domContentLoaded14992328169218288
load15082333172118589
domInteractive157636157
backgroundConnect1081342512
firstReactRender1470312210
getState5391284
initialActions01000
loadScripts10521760121215775
setupStore661222010
uiStartup17232648196320297
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.87 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Merged via the queue into main with commit 6d08a65 Feb 18, 2025
73 checks passed
@gantunesr gantunesr deleted the refactor/snap-keyring-impl branch February 18, 2025 12:56
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2025
@metamaskbot metamaskbot added the release-12.14.0 Issue or pull request that will be included in release 12.14.0 label Feb 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.14.0 Issue or pull request that will be included in release 12.14.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants