-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
chore(deps): bump @metamask/keyring-api to 6.0.0, @metamask/eth-snap-keyring to 4.0.0 and snap dependencies #4193
chore(deps): bump @metamask/keyring-api to 6.0.0, @metamask/eth-snap-keyring to 4.0.0 and snap dependencies #4193
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/json-rpc-middleware-stream@6.0.2, npm/@types/deep-freeze-strict@1.1.2, npm/@types/punycode@2.1.4 |
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
const internalAccount = this.getAccount(accountId); | ||
return internalAccount ? internalAccount.metadata[metadataKey] : undefined; |
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.
Normally getAccount
will return either an InternalAccount
or undefined
so I guess we can use this notation:
const internalAccount = this.getAccount(accountId); | |
return internalAccount ? internalAccount.metadata[metadataKey] : undefined; | |
return internalAccount?.metadata[metadataKey]; |
If you find it less clear, we can keep yours!
* @returns The value of the specified metadata key, or undefined if the account or metadata key does not exist. | ||
*/ | ||
#populateExistingMetadata<T extends keyof InternalAccount['metadata']>( | ||
accountId: string, |
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.
This could be undefined
as well with this expression: existingAccount?.id
?
I believe there's always a "previous account" during the update, but in terms of typing this could be undefined
(hence the ?
)
What about new accounts, they are not used in then updateAccounts
methods, right?
? existingAccount.metadata.name | ||
: `${keyringTypeName} ${keyringAccountIndex + 1}`, | ||
lastSelected: existingAccount?.metadata?.lastSelected, | ||
this.#populateExistingMetadata(existingAccount?.id, 'name') ?? |
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.
Related to my other comment that exitstingAccount?.id
could be undefined
. I guess we can use internalAccount.id
here directly, no? This way we know it's not "potentially" undefined
?
Explanation
This PR bumps the
@metamask/keyring-api
,@metamask/eth-snap-keyring
and snap dependencies in theAccountsController
References
Resolves: 4135
Changelog
@metamask/accounts-controller
@metamask/keyring-api
to^6.0.0
@metamask/eth-snap-keyring
to^4.0.0
@metamask/snaps-controller
to^7.0.1
@metamask/snaps-sdk
to^4.0.1
@metamask/snaps-utils
to^7.1.0
Checklist