Skip to content

Commit ee543fa

Browse files
authored
feat: add patch code from PR 23903 to keyringController. (#4256)
This PR apply patch code from this [PR](MetaMask/metamask-extension#23903) to keyringController to fix the issue found in this [issue](MetaMask/metamask-extension#23804) ## References [PR 23903](MetaMask/metamask-extension#23903) Fix [Issue 23804](MetaMask/metamask-extension#23804) <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? For example: * Fixes #12345 * Related to #67890 --> ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/keyring-controlller` - **Fixed**: Fix creation of new QR keyrings - Previously the QR keyring would get initialized with invalid state when created for the first time ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
1 parent bc29a61 commit ee543fa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/keyring-controller/src/KeyringController.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,9 +1643,7 @@ export class KeyringController extends BaseController<
16431643
this.#assertControllerMutexIsLocked();
16441644

16451645
// QRKeyring is not yet compatible with Keyring type from @metamask/utils
1646-
return (await this.#newKeyring(KeyringTypes.qr, {
1647-
accounts: [],
1648-
})) as unknown as QRKeyring;
1646+
return (await this.#newKeyring(KeyringTypes.qr)) as unknown as QRKeyring;
16491647
}
16501648

16511649
/**
@@ -1987,7 +1985,7 @@ export class KeyringController extends BaseController<
19871985
* @returns The new keyring.
19881986
* @throws If the keyring includes duplicated accounts.
19891987
*/
1990-
async #newKeyring(type: string, data: unknown): Promise<EthKeyring<Json>> {
1988+
async #newKeyring(type: string, data?: unknown): Promise<EthKeyring<Json>> {
19911989
this.#assertControllerMutexIsLocked();
19921990

19931991
const keyringBuilder = this.#getKeyringBuilderForType(type);

0 commit comments

Comments
 (0)