Skip to content

Commit 51b253c

Browse files
authored
Merge pull request #32637 from MetaMask/Version-v12.17.3
feat: 12.17.3
2 parents d5d41a0 + 841cf4a commit 51b253c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+730
-383
lines changed

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [12.17.3]
10+
### Changed
11+
- Update supported browser versions ([#32520](https://github.com/MetaMask/metamask-extension/pull/32520))
12+
13+
### Fixed
14+
- Stop emitting Dapp Viewed events on Firefox ([#32583](https://github.com/MetaMask/metamask-extension/pull/32583))
15+
- Make phishing warning events anonymous ([#32635](https://github.com/MetaMask/metamask-extension/pull/32635))
16+
- Fix momentary disappearance of approve row in batch transaction confirmation ([#32658](https://github.com/MetaMask/metamask-extension/pull/32658))
17+
- Support permit2 approvals in batch simulation ([#32733](https://github.com/MetaMask/metamask-extension/pull/32733))
18+
- Allow users to upgrade to a smart contract account after rejecting it once in the past ([#32697](https://github.com/MetaMask/metamask-extension/pull/32697))
19+
920
## [12.17.2]
1021
### Changed
1122
- Increasing polling interval for incoming transactions ([#32547](https://github.com/MetaMask/metamask-extension/pull/32547))
@@ -6089,7 +6100,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
60896100
- Added the ability to restore accounts from seed words.
60906101

60916102

6092-
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.17.2...HEAD
6103+
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.17.3...HEAD
6104+
[12.17.3]: https://github.com/MetaMask/metamask-extension/compare/v12.17.2...v12.17.3
60936105
[12.17.2]: https://github.com/MetaMask/metamask-extension/compare/v12.17.1...v12.17.2
60946106
[12.17.1]: https://github.com/MetaMask/metamask-extension/compare/v12.17.0...v12.17.1
60956107
[12.17.0]: https://github.com/MetaMask/metamask-extension/compare/v12.16.2...v12.17.0

app/manifest/v2/chrome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"matches": ["https://metamask.io/*"],
55
"ids": ["*"]
66
},
7-
"minimum_chrome_version": "89"
7+
"minimum_chrome_version": "109"
88
}

app/manifest/v2/firefox.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"applications": {
33
"gecko": {
44
5-
"strict_min_version": "89.0"
5+
"strict_min_version": "102.0"
66
}
77
},
88
"browser_action": {

app/manifest/v3/chrome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"matches": ["https://metamask.io/*"],
88
"ids": ["*"]
99
},
10-
"minimum_chrome_version": "89"
10+
"minimum_chrome_version": "109"
1111
}

app/manifest/v3/firefox.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"applications": {
33
"gecko": {
44
5-
"strict_min_version": "89.0"
5+
"strict_min_version": "102.0"
66
}
77
},
88
"background": {

app/scripts/background.js

+21-12
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,28 @@ function maybeDetectPhishing(theController) {
327327
blockedUrl = details.initiator;
328328
}
329329

330-
theController.metaMetricsController.trackEvent({
331-
// should we differentiate between background redirection and content script redirection?
332-
event: MetaMetricsEventName.PhishingPageDisplayed,
333-
category: MetaMetricsEventCategory.Phishing,
334-
properties: {
335-
url: blockedUrl,
336-
referrer: {
337-
url: blockedUrl,
330+
if (!isFirefox) {
331+
theController.metaMetricsController.trackEvent(
332+
{
333+
// should we differentiate between background redirection and content script redirection?
334+
event: MetaMetricsEventName.PhishingPageDisplayed,
335+
category: MetaMetricsEventCategory.Phishing,
336+
properties: {
337+
url: blockedUrl,
338+
referrer: {
339+
url: blockedUrl,
340+
},
341+
reason: blockReason,
342+
requestDomain: blockedRequestResponse.result
343+
? hostname
344+
: undefined,
345+
},
338346
},
339-
reason: blockReason,
340-
requestDomain: blockedRequestResponse.result ? hostname : undefined,
341-
},
342-
});
347+
{
348+
excludeMetaMetricsId: true,
349+
},
350+
);
351+
}
343352
const querystring = new URLSearchParams({ hostname, href });
344353
const redirectUrl = new URL(phishingPageHref);
345354
redirectUrl.hash = querystring.toString();

app/scripts/controllers/preferences-controller.test.ts

-61
Original file line numberDiff line numberDiff line change
@@ -838,67 +838,6 @@ describe('preferences controller', () => {
838838
});
839839
});
840840

841-
describe('getDisabledAccountUpgradeChains', () => {
842-
it('returns empty array if disabledAccountUpgrades is empty', () => {
843-
const { controller } = setupController({});
844-
expect(controller.getDisabledAccountUpgradeChains()).toStrictEqual([]);
845-
});
846-
847-
it('returns disabledAccountUpgrades state', () => {
848-
const { controller } = setupController({
849-
state: {
850-
accountUpgradeDisabledChains: [CHAIN_IDS.MAINNET, CHAIN_IDS.GOERLI],
851-
},
852-
});
853-
854-
expect(controller.getDisabledAccountUpgradeChains()).toStrictEqual([
855-
CHAIN_IDS.MAINNET,
856-
CHAIN_IDS.GOERLI,
857-
]);
858-
});
859-
});
860-
861-
describe('disableAccountUpgradeForChain', () => {
862-
it('adds chain ID to disabledAccountUpgrades if empty', () => {
863-
const { controller } = setupController({});
864-
865-
controller.disableAccountUpgradeForChain(CHAIN_IDS.GOERLI);
866-
867-
expect(controller.state.accountUpgradeDisabledChains).toStrictEqual([
868-
CHAIN_IDS.GOERLI,
869-
]);
870-
});
871-
872-
it('adds chain ID to disabledAccountUpgrades if not empty', () => {
873-
const { controller } = setupController({
874-
state: {
875-
accountUpgradeDisabledChains: [CHAIN_IDS.MAINNET],
876-
},
877-
});
878-
879-
controller.disableAccountUpgradeForChain(CHAIN_IDS.GOERLI);
880-
881-
expect(controller.state.accountUpgradeDisabledChains).toStrictEqual([
882-
CHAIN_IDS.MAINNET,
883-
CHAIN_IDS.GOERLI,
884-
]);
885-
});
886-
887-
it('does not add chain ID to disabledAccountUpgrades if duplicate', () => {
888-
const { controller } = setupController({
889-
state: {
890-
accountUpgradeDisabledChains: [CHAIN_IDS.MAINNET],
891-
},
892-
});
893-
894-
controller.disableAccountUpgradeForChain(CHAIN_IDS.MAINNET);
895-
896-
expect(controller.state.accountUpgradeDisabledChains).toStrictEqual([
897-
CHAIN_IDS.MAINNET,
898-
]);
899-
});
900-
});
901-
902841
describe('manageInstitutionalWallets', () => {
903842
it('defaults manageInstitutionalWallets to false', () => {
904843
const { controller } = setupController({});

app/scripts/controllers/preferences-controller.ts

-19
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export type PreferencesControllerState = Omit<
150150
useExternalServices: boolean;
151151
textDirection?: string;
152152
manageInstitutionalWallets: boolean;
153-
accountUpgradeDisabledChains?: string[];
154153
};
155154

156155
/**
@@ -427,7 +426,6 @@ const controllerMetadata = {
427426
isMultiAccountBalancesEnabled: { persist: true, anonymous: true },
428427
showIncomingTransactions: { persist: true, anonymous: true },
429428
manageInstitutionalWallets: { persist: true, anonymous: false },
430-
accountUpgradeDisabledChains: { persist: true, anonymous: false },
431429
};
432430

433431
export class PreferencesController extends BaseController<
@@ -962,23 +960,6 @@ export class PreferencesController extends BaseController<
962960
});
963961
}
964962

965-
getDisabledAccountUpgradeChains(): string[] {
966-
return this.state.accountUpgradeDisabledChains ?? [];
967-
}
968-
969-
disableAccountUpgradeForChain(chainId: string): void {
970-
this.update((state) => {
971-
const { accountUpgradeDisabledChains: existingDisabledChains } = state;
972-
973-
if (!existingDisabledChains?.includes(chainId)) {
974-
state.accountUpgradeDisabledChains = [
975-
...(existingDisabledChains ?? []),
976-
chainId,
977-
];
978-
}
979-
});
980-
}
981-
982963
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
983964
setSnapsAddSnapAccountModalDismissed(value: boolean): void {
984965
this.update((state) => {

app/scripts/lib/transaction/eip5792.test.ts

+28-18
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
SendCalls,
1515
SendCallsParams,
1616
} from '@metamask/eth-json-rpc-middleware';
17-
import { Hex, JsonRpcRequest } from '@metamask/utils';
17+
import { JsonRpcRequest } from '@metamask/utils';
1818
import { Messenger } from '@metamask/base-controller';
1919
import { AccountsControllerGetSelectedAccountAction } from '@metamask/accounts-controller';
2020
import { InternalAccount } from '@metamask/keyring-internal-api';
@@ -93,9 +93,6 @@ describe('EIP-5792', () => {
9393
TransactionControllerGetStateAction['handler']
9494
> = jest.fn();
9595

96-
const getDisabledAccountUpgradeChainsMock: jest.MockedFn<() => Hex[]> =
97-
jest.fn();
98-
9996
const isAtomicBatchSupportedMock: jest.MockedFn<
10097
TransactionController['isAtomicBatchSupported']
10198
> = jest.fn();
@@ -112,7 +109,6 @@ describe('EIP-5792', () => {
112109

113110
const sendCallsHooks = {
114111
addTransactionBatch: addTransactionBatchMock,
115-
getDisabledAccountUpgradeChains: getDisabledAccountUpgradeChainsMock,
116112
getDismissSmartAccountSuggestionEnabled:
117113
getDismissSmartAccountSuggestionEnabledMock,
118114
isAtomicBatchSupported: isAtomicBatchSupportedMock,
@@ -149,7 +145,7 @@ describe('EIP-5792', () => {
149145
batchId: BATCH_ID_MOCK,
150146
});
151147

152-
getDisabledAccountUpgradeChainsMock.mockReturnValue([]);
148+
getDismissSmartAccountSuggestionEnabledMock.mockReturnValue(false);
153149

154150
isAtomicBatchSupportedMock.mockResolvedValue([
155151
{
@@ -234,8 +230,8 @@ describe('EIP-5792', () => {
234230
);
235231
});
236232

237-
it('throws if disabled preference for chain', async () => {
238-
getDisabledAccountUpgradeChainsMock.mockReturnValue([CHAIN_ID_MOCK]);
233+
it('throws if user enabled preference to dismiss option to upgrade account', async () => {
234+
getDismissSmartAccountSuggestionEnabledMock.mockReturnValue(true);
239235

240236
await expect(
241237
processSendCalls(
@@ -244,9 +240,28 @@ describe('EIP-5792', () => {
244240
SEND_CALLS_MOCK,
245241
REQUEST_MOCK,
246242
),
247-
).rejects.toThrow(
248-
`EIP-7702 upgrade rejected for this chain and account - Chain ID: ${CHAIN_ID_MOCK}, Account: ${SEND_CALLS_MOCK.from}`,
249-
);
243+
).rejects.toThrow('EIP-7702 upgrade disabled by the user');
244+
});
245+
246+
it('does not throw if user enabled preference to dismiss option to upgrade account if already upgraded', async () => {
247+
getDismissSmartAccountSuggestionEnabledMock.mockReturnValue(true);
248+
249+
isAtomicBatchSupportedMock.mockResolvedValueOnce([
250+
{
251+
chainId: CHAIN_ID_MOCK,
252+
delegationAddress: DELEGATION_ADDRESS_MOCK,
253+
isSupported: true,
254+
},
255+
]);
256+
257+
expect(
258+
await processSendCalls(
259+
sendCallsHooks,
260+
messenger,
261+
SEND_CALLS_MOCK,
262+
REQUEST_MOCK,
263+
),
264+
).toBeDefined();
250265
});
251266

252267
it('throws if top-level capability is required', async () => {
@@ -466,7 +481,6 @@ describe('EIP-5792', () => {
466481

467482
const capabilities = await getCapabilities(
468483
{
469-
getDisabledAccountUpgradeChains: getDisabledAccountUpgradeChainsMock,
470484
getDismissSmartAccountSuggestionEnabled:
471485
getDismissSmartAccountSuggestionEnabledMock,
472486
isAtomicBatchSupported: isAtomicBatchSupportedMock,
@@ -496,7 +510,6 @@ describe('EIP-5792', () => {
496510

497511
const capabilities = await getCapabilities(
498512
{
499-
getDisabledAccountUpgradeChains: getDisabledAccountUpgradeChainsMock,
500513
getDismissSmartAccountSuggestionEnabled:
501514
getDismissSmartAccountSuggestionEnabledMock,
502515
isAtomicBatchSupported: isAtomicBatchSupportedMock,
@@ -519,7 +532,6 @@ describe('EIP-5792', () => {
519532

520533
const capabilities = await getCapabilities(
521534
{
522-
getDisabledAccountUpgradeChains: getDisabledAccountUpgradeChainsMock,
523535
getDismissSmartAccountSuggestionEnabled:
524536
getDismissSmartAccountSuggestionEnabledMock,
525537
isAtomicBatchSupported: isAtomicBatchSupportedMock,
@@ -531,7 +543,7 @@ describe('EIP-5792', () => {
531543
expect(capabilities).toStrictEqual({});
532544
});
533545

534-
it('does not include atomic capability if upgrade disabled for chain', async () => {
546+
it('does not include atomic capability if all upgrades disabled', async () => {
535547
isAtomicBatchSupportedMock.mockResolvedValueOnce([
536548
{
537549
chainId: CHAIN_ID_MOCK,
@@ -541,11 +553,10 @@ describe('EIP-5792', () => {
541553
},
542554
]);
543555

544-
getDisabledAccountUpgradeChainsMock.mockReturnValue([CHAIN_ID_MOCK]);
556+
getDismissSmartAccountSuggestionEnabledMock.mockReturnValue(true);
545557

546558
const capabilities = await getCapabilities(
547559
{
548-
getDisabledAccountUpgradeChains: getDisabledAccountUpgradeChainsMock,
549560
getDismissSmartAccountSuggestionEnabled:
550561
getDismissSmartAccountSuggestionEnabledMock,
551562
isAtomicBatchSupported: isAtomicBatchSupportedMock,
@@ -569,7 +580,6 @@ describe('EIP-5792', () => {
569580

570581
const capabilities = await getCapabilities(
571582
{
572-
getDisabledAccountUpgradeChains: getDisabledAccountUpgradeChainsMock,
573583
getDismissSmartAccountSuggestionEnabled:
574584
getDismissSmartAccountSuggestionEnabledMock,
575585
isAtomicBatchSupported: isAtomicBatchSupportedMock,

0 commit comments

Comments
 (0)