-
-
Notifications
You must be signed in to change notification settings - Fork 252
refactor(multichain-account-service): Improved performance across package classes and improved error messages #6654
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
base: main
Are you sure you want to change the base?
Changes from 42 commits
aa318fe
17e855f
924a679
be8b2f7
b49f7b4
a261e1e
6104131
c45f612
acf36e0
ce3cef4
891fa50
83060d6
01096bf
4c2e582
43972f8
7cec854
f05e6da
e325c77
6c5b86e
7d805ef
6b6e776
33e5e34
f4d79c0
350aa93
ce322e0
31a6d71
4c485a6
c82de17
7d6e76a
2d55dbd
b8a87ff
92d1c3a
8dedd1a
11cc131
d28a324
f308e9f
8bc1237
19cfdf3
82fece8
c812a82
91aa52e
4b19ed5
5bcaa53
c12435a
e9ab58d
521a71b
1162348
31f0193
7128b55
0c9324c
6b15c2d
0ec9181
98db5d3
98d6373
5733fac
eab65ca
99d70dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -20,7 +20,7 @@ | |||||||||||||
import { SnapStatus } from '@metamask/snaps-utils'; | ||||||||||||||
import type { CaipChainId } from '@metamask/utils'; | ||||||||||||||
import type { V4Options } from 'uuid'; | ||||||||||||||
import * as uuid from 'uuid'; | ||||||||||||||
|
||||||||||||||
import type { | ||||||||||||||
AccountsControllerActions, | ||||||||||||||
|
@@ -2777,6 +2777,26 @@ | |||||||||||||
}); | ||||||||||||||
}); | ||||||||||||||
|
||||||||||||||
describe('getAccounts', () => { | ||||||||||||||
it('returns a list of accounts based on the given account IDs', () => { | ||||||||||||||
const { accountsController } = setupAccountsController({ | ||||||||||||||
initialState: { | ||||||||||||||
internalAccounts: { | ||||||||||||||
accounts: { | ||||||||||||||
[mockAccount.id]: mockAccount, | ||||||||||||||
[mockAccount2.id]: mockAccount2, | ||||||||||||||
}, | ||||||||||||||
selectedAccount: mockAccount.id, | ||||||||||||||
}, | ||||||||||||||
}, | ||||||||||||||
}); | ||||||||||||||
|
||||||||||||||
const result = accountsController.getAccounts([mockAccount.id]); | ||||||||||||||
|
||||||||||||||
expect(result).toStrictEqual([mockAccount]); | ||||||||||||||
Comment on lines
+2794
to
+2796
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use multiple accounts instead?
Suggested change
|
||||||||||||||
}); | ||||||||||||||
}); | ||||||||||||||
|
||||||||||||||
describe('getSelectedAccount', () => { | ||||||||||||||
it.each([ | ||||||||||||||
{ | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably also split this from this PR. For similar reasons (see my other comment about |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||||
|
||||||
## [Unreleased] | ||||||
|
||||||
### Added | ||||||
|
||||||
- Add actions for `createNewVaultAndKeychain` and `createNewVaultAndRestore` ([#6654](https://github.com/MetaMask/core/pull/6708)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- These actions are meant to to be consumed by the `MultichainAccountService` in its `createMultichainAccountWallet` method. | ||||||
|
||||||
### Changed | ||||||
|
||||||
- Bump `@metamask/utils` from `^11.4.2` to `^11.8.1` ([#6588](https://github.com/MetaMask/core/pull/6588), [#6708](https://github.com/MetaMask/core/pull/6708)) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe those change should be splitted in another PR. The main reason would be that we would need to first release the But I think we don't allow minor bump for peer dep... We might want to check with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok that's fair, I can split off the keyring controller and accounts controller changes |
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.