Skip to content

Commit

Permalink
Merge branch 'develop' into only-search-4byte-with-4bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 authored Aug 8, 2022
2 parents 1cd8f57 + e3420a4 commit d8e4868
Show file tree
Hide file tree
Showing 18 changed files with 1,546 additions and 2,155 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.18.3]
### Fixed
- Prevent confirm screen from showing method name from contract registry for transactions created within MetaMask ([#15472](https://github.com/MetaMask/metamask-extension/pull/15472))

## [10.18.2]
### Changed
- Enhance approval screen title logic ([#15406](https://github.com/MetaMask/metamask-extension/pull/15406))

### Fixed
- Ensure smart contract interactions are properly represented on the confirm screen ([#15446](https://github.com/MetaMask/metamask-extension/pull/15446))
- Fix update of max amount in send flow after network switch([#15444](https://github.com/MetaMask/metamask-extension/pull/15444))
- Fix to ensure user can access full screen editing of network forms from the popup ([#15442](https://github.com/MetaMask/metamask-extension/pull/15442))
- Possibly fix bug which crashes firefox on startup after upgrade to v10.18.1 ([#15425](https://github.com/MetaMask/metamask-extension/pull/15425))
- Fix blocking of editing transactions that had a contract address recipient but no tx data ([#15424](https://github.com/MetaMask/metamask-extension/pull/15424))
- Fix error that could leave the app in a stuck state when quickly moving between the send screen and other screens ([#15420](https://github.com/MetaMask/metamask-extension/pull/15420))
- Fix send screen for Optimism network ([#15419](https://github.com/MetaMask/metamask-extension/pull/15419))
- Fix to ensure the correct balance is used when validating send amounts ([#15449](https://github.com/MetaMask/metamask-extension/pull/15449))
- Fix error that makes app unusable after clicking activity list items for token approval transactions ([#15398](https://github.com/MetaMask/metamask-extension/pull/15398))

## [10.18.1]
### Changed
- Move the metrics opt-in screen to the second screen of the onboarding flow ([#15313](https://github.com/MetaMask/metamask-extension/pull/15313))
Expand Down Expand Up @@ -3088,7 +3107,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.18.1...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.18.3...HEAD
[10.18.3]: https://github.com/MetaMask/metamask-extension/compare/v10.18.2...v10.18.3
[10.18.2]: https://github.com/MetaMask/metamask-extension/compare/v10.18.1...v10.18.2
[10.18.1]: https://github.com/MetaMask/metamask-extension/compare/v10.18.0...v10.18.1
[10.18.0]: https://github.com/MetaMask/metamask-extension/compare/v10.17.0...v10.18.0
[10.17.0]: https://github.com/MetaMask/metamask-extension/compare/v10.16.2...v10.17.0
Expand Down
15 changes: 9 additions & 6 deletions app/scripts/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const PHISHING_WARNING_PAGE = 'metamask-phishing-warning-page';
const PHISHING_SAFELIST = 'metamask-phishing-safelist';
const PROVIDER = 'metamask-provider';

// For more information about these legacy streams, see here:
// https://github.com/MetaMask/metamask-extension/issues/15491
// TODO:LegacyProvider: Delete
const LEGACY_CONTENT_SCRIPT = 'contentscript';
const LEGACY_INPAGE = 'inpage';
Expand Down Expand Up @@ -329,16 +331,17 @@ function documentElementCheck() {
*/
function blockedDomainCheck() {
const blockedDomains = [
'uscourts.gov',
'dropbox.com',
'webbyawards.com',
'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html',
'adyen.com',
'gravityforms.com',
'harbourair.com',
'ani.gamer.com.tw',
'blueskybooking.com',
'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html',
'docs.google.com',
'dropbox.com',
'gravityforms.com',
'harbourair.com',
'sharefile.com',
'uscourts.gov',
'webbyawards.com',
];
const currentUrl = window.location.href;
let currentRegex;
Expand Down
2 changes: 2 additions & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,8 @@ export default class MetamaskController extends EventEmitter {

this.setupControllerEventSubscriptions();

// For more information about these legacy streams, see here:
// https://github.com/MetaMask/metamask-extension/issues/15491
// TODO:LegacyProvider: Delete
this.publicConfigStore = this.createPublicConfigStore();

Expand Down
19 changes: 4 additions & 15 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,13 @@ module.exports = function (api) {
parserOpts: {
strictMode: true,
},
targets: {
browsers: ['chrome >= 66', 'firefox >= 68'],
},
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{
targets: {
browsers: ['chrome >= 66', 'firefox >= 68'],
},
},
],
'@babel/preset-env',
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
};
};
5 changes: 0 additions & 5 deletions development/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ const { getBrowserVersionMap } = require('./utils');
// Required for LavaMoat policy generation
require('loose-envify');
require('globalthis');
require('@babel/plugin-proposal-object-rest-spread');
require('@babel/plugin-transform-runtime');
require('@babel/plugin-proposal-class-properties');
require('@babel/plugin-proposal-optional-chaining');
require('@babel/plugin-proposal-nullish-coalescing-operator');
require('@babel/preset-env');
require('@babel/preset-react');
require('@babel/preset-typescript');
Expand Down
20 changes: 17 additions & 3 deletions development/build/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,22 @@ const Sqrl = require('squirrelly');
const lavapack = require('@lavamoat/lavapack');
const lavamoatBrowserify = require('lavamoat-browserify');
const terser = require('terser');
const ini = require('ini');

const bifyModuleGroups = require('bify-module-groups');

const metamaskrc = require('rc')('metamask', {
const configPath = path.resolve(__dirname, '..', '..', '.metamaskrc');
let configContents = '';
try {
configContents = readFileSync(configPath, {
encoding: 'utf8',
});
} catch (error) {
if (error.code !== 'ENOENT') {
throw error;
}
}
const metamaskrc = {
INFURA_PROJECT_ID: process.env.INFURA_PROJECT_ID,
INFURA_BETA_PROJECT_ID: process.env.INFURA_BETA_PROJECT_ID,
INFURA_FLASK_PROJECT_ID: process.env.INFURA_FLASK_PROJECT_ID,
Expand All @@ -45,11 +57,13 @@ const metamaskrc = require('rc')('metamask', {
process.env.SENTRY_DSN_DEV ||
'https://[email protected]/273496',
SIWE_V1: process.env.SIWE_V1,
});
...ini.parse(configContents),
};

const { streamFlatMap } = require('../stream-flat-map');
const { BuildType } = require('../lib/build-type');
const { BUILD_TARGETS } = require('./constants');
const { logError } = require('./utils');

const {
createTask,
Expand Down Expand Up @@ -1040,7 +1054,7 @@ async function createBundle(buildConfiguration, { reloadOnChange }) {
if (!reloadOnChange) {
bundleStream.on('error', (error) => {
console.error('Bundling failed! See details below.');
console.error(error.stack || error);
logError(error);
process.exit(1);
});
}
Expand Down
3 changes: 2 additions & 1 deletion development/build/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
};

const { setupTaskDisplay } = require('./display');
const { logError } = require('./utils');

async function runTask(taskName, { skipStats } = {}) {
if (!(taskName in tasks)) {
Expand All @@ -30,7 +31,7 @@ async function runTask(taskName, { skipStats } = {}) {
console.error(
`MetaMask build: Encountered an error while running task "${taskName}".`,
);
console.error(err);
logError(err);
process.exit(1);
}
taskEvents.emit('complete');
Expand Down
15 changes: 15 additions & 0 deletions development/build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ function getBrowserVersionMap(platforms, version) {
}, {});
}

/**
* Log an error to the console.
*
* This function includes a workaround for a SES bug that results in errors
* being printed to the console as `{}`. The workaround is to print the stack
* instead, which does work correctly.
*
* @see {@link https://github.com/endojs/endo/issues/944}
* @param {Error} error - The error to print
*/
function logError(error) {
console.error(error.stack || error);
}

module.exports = {
getBrowserVersionMap,
logError,
};
7 changes: 3 additions & 4 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2201,8 +2201,8 @@
}
},
"@babel/runtime": {
"packages": {
"@storybook/api>regenerator-runtime": true
"globals": {
"regeneratorRuntime": "write"
}
},
"@download/blockies": {
Expand Down Expand Up @@ -2318,8 +2318,7 @@
},
"@eth-optimism/contracts": {
"packages": {
"ethers": true,
"ethers>@ethersproject/abstract-provider": true
"ethers": true
}
},
"@ethereumjs/common": {
Expand Down
7 changes: 3 additions & 4 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2201,8 +2201,8 @@
}
},
"@babel/runtime": {
"packages": {
"@storybook/api>regenerator-runtime": true
"globals": {
"regeneratorRuntime": "write"
}
},
"@download/blockies": {
Expand Down Expand Up @@ -2318,8 +2318,7 @@
},
"@eth-optimism/contracts": {
"packages": {
"ethers": true,
"ethers>@ethersproject/abstract-provider": true
"ethers": true
}
},
"@ethereumjs/common": {
Expand Down
7 changes: 3 additions & 4 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2201,8 +2201,8 @@
}
},
"@babel/runtime": {
"packages": {
"@storybook/api>regenerator-runtime": true
"globals": {
"regeneratorRuntime": "write"
}
},
"@download/blockies": {
Expand Down Expand Up @@ -2318,8 +2318,7 @@
},
"@eth-optimism/contracts": {
"packages": {
"ethers": true,
"ethers>@ethersproject/abstract-provider": true
"ethers": true
}
},
"@ethereumjs/common": {
Expand Down
16 changes: 16 additions & 0 deletions lavamoat/build-system/policy-override.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@
"@babel/preset-typescript": true
}
},
"@babel/eslint-parser": {
"builtin": {
"path": true
},
"packages": {
"@babel/core": true,
"@babel/eslint-parser>eslint-scope": true,
"@babel/eslint-parser>eslint-visitor-keys": true,
"@babel/eslint-parser>semver": true,
"depcheck>@babel/parser": true,
"eslint": true
},
"globals": {
"process.versions": true
}
},
"eslint>@eslint/eslintrc": {
"builtin": {
"assert": true,
Expand Down
Loading

0 comments on commit d8e4868

Please sign in to comment.