Skip to content

Commit

Permalink
fix(accounts-controller): re-use internal state in updateAccounts sta…
Browse files Browse the repository at this point in the history
…te update
  • Loading branch information
ccharly committed Jan 16, 2025
1 parent 153e6f8 commit bb5ab3f
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 125 deletions.
8 changes: 5 additions & 3 deletions packages/accounts-controller/src/AccountsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,7 @@ describe('AccountsController', () => {
...mockAccount,
metadata: {
...mockAccount.metadata,
name: `${keyringTypeToName(KeyringTypes.snap)} 1`,
keyring: {
type: KeyringTypes.snap,
},
Expand All @@ -1423,6 +1424,7 @@ describe('AccountsController', () => {
...mockAccount2,
metadata: {
...mockAccount2.metadata,
name: `${keyringTypeToName(KeyringTypes.snap)} 2`,
keyring: {
type: KeyringTypes.snap,
},
Expand Down Expand Up @@ -1493,7 +1495,7 @@ describe('AccountsController', () => {
);
});

it('update accounts with Snap accounts when snap keyring is defined and has accounts', async () => {
it('update accounts with Snap accounts when Snap keyring is defined and has accounts', async () => {
const messenger = buildMessenger();
messenger.registerActionHandler(
'KeyringController:getAccounts',
Expand Down Expand Up @@ -1676,7 +1678,7 @@ describe('AccountsController', () => {
keyringType: KeyringTypes.hd,
}),
createExpectedInternalAccount({
name: 'Snap Account 1', // it is Snap Account 1 because it is the only snap account
name: 'Snap Account 2',
id: mockSnapAccount2.id,
address: mockSnapAccount2.address,
keyringType: KeyringTypes.snap,
Expand Down Expand Up @@ -1734,7 +1736,7 @@ describe('AccountsController', () => {
keyringType: KeyringTypes.hd,
}),
createExpectedInternalAccount({
name: 'Snap Account 1', // it is Snap Account 1 because it is the only snap account
name: 'Snap Account 2',
id: mockSnapAccount2.id,
address: mockSnapAccount2.address,
keyringType: KeyringTypes.snap,
Expand Down
Loading

0 comments on commit bb5ab3f

Please sign in to comment.