Skip to content

Commit

Permalink
Merge branch 'develop' into 17191-onboarding-unit-tests-confirm-recov…
Browse files Browse the repository at this point in the history
…ery-phrase
  • Loading branch information
tmashuang authored Apr 5, 2023
2 parents d73c25d + 7390756 commit b1bb8fe
Show file tree
Hide file tree
Showing 171 changed files with 1,424 additions and 910 deletions.
109 changes: 107 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,109 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.28.1]
### Changed
- Fix release automation ([#18427](https://github.com/MetaMask/metamask-extension/pull/18427))

## [10.28.0]
### Added
- Adding NFT autodetection to "What's New" Announcements ([#17653](https://github.com/MetaMask/metamask-extension/pull/17653))
- [FLASK] Add WebAssembly endowment ([#17694](https://github.com/MetaMask/metamask-extension/pull/17694))
- Bridge tokens by redirecting to Portfolio from wallet overview page ([#17952](https://github.com/MetaMask/metamask-extension/pull/17952))
- [MMI] Adds the MMI support link and the mmi_website link as well ([#17853](https://github.com/MetaMask/metamask-extension/pull/17853))
- What's new - OpenSea security provider ([#16831](https://github.com/MetaMask/metamask-extension/pull/16831))
- Open sea security provider warning message ([#17662](https://github.com/MetaMask/metamask-extension/pull/17662))
- SRP hold to reveal ([#17232](https://github.com/MetaMask/metamask-extension/pull/17232))
- Additional incoming transactions support ([#14219](https://github.com/MetaMask/metamask-extension/pull/14219))

### Changed
- UX: Loaclize the avatar-favicon description text ([#18132](https://github.com/MetaMask/metamask-extension/pull/18132))
- 17921 Update TransactionAlerts with BannerAlert ([#17940](https://github.com/MetaMask/metamask-extension/pull/17940))
- Part of 17670: Replace Typography with Text confirm-approve-content.component.js and home.component.js ([#18049](https://github.com/MetaMask/metamask-extension/pull/18049))
- UX: Icon: Update buy icon ([#18123](https://github.com/MetaMask/metamask-extension/pull/18123))
- Display internet protocol on the domain in SIWE screen ([#18052](https://github.com/MetaMask/metamask-extension/pull/18052))
- Wrap balance and portfolio button ([#18109](https://github.com/MetaMask/metamask-extension/pull/18109))
- UX Icon: Updated Icon for Disclosure ([#17877](https://github.com/MetaMask/metamask-extension/pull/17877))
- Updating AvatarWithBage to BadgeWrapper ([#17851](https://github.com/MetaMask/metamask-extension/pull/17851))
- [FLASK] BREAKING - [email protected] ([#17718](https://github.com/MetaMask/metamask-extension/pull/17718))
- increment keyring controller version ([#18036](https://github.com/MetaMask/metamask-extension/pull/18036))
- Bump Snow 1.5.0 ([#17985](https://github.com/MetaMask/metamask-extension/pull/17985))
- Avoid blob url for files downloads ([#17986](https://github.com/MetaMask/metamask-extension/pull/17986))
- Upgrading the Import Account modal ([#17763](https://github.com/MetaMask/metamask-extension/pull/17763))
- identify desktop is paired in the metrics event ([#17892](https://github.com/MetaMask/metamask-extension/pull/17892))
- [MMI] Conditional change title in home if buildType is MMI ([#17898](https://github.com/MetaMask/metamask-extension/pull/17898))
- [MMI] Prevent multiple instances of MM at the same browser ([#17856](https://github.com/MetaMask/metamask-extension/pull/17856))
- Buy crypto by redirecting to onramp experience on pdapp instead of deposit popover ([#17689](https://github.com/MetaMask/metamask-extension/pull/17689))
- Update snaps locale messages for casing and content ([#17915](https://github.com/MetaMask/metamask-extension/pull/17915))
- Ux: Icon: Update fa-eye with ICON_NAMES.EYE ([#17800](https://github.com/MetaMask/metamask-extension/pull/17800))
- UX: Icon: Stop using fa-times ([#17811](https://github.com/MetaMask/metamask-extension/pull/17811))
- Selector performance improvements ([#17410](https://github.com/MetaMask/metamask-extension/pull/17410))
- UX: Update Settings Icon ([#17561](https://github.com/MetaMask/metamask-extension/pull/17561))
- UX Icon: updated fa-exclamation-circle ([#17879](https://github.com/MetaMask/metamask-extension/pull/17879))
- Update minimum browser versions ([#12847](https://github.com/MetaMask/metamask-extension/pull/12847))
- UX: Icon: Remove fa-exclamation-triangle usages ([#17691](https://github.com/MetaMask/metamask-extension/pull/17691))
- UX: Icons: Remove icon-import ([#17816](https://github.com/MetaMask/metamask-extension/pull/17816))
- UX: Icons: Remove IconCheck and fa-check ([#17787](https://github.com/MetaMask/metamask-extension/pull/17787))
- UX Icon: updated fas-question icon ([#17828](https://github.com/MetaMask/metamask-extension/pull/17828))
- UX: Icons: Stop using FA in TransactionActivityLog ([#17667](https://github.com/MetaMask/metamask-extension/pull/17667))
- Ux: Icon: Improve alignment of asset list chevron ([#17791](https://github.com/MetaMask/metamask-extension/pull/17791))
- UX: Icons: Remove IconWithLabel ([#17815](https://github.com/MetaMask/metamask-extension/pull/17815))
- UX: Move Portfolio link to its own button ([#17722](https://github.com/MetaMask/metamask-extension/pull/17722))
- UX Icon: Replace fa-user ([#17809](https://github.com/MetaMask/metamask-extension/pull/17809))
- UX: Icons: Fix alignment of settings icons in full screen ([#17783](https://github.com/MetaMask/metamask-extension/pull/17783))
- Cleanup: clearTimeout on useEffect for gas estimation and prevent state update on unmounted ConfirmTransactionBase ([#17804](https://github.com/MetaMask/metamask-extension/pull/17804))
- Part of 17670: Replace Typography with Text approve-content-card ([#17753](https://github.com/MetaMask/metamask-extension/pull/17753))
- UX: Icons: Remove lock icon ([#17739](https://github.com/MetaMask/metamask-extension/pull/17739))
- Update HelpText component ([#17705](https://github.com/MetaMask/metamask-extension/pull/17705))
- Change transaction type for send with approve transaction ([#17777](https://github.com/MetaMask/metamask-extension/pull/17777))
- UX: Icon: Remove Plus icon ([#17666](https://github.com/MetaMask/metamask-extension/pull/17666))
- Updating TextField component ([#17732](https://github.com/MetaMask/metamask-extension/pull/17732))
- UX: Update three-dot icon for settings ([#17558](https://github.com/MetaMask/metamask-extension/pull/17558))
- Updating Label component ([#17731](https://github.com/MetaMask/metamask-extension/pull/17731))
- Pass `excludedPermissions` to `SnapController` ([#17321](https://github.com/MetaMask/metamask-extension/pull/17321))
- UX: Update fa-search icon ([#17527](https://github.com/MetaMask/metamask-extension/pull/17527))
- UX: Icons: Remove legacy connect icon ([#17673](https://github.com/MetaMask/metamask-extension/pull/17673))
- UX: Icons: Remove usage of pencil icon ([#17676](https://github.com/MetaMask/metamask-extension/pull/17676))
- Rename reset account settings ([#17457](https://github.com/MetaMask/metamask-extension/pull/17457))
- Make username mandatory in the edit contact screen ([#17425](https://github.com/MetaMask/metamask-extension/pull/17425))
- New Crowdin translations by Github Action ([#17082](https://github.com/MetaMask/metamask-extension/pull/17082))

### Removed
- NFTs: Remove feature flag for release ([#17401](https://github.com/MetaMask/metamask-extension/pull/17401))
- Removed a feature flag ([#17922](https://github.com/MetaMask/metamask-extension/pull/17922))
- UX: Remove legacy metametrics modal ([#17817](https://github.com/MetaMask/metamask-extension/pull/17817))
- UX: Icons: Remove unused overview icons ([#17671](https://github.com/MetaMask/metamask-extension/pull/17671))
- Remove CancelTransaction modal ([#17819](https://github.com/MetaMask/metamask-extension/pull/17819))

### Fixed
- Fix ThemeType casing issue ([#18039](https://github.com/MetaMask/metamask-extension/pull/18039))
- Fix #17948 - Allow editing of NFT sends ([#17970](https://github.com/MetaMask/metamask-extension/pull/17970))
- Fix #17848 - Ensure NFT collections toggle appropriately ([#17972](https://github.com/MetaMask/metamask-extension/pull/17972))
- Force update mock state and render nfts item test fix ([#18044](https://github.com/MetaMask/metamask-extension/pull/18044))
- fix network dropdown bug ([#18079](https://github.com/MetaMask/metamask-extension/pull/18079))
- Fix #17932 - Ensure NFT last sold price is formatted correctly ([#17983](https://github.com/MetaMask/metamask-extension/pull/17983))
- Use tokenList to get token details, when available, in getTokenStanda… ([#17891](https://github.com/MetaMask/metamask-extension/pull/17891))
- delay chain validation ([#17413](https://github.com/MetaMask/metamask-extension/pull/17413))
- fix(17542): fix fiat currency display in few txn actions ([#18011](https://github.com/MetaMask/metamask-extension/pull/18011))
- fix(17716): increase threshold to include all options for nonce search ([#17999](https://github.com/MetaMask/metamask-extension/pull/17999))
- fix issue with fragment messageIds ([#17949](https://github.com/MetaMask/metamask-extension/pull/17949))
- UX: Icons: Fix Chevrons in Settings Tabs ([#17971](https://github.com/MetaMask/metamask-extension/pull/17971))
- fix(17857): show correctly converted account balance in sign&encrypt windows ([#17973](https://github.com/MetaMask/metamask-extension/pull/17973))
- Edit Token Transfer displays mixed info with regular Send Tx (ETH) ([#17507](https://github.com/MetaMask/metamask-extension/pull/17507))
- fix(17855): persist popup when sw is restarted ([#17855](https://github.com/MetaMask/metamask-extension/pull/17855))
- Fix incorrect balance in signature request header ([#17829](https://github.com/MetaMask/metamask-extension/pull/17829))
- fix keeping the user login after the first login ([#17950](https://github.com/MetaMask/metamask-extension/pull/17950))
- Fixed accounts auto scrolling ([#17075](https://github.com/MetaMask/metamask-extension/pull/17075))
- Fix a bug where non-address types would be rendered as addresses in EIP-712 ([#17846](https://github.com/MetaMask/metamask-extension/pull/17846))
- Transaction-list-item-details pop up to display the correct token information on token approve item ([#17422](https://github.com/MetaMask/metamask-extension/pull/17422))
- ConfirmDecryptMessage: avoid mutation of state in decryptMsg/completedTx action ([#17895](https://github.com/MetaMask/metamask-extension/pull/17895))
- Fix GetEncryptionKey TypeError Cannot destructure property 'msgParams' of 'txData' ([#17808](https://github.com/MetaMask/metamask-extension/pull/17808))
- Fix state in confirm transaction ([#17838](https://github.com/MetaMask/metamask-extension/pull/17838))
- window open noopener ([#17882](https://github.com/MetaMask/metamask-extension/pull/17882))
- avoid mutation of state in signTransaction action ([#17772](https://github.com/MetaMask/metamask-extension/pull/17772))
- MenuItem: Fix layout of menu item with subtitle ([#17650](https://github.com/MetaMask/metamask-extension/pull/17650))
- fix: fix url for flask build ([#17784](https://github.com/MetaMask/metamask-extension/pull/17784))

## [10.27.0]
### Added
- feat: add the ConsenSys zkEVM (Linea) as a default network ([#17875](https://github.com/MetaMask/metamask-extension/pull/17875))
Expand Down Expand Up @@ -227,7 +330,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [FLASK] **BREAKING**: Snap RPC methods now use `@metamask/[email protected]` ([#16394](https://github.com/MetaMask/metamask-extension/pull/16394))
- In the new version, all hexadecimal values are prefixed with `0x`
- All fields containing the word `Buffer` has also been renamed to `Bytes`
- Please update your snap to use the latest version
- Please update your snap to use the latest version

### Fixed
- Fix Settings Search pointing into the incorrect row for Token Detection entry ([#16407](https://github.com/MetaMask/metamask-extension/pull/16407))
Expand Down Expand Up @@ -3540,7 +3643,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Uncategorized
- Added the ability to restore accounts from seed words.

[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.27.0...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.28.1...HEAD
[10.28.1]: https://github.com/MetaMask/metamask-extension/compare/v10.28.0...v10.28.1
[10.28.0]: https://github.com/MetaMask/metamask-extension/compare/v10.27.0...v10.28.0
[10.27.0]: https://github.com/MetaMask/metamask-extension/compare/v10.26.2...v10.27.0
[10.26.2]: https://github.com/MetaMask/metamask-extension/compare/v10.26.1...v10.26.2
[10.26.1]: https://github.com/MetaMask/metamask-extension/compare/v10.26.0...v10.26.1
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/network/network-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import log from 'loglevel';
import {
createSwappableProxy,
createEventEmitterProxy,
} from 'swappable-obj-proxy';
} from '@metamask/swappable-obj-proxy';
import EthQuery from 'eth-query';
// ControllerMessenger is referred to in the JSDocs
// eslint-disable-next-line no-unused-vars
Expand Down
38 changes: 0 additions & 38 deletions app/scripts/controllers/sign.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
OriginalRequest,
} from '@metamask/message-manager/dist/AbstractMessageManager';
import { MetaMetricsEventCategory } from '../../../shared/constants/metametrics';
import { detectSIWE } from '../../../shared/modules/siwe';
import SignController, {
SignControllerMessenger,
SignControllerOptions,
Expand All @@ -20,10 +19,6 @@ jest.mock('@metamask/message-manager', () => ({
TypedMessageManager: jest.fn(),
}));

jest.mock('../../../shared/modules/siwe', () => ({
detectSIWE: jest.fn(),
}));

const messageIdMock = '123';
const messageIdMock2 = '456';
const versionMock = '1';
Expand Down Expand Up @@ -69,13 +64,6 @@ const requestMock = {
origin: 'http://test2.com',
} as OriginalRequest;

const siweMockFound = {
isSIWEMessage: true,
parsedMessage: { domain: 'test.com', test: 'value' },
};

const siweMockNotFound = { isSIWEMessage: false };

const createMessengerMock = () =>
({
registerActionHandler: jest.fn(),
Expand Down Expand Up @@ -128,7 +116,6 @@ describe('SignController', () => {
const messengerMock = createMessengerMock();
const preferencesControllerMock = createPreferencesControllerMock();
const keyringControllerMock = createKeyringControllerMock();
const detectSIWEMock = detectSIWE as jest.MockedFunction<typeof detectSIWE>;
const getStateMock = jest.fn();
const securityProviderRequestMock = jest.fn();
const metricsEventMock = jest.fn();
Expand All @@ -147,8 +134,6 @@ describe('SignController', () => {
disabledRpcMethodPreferences: { eth_sign: true },
});

detectSIWEMock.mockReturnValue(siweMockNotFound);

signController = new SignController({
messenger: messengerMock as any,
preferencesController: preferencesControllerMock as any,
Expand Down Expand Up @@ -354,29 +339,6 @@ describe('SignController', () => {
requestMock,
);
});

it('adds message to personal message manager including Ethereum sign in data', async () => {
detectSIWEMock.mockReturnValueOnce(siweMockFound);

await signController.newUnsignedPersonalMessage(
messageParamsMock,
requestMock,
);

expect(
personalMessageManagerMock.addUnapprovedMessageAsync,
).toHaveBeenCalledTimes(1);

expect(
personalMessageManagerMock.addUnapprovedMessageAsync,
).toHaveBeenCalledWith(
{
...messageParamsMock,
siwe: siweMockFound,
},
requestMock,
);
});
});

describe('newUnsignedTypedMessage', () => {
Expand Down
10 changes: 1 addition & 9 deletions app/scripts/controllers/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
RejectRequest,
} from '@metamask/approval-controller';
import { MetaMetricsEventCategory } from '../../../shared/constants/metametrics';
import { detectSIWE } from '../../../shared/modules/siwe';
import PreferencesController from './preferences';

const controllerName = 'SignController';
Expand Down Expand Up @@ -321,11 +320,8 @@ export default class SignController extends BaseControllerV2<
msgParams: PersonalMessageParams,
req: OriginalRequest,
): Promise<string> {
const ethereumSignInData = this._getEthereumSignInData(msgParams);
const finalMsgParams = { ...msgParams, siwe: ethereumSignInData };

return this._personalMessageManager.addUnapprovedMessageAsync(
finalMsgParams,
msgParams,
req,
);
}
Expand Down Expand Up @@ -618,10 +614,6 @@ export default class SignController extends BaseControllerV2<
}[messageId];
}

private _getEthereumSignInData(messgeParams: PersonalMessageParams): any {
return detectSIWE(messgeParams);
}

private _requestApproval(
msgParams: AbstractMessageParamsMetamask,
type: string,
Expand Down
3 changes: 2 additions & 1 deletion app/scripts/lib/createRPCMethodTrackingMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { errorCodes } from 'eth-rpc-errors';
import { detectSIWE } from '@metamask/controller-utils';
import { MESSAGE_TYPE, ORIGIN_METAMASK } from '../../../shared/constants/app';
import { TransactionStatus } from '../../../shared/constants/transaction';
import { SECOND } from '../../../shared/constants/time';
import { detectSIWE } from '../../../shared/modules/siwe';

import {
MetaMetricsEventCategory,
MetaMetricsEventName,
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/lib/createRPCMethodTrackingMiddleware.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { errorCodes } from 'eth-rpc-errors';
import { detectSIWE } from '@metamask/controller-utils';
import { MESSAGE_TYPE } from '../../../shared/constants/app';
import {
MetaMetricsEventName,
MetaMetricsEventUiCustomization,
} from '../../../shared/constants/metametrics';
import { SECOND } from '../../../shared/constants/time';
import { detectSIWE } from '../../../shared/modules/siwe';
import createRPCMethodTrackingMiddleware from './createRPCMethodTrackingMiddleware';

const trackEvent = jest.fn();
Expand Down Expand Up @@ -56,7 +56,7 @@ function getNext(timeout = 500) {
const waitForSeconds = async (seconds) =>
await new Promise((resolve) => setTimeout(resolve, SECOND * seconds));

jest.mock('../../../shared/modules/siwe', () => ({
jest.mock('@metamask/controller-utils', () => ({
detectSIWE: jest.fn().mockImplementation(() => {
return { isSIWEMessage: false };
}),
Expand Down
1 change: 1 addition & 0 deletions development/build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const configurationPropertyNames = [
'DISABLE_WEB_SOCKET_ENCRYPTION',
'METAMASK_DEBUG',
'SKIP_OTP_PAIRING_FLOW',
'ENABLE_MV3',
];

const productionConfigurationPropertyNames = [
Expand Down
23 changes: 18 additions & 5 deletions development/build/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const {
} = require('./transforms/remove-fenced-code');

// map dist files to bag of needed native APIs against LM scuttling
const scuttlingConfig = {
const scuttlingConfigBase = {
'sentry-install.js': {
// globals sentry need to function
window: '',
Expand All @@ -70,7 +70,6 @@ const scuttlingConfig = {
Number: '',
Request: '',
Date: '',
document: '',
JSON: '',
encodeURIComponent: '',
crypto: '',
Expand All @@ -87,6 +86,16 @@ const scuttlingConfig = {
},
};

const mv3ScuttlingConfig = { ...scuttlingConfigBase };

const standardScuttlingConfig = {
...scuttlingConfigBase,
'sentry-install.js': {
...scuttlingConfigBase['sentry-install.js'],
document: '',
},
};

/**
* Get the appropriate Infura project ID.
*
Expand Down Expand Up @@ -932,9 +941,8 @@ function setupBundlerDefaults(

// Setup source maps
setupSourcemaps(buildConfiguration, { buildTarget });

// Setup wrapping of code against scuttling (before sourcemaps generation)
setupScuttlingWrapping(buildConfiguration, applyLavaMoat);
setupScuttlingWrapping(buildConfiguration, applyLavaMoat, envVars);
}
}

Expand Down Expand Up @@ -988,7 +996,11 @@ function setupMinification(buildConfiguration) {
});
}

function setupScuttlingWrapping(buildConfiguration, applyLavaMoat) {
function setupScuttlingWrapping(buildConfiguration, applyLavaMoat, envVars) {
const scuttlingConfig =
envVars.ENABLE_MV3 === 'true'
? mv3ScuttlingConfig
: standardScuttlingConfig;
const { events } = buildConfiguration;
events.on('configurePipeline', ({ pipeline }) => {
pipeline.get('scuttle').push(
Expand Down Expand Up @@ -1111,6 +1123,7 @@ async function getEnvironmentVariables({ buildTarget, buildType, version }) {
ICON_NAMES: iconNames,
MULTICHAIN: config.MULTICHAIN === '1',
CONF: devMode ? config : {},
ENABLE_MV3: config.ENABLE_MV3,
IN_TEST: testing,
INFURA_PROJECT_ID: getInfuraProjectId({
buildType,
Expand Down
Loading

0 comments on commit b1bb8fe

Please sign in to comment.