Skip to content

Commit

Permalink
Merge branch 'main' into release/202.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OGPoyraz committed Sep 13, 2024
2 parents a882433 + 92e6472 commit 622ab4a
Show file tree
Hide file tree
Showing 19 changed files with 837 additions and 160 deletions.
10 changes: 5 additions & 5 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"dependencies": {
"@ethereumjs/util": "^8.1.0",
"@metamask/base-controller": "^7.0.0",
"@metamask/eth-snap-keyring": "^4.3.1",
"@metamask/eth-snap-keyring": "^4.3.3",
"@metamask/keyring-api": "^8.1.0",
"@metamask/snaps-sdk": "^6.1.1",
"@metamask/snaps-utils": "^7.8.1",
"@metamask/snaps-sdk": "^6.5.0",
"@metamask/snaps-utils": "^8.1.1",
"@metamask/utils": "^9.1.0",
"deepmerge": "^4.2.2",
"ethereum-cryptography": "^2.1.2",
Expand All @@ -57,7 +57,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-controller": "^17.2.0",
"@metamask/snaps-controllers": "^9.3.1",
"@metamask/snaps-controllers": "^9.7.0",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"jest": "^27.5.1",
Expand All @@ -68,7 +68,7 @@
},
"peerDependencies": {
"@metamask/keyring-controller": "^17.0.0",
"@metamask/snaps-controllers": "^9.3.0"
"@metamask/snaps-controllers": "^9.7.0"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
6 changes: 3 additions & 3 deletions packages/chain-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"@metamask/base-controller": "^7.0.0",
"@metamask/chain-api": "^0.1.0",
"@metamask/keyring-api": "^8.1.0",
"@metamask/snaps-controllers": "^9.3.1",
"@metamask/snaps-sdk": "^6.1.1",
"@metamask/snaps-utils": "^7.8.1",
"@metamask/snaps-controllers": "^9.7.0",
"@metamask/snaps-sdk": "^6.5.0",
"@metamask/snaps-utils": "^8.1.1",
"@metamask/utils": "^9.1.0",
"uuid": "^8.3.2"
},
Expand Down
9 changes: 5 additions & 4 deletions packages/profile-sync-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
},
"dependencies": {
"@metamask/base-controller": "^7.0.0",
"@metamask/snaps-sdk": "^6.1.1",
"@metamask/snaps-utils": "^7.8.1",
"@metamask/snaps-sdk": "^6.5.0",
"@metamask/snaps-utils": "^8.1.1",
"@noble/ciphers": "^0.5.2",
"@noble/hashes": "^1.4.0",
"immer": "^9.0.6",
Expand All @@ -84,7 +84,8 @@
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-api": "^8.1.0",
"@metamask/keyring-controller": "^17.2.0",
"@metamask/snaps-controllers": "^9.3.1",
"@metamask/network-controller": "^21.0.0",
"@metamask/snaps-controllers": "^9.7.0",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"ethers": "^6.12.0",
Expand All @@ -99,7 +100,7 @@
"peerDependencies": {
"@metamask/accounts-controller": "^18.1.1",
"@metamask/keyring-controller": "^17.2.0",
"@metamask/snaps-controllers": "^9.3.0"
"@metamask/snaps-controllers": "^9.7.0"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ describe('user-storage/user-storage-controller - enableProfileSyncing() tests',
});

describe('user-storage/user-storage-controller - syncInternalAccountsWithUserStorage() tests', () => {
it('rejects if UserStorage is not enabled', async () => {
it('returns void if UserStorage is not enabled', async () => {
const arrangeMocks = async () => {
return {
messengerMocks: mockUserStorageMessenger(),
Expand All @@ -409,9 +409,9 @@ describe('user-storage/user-storage-controller - syncInternalAccountsWithUserSto
},
});

await expect(
controller.syncInternalAccountsWithUserStorage(),
).rejects.toThrow(expect.any(Error));
await controller.syncInternalAccountsWithUserStorage();

expect(messengerMocks.mockAccountsListAccounts).not.toHaveBeenCalled();
});

it('returns void if account syncing feature flag is disabled', async () => {
Expand Down Expand Up @@ -1083,7 +1083,7 @@ describe('user-storage/user-storage-controller - syncInternalAccountsWithUserSto
});

describe('user-storage/user-storage-controller - saveInternalAccountToUserStorage() tests', () => {
it('rejects if UserStorage is not enabled', async () => {
it('returns void if UserStorage is not enabled', async () => {
const arrangeMocks = async () => {
return {
messengerMocks: mockUserStorageMessenger(),
Expand All @@ -1103,11 +1103,13 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
},
});

await expect(
controller.saveInternalAccountToUserStorage(
MOCK_INTERNAL_ACCOUNTS.ONE[0].address,
),
).rejects.toThrow(expect.any(Error));
await controller.saveInternalAccountToUserStorage(
MOCK_INTERNAL_ACCOUNTS.ONE[0] as InternalAccount,
);

expect(
messengerMocks.mockAccountsGetAccountByAddress,
).not.toHaveBeenCalled();
});

it('returns void if account syncing feature flag is disabled', async () => {
Expand All @@ -1130,7 +1132,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
});

await controller.saveInternalAccountToUserStorage(
MOCK_INTERNAL_ACCOUNTS.ONE[0].address,
MOCK_INTERNAL_ACCOUNTS.ONE[0] as InternalAccount,
);

expect(mockAPI.isDone()).toBe(false);
Expand All @@ -1156,7 +1158,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
});

await controller.saveInternalAccountToUserStorage(
MOCK_INTERNAL_ACCOUNTS.ONE[0].address,
MOCK_INTERNAL_ACCOUNTS.ONE[0] as InternalAccount,
);

expect(mockAPI.isDone()).toBe(true);
Expand Down Expand Up @@ -1184,7 +1186,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag

await expect(
controller.saveInternalAccountToUserStorage(
MOCK_INTERNAL_ACCOUNTS.ONE[0].address,
MOCK_INTERNAL_ACCOUNTS.ONE[0] as InternalAccount,
),
).rejects.toThrow(expect.any(Error));
});
Expand All @@ -1210,7 +1212,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
);

expect(mockSaveInternalAccountToUserStorage).toHaveBeenCalledWith(
MOCK_INTERNAL_ACCOUNTS.ONE[0].address,
MOCK_INTERNAL_ACCOUNTS.ONE[0],
);
});

Expand All @@ -1235,7 +1237,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
);

expect(mockSaveInternalAccountToUserStorage).toHaveBeenCalledWith(
MOCK_INTERNAL_ACCOUNTS.ONE[0].address,
MOCK_INTERNAL_ACCOUNTS.ONE[0],
);
});
});
Expand Down Expand Up @@ -1272,7 +1274,6 @@ function mockUserStorageMessenger(options?: {
'NotificationServicesController:selectIsNotificationServicesEnabled',
'AccountsController:listAccounts',
'AccountsController:updateAccountMetadata',
'AccountsController:getAccountByAddress',
'KeyringController:addNewAccount',
],
allowedEvents: [
Expand Down
Loading

0 comments on commit 622ab4a

Please sign in to comment.