Skip to content

Commit

Permalink
Merge pull request #23196 from MetaMask/Version-v11.10.1
Browse files Browse the repository at this point in the history
Version v11.10.1
  • Loading branch information
danjm authored Feb 27, 2024
2 parents 52c845b + 8f5af66 commit e0ce296
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 22 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [11.10.1]
### Fixed
- Fix custom network editing, via Settings, for some networks ([#23140](https://github.com/MetaMask/metamask-extension/pull/23140))

## [11.10.0]
### Added
- Added preset network image avatars in the 'Select a network' pop-up ([#22643](https://github.com/MetaMask/metamask-extension/pull/22643))
Expand Down Expand Up @@ -4389,7 +4393,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
### Uncategorized
- Added the ability to restore accounts from seed words.

[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.10.0...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.10.1...HEAD
[11.10.1]: https://github.com/MetaMask/metamask-extension/compare/v11.10.0...v11.10.1
[11.10.0]: https://github.com/MetaMask/metamask-extension/compare/v11.9.5...v11.10.0
[11.9.5]: https://github.com/MetaMask/metamask-extension/compare/v11.9.4...v11.9.5
[11.9.4]: https://github.com/MetaMask/metamask-extension/compare/v11.9.3...v11.9.4
Expand Down
1 change: 1 addition & 0 deletions app/images/velas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions app/scripts/migrations/105.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ import { migrate } from './105';
const MOCK_ADDRESS = '0x0';
const MOCK_ADDRESS_2 = '0x1';

const sentryCaptureExceptionMock = jest.fn();

global.sentry = {
startSession: jest.fn(),
endSession: jest.fn(),
toggleSession: jest.fn(),
captureException: sentryCaptureExceptionMock,
};

function addressToUUID(address: string): string {
return uuid({
random: sha256FromString(address).slice(0, 16),
Expand Down Expand Up @@ -257,5 +266,24 @@ describe('migration #105', () => {
},
});
});

it('captures an exception if the selectedAddress state is invalid', async () => {
const oldData = {
PreferencesController: {
identities: {},
selectedAddress: undefined,
},
};
const oldStorage = {
meta: { version: 103 },
data: oldData,
};
await migrate(oldStorage);

expect(sentryCaptureExceptionMock).toHaveBeenCalledTimes(1);
expect(sentryCaptureExceptionMock).toHaveBeenCalledWith(
new Error(`state.PreferencesController?.selectedAddress is undefined`),
);
});
});
});
8 changes: 8 additions & 0 deletions app/scripts/migrations/105.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ function createSelectedAccountForAccountsController(
) {
const selectedAddress = state.PreferencesController?.selectedAddress;

if (typeof selectedAddress !== 'string') {
global.sentry?.captureException?.(
new Error(
`state.PreferencesController?.selectedAddress is ${selectedAddress}`,
),
);
}

const selectedAccount = Object.values<InternalAccount>(
state.AccountsController.internalAccounts.accounts,
).find((account: InternalAccount) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metamask-crx",
"version": "11.10.0",
"version": "11.10.1",
"private": true,
"repository": {
"type": "git",
Expand Down
11 changes: 11 additions & 0 deletions shared/constants/network.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { existsSync } from 'fs';
import { join } from 'path';
import { CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP } from './network';

describe('NetworkConstants', () => {
it('has images files that exist for defined networks', () => {
Object.values(CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP).forEach((image) =>
expect(existsSync(join('app', image))).toBe(true),
);
});
});
6 changes: 3 additions & 3 deletions shared/constants/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export const DEXALOT_SUBNET_IMAGE_URL = './images/dexalut-subnet.svg';
export const DFK_CHAIN_IMAGE_URL = './images/dfk.png';
export const DOGECHAIN_IMAGE_URL = './images/dogechain.jpeg';
export const ENDURANCE_SMART_CHAIN_MAINNET_IMAGE_URL =
'./images/endurance-smart-chain.png';
'./images/endurance-smart-chain-mainnet.png';
export const ETHEREUM_CLASSIC_MAINNET_IMAGE_URL = './images/eth_classic.svg';
export const EVMOS_IMAGE_URL = './images/evmos.svg';
export const FLARE_MAINNET_IMAGE_URL = './images/flare-mainnet.svg';
Expand All @@ -398,11 +398,11 @@ export const SHARDEUM_LIBERTY_2X_IMAGE_URL = './images/shardeum-2.svg';
export const SHARDEUM_SPHINX_1X_IMAGE_URL = './images/shardeum-1.svg';
export const SHIB_MAINNET_IMAGE_URL = './images/shiba.svg';
export const SONGBIRD_MAINNET_IMAGE_URL = './images/songbird.svg';
export const STEP_NETWORK_IMAGE_URL = './images/setp.svg';
export const STEP_NETWORK_IMAGE_URL = './images/step.svg';
export const TELOS_EVM_MAINNET_IMAGE_URL = './images/telos.svg';
export const TENET_MAINNET_IMAGE_URL = './images/tenet.svg';
export const VELAS_EVM_MAINNET_IMAGE_URL = './images/velas.svg';
export const ZKATANA_MAINNET_IMAGE_URL = './images/zkatana.svg';
export const ZKATANA_MAINNET_IMAGE_URL = './images/zkatana.png';
export const ZORA_MAINNET_IMAGE_URL = './images/zora.svg';

export const INFURA_PROVIDER_TYPES = [
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/tests/ppom-blockaid-alert-erc20-approval.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ async function mockInfura(mockServer) {
}

describe('PPOM Blockaid Alert - Malicious ERC20 Approval @no-mmi', function () {
it('should show banner alert', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show banner alert', async function () {
await withFixtures(
{
dapp: true,
Expand All @@ -232,7 +233,7 @@ describe('PPOM Blockaid Alert - Malicious ERC20 Approval @no-mmi', function () {

const expectedTitle = 'This is a deceptive request';
const expectedDescription =
'If you approve this request, a third party known for scams might take all your assets.';
'If you approve this request, you might lose your assets.';

// Click TestDapp button to send JSON-RPC request
await driver.clickElement('#maliciousApprovalButton');
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/tests/ppom-blockaid-alert-erc20-transfer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ async function mockInfura(mockServer) {
}

describe('PPOM Blockaid Alert - Malicious ERC20 Transfer @no-mmi', function () {
it('should show banner alert', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show banner alert', async function () {
await withFixtures(
{
dapp: true,
Expand All @@ -180,7 +181,7 @@ describe('PPOM Blockaid Alert - Malicious ERC20 Transfer @no-mmi', function () {
async ({ driver }) => {
const expectedTitle = 'This is a deceptive request';
const expectedDescription =
'If you approve this request, a third party known for scams will take all your assets.';
'If you approve this request, you might lose your assets.';

await unlockWallet(driver);
await openDapp(driver);
Expand Down
9 changes: 6 additions & 3 deletions test/e2e/tests/ppom-blockaid-alert-simple-send.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ describe('Simple Send Security Alert - Blockaid @no-mmi', function () {
if (process.env.MULTICHAIN) {
return;
}
it('should not show security alerts for benign requests', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should not show security alerts for benign requests', async function () {
await withFixtures(
{
dapp: true,
Expand Down Expand Up @@ -161,7 +162,8 @@ describe('Simple Send Security Alert - Blockaid @no-mmi', function () {
* 'malicious_domain'. Some other tests are found in other files:
* e.g. test/e2e/flask/ppom-blockaid-alert-<name>.spec.js
*/
it('should show security alerts for malicious requests', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show security alerts for malicious requests', async function () {
await withFixtures(
{
dapp: true,
Expand Down Expand Up @@ -204,7 +206,8 @@ describe('Simple Send Security Alert - Blockaid @no-mmi', function () {
);
});

it('should show "Request may not be safe" if the PPOM request fails to check transaction', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show "Request may not be safe" if the PPOM request fails to check transaction', async function () {
await withFixtures(
{
dapp: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ async function mockInfura(mockServer) {
}

describe('PPOM Blockaid Alert - Set Trade farming order @no-mmi', function () {
it('should show banner alert', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show banner alert', async function () {
await withFixtures(
{
dapp: true,
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/tests/ppom-blockaid-alert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ describe('Confirmation Security Alert - Blockaid @no-mmi', function () {
);
});

it('should show "Request may not be safe" if the PPOM request fails to check transaction', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show "Request may not be safe" if the PPOM request fails to check transaction', async function () {
await withFixtures(
{
dapp: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ async function mockInfura(mockServer) {
}

describe('PPOM Blockaid Alert - Set Approval to All @no-mmi', function () {
it('should show banner alert', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show banner alert', async function () {
await withFixtures(
{
dapp: true,
Expand All @@ -270,7 +271,7 @@ describe('PPOM Blockaid Alert - Set Approval to All @no-mmi', function () {

const expectedTitle = 'This is a deceptive request';
const expectedDescription =
'If you approve this request, a third party known for scams might take all your assets.';
'If you approve this request, you might lose your assets.';

// Click TestDapp button to send JSON-RPC request
await driver.clickElement('#maliciousSetApprovalForAll');
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/tests/ppom-blockaid-toggle-metrics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ async function mockServerCalls(mockServer) {
}

describe('PPOM Blockaid Alert - Metrics @no-mmi', function () {
it('Successfully track button toggle on/off', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('Successfully track button toggle on/off', async function () {
await withFixtures(
{
dapp: true,
Expand Down
6 changes: 4 additions & 2 deletions test/e2e/tests/ppom-toggle-settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const {
const FixtureBuilder = require('../fixture-builder');

describe('PPOM Settings @no-mmi', function () {
it('should not show the PPOM warning when toggle is off', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should not show the PPOM warning when toggle is off', async function () {
await withFixtures(
{
dapp: true,
Expand Down Expand Up @@ -47,7 +48,8 @@ describe('PPOM Settings @no-mmi', function () {
);
});

it('should show the PPOM warning when the toggle is on', async function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('should show the PPOM warning when the toggle is on', async function () {
await withFixtures(
{
dapp: true,
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31606,12 +31606,12 @@ __metadata:
linkType: hard

"socks@npm:^2.6.1, socks@npm:^2.6.2, socks@npm:^2.7.1":
version: 2.8.0
resolution: "socks@npm:2.8.0"
version: 2.8.1
resolution: "socks@npm:2.8.1"
dependencies:
ip-address: "npm:^9.0.5"
smart-buffer: "npm:^4.2.0"
checksum: ed0224ce2c7daaa7690cb87cf53d9703ffc4e983aca221f6f5b46767b232658df49494fd86acd0bf97ada6de05248ea8ea625c2343d48155d8463fc40d4a340f
checksum: a3cc38e0716ab53a2db3fa00c703ca682ad54dbbc9ed4c7461624a999be6fa7cdc79fc904c411618e698d5eff55a55aa6d9329169a7db11636d0200814a2b5aa
languageName: node
linkType: hard

Expand Down

0 comments on commit e0ce296

Please sign in to comment.