-
-
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
refactor: use internalAccount
instead of account address for granular updates
#4693
Conversation
@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.
|
@@ -1104,7 +1104,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag | |||
}); | |||
|
|||
await controller.saveInternalAccountToUserStorage( | |||
MOCK_INTERNAL_ACCOUNTS.ONE[0].address, | |||
MOCK_INTERNAL_ACCOUNTS.ONE[0] as InternalAccount, |
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.
Just want to make sure, is this assertion valid? If so then all good!
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.
Yes definitely! It's just that my data doesn't 100% intersect with type InternalAccount
since it misses some keys we don't really care about, and I didn't want to bloat up the fixtures.
@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.
|
This PR replaces the parameter for
UserStorageController
saveInternalAccountToUserStorage
from an account address to anInternalAccount
.This helps because we're listening to
AccountsController
events and they are passing anInternalAccount
as their return value. By using this return value directly, we remove some unnecessary logic & queries.Explanation
References
Changelog
@metamask/profile-sync-controller
InternalAccount
instead of account address forsaveInternalAccountToUserStorage
parameterChecklist