Skip to content

Commit

Permalink
Merge branch 'develop' into 17191-onboarding-unit-tests-creation-succ…
Browse files Browse the repository at this point in the history
…cessful
  • Loading branch information
tmashuang authored Apr 13, 2023
2 parents d9351c2 + 300bfd6 commit 6937e4d
Show file tree
Hide file tree
Showing 70 changed files with 2,682 additions and 1,565 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ module.exports = {
'**/__snapshots__/*.snap',
'app/scripts/controllers/app-state.test.js',
'app/scripts/controllers/network/**/*.test.js',
'app/scripts/controllers/network/**/*.test.ts',
'app/scripts/controllers/network/provider-api-tests/*.js',
'app/scripts/controllers/permissions/**/*.test.js',
'app/scripts/lib/**/*.test.js',
Expand Down
20 changes: 5 additions & 15 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ export function setupController(
METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
controller.encryptionPublicKeyManager.on(
controller.encryptionPublicKeyController.hub.on(
METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
Expand Down Expand Up @@ -727,17 +727,12 @@ export function setupController(

function getUnapprovedTransactionCount() {
const { unapprovedDecryptMsgCount } = controller.decryptMessageManager;
const { unapprovedEncryptionPublicKeyMsgCount } =
controller.encryptionPublicKeyManager;
const pendingApprovalCount =
controller.approvalController.getTotalApprovalCount();
const waitingForUnlockCount =
controller.appStateController.waitingForUnlock.length;
return (
unapprovedDecryptMsgCount +
unapprovedEncryptionPublicKeyMsgCount +
pendingApprovalCount +
waitingForUnlockCount
unapprovedDecryptMsgCount + pendingApprovalCount + waitingForUnlockCount
);
}

Expand Down Expand Up @@ -767,14 +762,9 @@ export function setupController(
REJECT_NOTIFICATION_CLOSE,
),
);
controller.encryptionPublicKeyManager.messages
.filter((msg) => msg.status === 'unapproved')
.forEach((tx) =>
controller.encryptionPublicKeyManager.rejectMsg(
tx.id,
REJECT_NOTIFICATION_CLOSE,
),
);
controller.encryptionPublicKeyController.rejectUnapproved(
REJECT_NOTIFICATION_CLOSE,
);

// Finally, resolve snap dialog approvals on Flask and reject all the others managed by the ApprovalController.
Object.values(controller.approvalController.state.pendingApprovals).forEach(
Expand Down
Loading

0 comments on commit 6937e4d

Please sign in to comment.