-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor: Refactor keyring controller to use modular init pattern #20732
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
Conversation
22572a0 to
3517cbc
Compare
Co-authored-by: Charly Chevalier <charlyy.chevalier@gmail.com>
|
|
|
||
| qrKeyringBuilder.type = QrKeyring.type; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Cosmetic:
| qrKeyringBuilder.type = QrKeyring.type; | |
| qrKeyringBuilder.type = QrKeyring.type; |
| const bridge = new LedgerMobileBridge(new LedgerTransportMiddleware()); | ||
| const ledgerKeyringBuilder = () => new LedgerKeyring({ bridge }); | ||
| ledgerKeyringBuilder.type = LedgerKeyring.type; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Cosmetic:
| new HdKeyring({ | ||
| cryptographicFunctions: { pbkdf2Sha512: pbkdf2 }, | ||
| }); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Cosmetic:


Description
This refactors the keyring controller to use modular init.
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Moves keyring setup from Engine into modular init functions with dedicated messengers, updates Engine to use them, and adds supporting types and tests.
HdKeyring/LedgerKeyring/QrKeyringbuilders and directKeyringControllerconstruction and encryptor wiring.initialKeyringState,qrKeyringScanner, and (keyring-snaps)removeAccountintoinitModularizedControllersand retrievesKeyringControllerfromcontrollersByName.keyring-controller-initto constructKeyringController(configuresEncryptor,HdKeyring,LedgerKeyring,QrKeyring, and (keyring-snaps)SnapKeyringBuilder).snap-keyring-builder-initto createSnapKeyringbuilder; persists keyrings via init messenger and usesremoveAccounthelper.keyring-controller-messengerandsnap-keyring-builder-messenger(plus init messenger) and registers them inmessengers/index.typesand init request to includeinitialKeyringState,qrKeyringScanner, and (keyring-snaps)removeAccount; addsKeyringControllerandSnapKeyringBuilderto controller maps.SnapKeyringBuilderinterface (name/state metadata).Written by Cursor Bugbot for commit 47db4a3. This will update automatically on new commits. Configure here.