Skip to content
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

Bump/deps @metamask/eth-snap-keyring @metamask/keyring-api @metamask/snaps-controllers @metamask/snaps-utils eth-rpc-errors -> @metamask/rpc-errors in AccountsController #1735

Merged
merged 9 commits into from
Oct 12, 2023
Merged
8 changes: 4 additions & 4 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
},
"dependencies": {
"@metamask/base-controller": "^3.2.1",
"@metamask/eth-snap-keyring": "^0.2.2",
"@metamask/keyring-api": "^0.2.5",
"@metamask/snaps-utils": "^1.0.1",
"@metamask/eth-snap-keyring": "^0.3.0",
"@metamask/keyring-api": "^0.2.7",
"@metamask/snaps-utils": "^2.0.1",
"@metamask/utils": "^6.2.0",
legobeat marked this conversation as resolved.
Show resolved Hide resolved
"deepmerge": "^4.2.2",
"eth-rpc-errors": "^4.0.2",
legobeat marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -43,7 +43,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.1.0",
"@metamask/keyring-controller": "^8.0.0",
"@metamask/snaps-controllers": "^1.0.1",
"@metamask/snaps-controllers": "^2.0.1",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"jest": "^27.5.1",
Expand Down
14 changes: 7 additions & 7 deletions packages/accounts-controller/src/AccountsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
SnapControllerEvents,
SnapControllerState,
} from '@metamask/snaps-controllers';
import type { Snap, ValidatedSnapId } from '@metamask/snaps-utils';
import type { Keyring, Json } from '@metamask/utils';
import { sha256FromString } from 'ethereumjs-util';
import type { Patch } from 'immer';
Expand Down Expand Up @@ -92,10 +93,6 @@ const accountsControllerMetadata = {
persist: true,
anonymous: false,
},
selectedAccount: {
persist: true,
anonymous: false,
},
};

const defaultState: AccountsControllerState = {
Expand Down Expand Up @@ -516,9 +513,12 @@ export class AccountsController extends BaseControllerV2<
const currentAccount =
currentState.internalAccounts.accounts[account.id];
if (currentAccount.metadata.snap) {
currentAccount.metadata.snap.enabled =
snaps[currentAccount.metadata.snap.id].enabled &&
!snaps[currentAccount.metadata.snap.id].blocked;
const snapId = currentAccount.metadata.snap.id;
const storedSnap: Snap = snaps[snapId as ValidatedSnapId];
if (storedSnap) {
currentAccount.metadata.snap.enabled =
storedSnap.enabled && !storedSnap.blocked;
}
}
});
});
Expand Down
Loading