Skip to content

Commit

Permalink
Merge branch 'develop' into ts-get-provider-state
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy authored Mar 27, 2024
2 parents 9807c25 + 6ad313f commit cbea90c
Show file tree
Hide file tree
Showing 640 changed files with 25,800 additions and 9,543 deletions.
31 changes: 15 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,18 @@ executors:
- image: cimg/node:20.11-browsers
resource_class: small
environment:
FONTCONFIG_PATH: /etc/fonts
NODE_OPTIONS: --max_old_space_size=2048
node-browsers-medium:
docker:
- image: cimg/node:20.11-browsers
resource_class: medium
environment:
FONTCONFIG_PATH: /etc/fonts
NODE_OPTIONS: --max_old_space_size=3072
node-browsers-medium-plus:
docker:
- image: cimg/node:20.11-browsers
resource_class: medium+
environment:
FONTCONFIG_PATH: /etc/fonts
NODE_OPTIONS: --max_old_space_size=4096
shellcheck:
docker:
Expand Down Expand Up @@ -878,7 +875,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome --retries 2 --debug
timeout 20m yarn test:e2e:chrome --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -905,7 +902,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome --retries 2 --debug
timeout 20m yarn test:e2e:chrome --retries 2
fi
no_output_timeout: 5m
environment:
Expand Down Expand Up @@ -934,7 +931,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome --retries 2 --debug || echo "Temporarily suppressing MV3 e2e test failures"
timeout 20m yarn test:e2e:chrome --retries 2 || echo "Temporarily suppressing MV3 e2e test failures"
fi
no_output_timeout: 5m
- store_artifacts:
Expand Down Expand Up @@ -1012,7 +1009,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome:rpc --retries 2 --debug --build-type=mmi
timeout 20m yarn test:e2e:chrome:rpc --retries 2 --build-type=mmi
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -1032,7 +1029,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser chrome --retries 2 --debug
yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser chrome --retries 2
fi
no_output_timeout: 5m

Expand All @@ -1054,7 +1051,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:firefox:flask --retries 2 --debug
timeout 20m yarn test:e2e:firefox:flask --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -1081,7 +1078,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome:flask --retries 2 --debug
timeout 20m yarn test:e2e:chrome:flask --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -1108,7 +1105,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome:mmi --retries 2 --debug --build-type=mmi
timeout 20m yarn test:e2e:chrome:mmi --retries 2 --build-type=mmi
fi
no_output_timeout: 5m
- store_artifacts:
Expand Down Expand Up @@ -1175,7 +1172,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:firefox --retries 2 --debug
timeout 20m yarn test:e2e:firefox --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand Down Expand Up @@ -1310,9 +1307,11 @@ jobs:
# important: generate lavamoat viz AFTER uploading builds as artifacts
# Temporarily disabled until we can update to a version of `sesify` with
# this fix included: https://github.com/LavaMoat/LavaMoat/pull/121
- run:
name: build:lavamoat-viz
command: ./.circleci/scripts/create-lavamoat-viz.sh
# Disabled 2024-03-25 due to flakiness.
# - see: https://github.com/MetaMask/metamask-extension/issues/23704
#- run:
# name: build:lavamoat-viz
# command: ./.circleci/scripts/create-lavamoat-viz.sh
- store_artifacts:
path: build-artifacts
destination: build-artifacts
Expand Down Expand Up @@ -1572,4 +1571,4 @@ jobs:
steps:
- run:
name: All Tests Passed
command: echo 'weew - everything passed!'
command: echo 'whew - everything passed!'
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ module.exports = {
path.resolve(__dirname, '.eslintrc.typescript-compat.js'),
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
// this rule is new, but we didn't use it before, so it's off now
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/no-shadow': [
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ privacy-snapshot.json @MetaMask/extension-privacy-reviewers
# For now, restricting approvals inside the .devcontainer folder to devs
# who were involved with the Codespaces project.
.devcontainer/ @MetaMask/library-admins @HowardBraham @plasmacorral @brad-decker

# Confirmations UX team to own code for confirmations on UI.
ui/pages/confirmations @MetaMask/confirmations-ux @MetaMask/confirmations-system-team
14 changes: 7 additions & 7 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Expand Down Expand Up @@ -33,16 +39,10 @@ Fixes:
## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've clearly explained what problem this PR is solving and how it is solved.
- [ ] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.
- [ ] I’ve properly set the pull request status:
- [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft".

## **Pre-merge reviewer checklist**

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-code-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
node_modules
rules_excluded:
example
mixpanel_project_token: ${{secrets.SECURITY_CODE_SCANNER_MIXPANEL_TOKEN}}
project_metrics_token: ${{secrets.SECURITY_SCAN_METRICS_TOKEN}}
slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }}
1 change: 1 addition & 0 deletions .metamaskrc.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ BLOCKAID_PUBLIC_KEY=
; SELENIUM_HEADLESS=
; Set this to 1 to make chrome e2e tests disable DoH/DoT and use system DNS
; SELENIUM_USE_SYSTEM_DNS=
ENABLE_CONFIRMATION_REDESIGN=
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ module.exports = {
config.resolve.alias['webextension-polyfill'] = require.resolve(
'../ui/__mocks__/webextension-polyfill.js',
);
config.resolve.alias['../../../../store/actions'] = require.resolve(
'../ui/__mocks__/actions.js',
);
config.resolve.fallback = {
child_process: false,
constants: false,
Expand All @@ -61,6 +64,7 @@ module.exports = {
{
loader: 'css-loader',
options: {
esModule: false,
import: false,
url: false,
},
Expand Down
3 changes: 2 additions & 1 deletion .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { NetworkStatus } from '@metamask/network-controller';
import { EthAccountType, EthMethod } from '@metamask/keyring-api';
import { CHAIN_IDS } from '../shared/constants/network';
import { copyable, divider, heading, panel, text } from '@metamask/snaps-sdk';
import { FirstTimeFlowType } from '../shared/constants/onboarding';

const state = {
invalidCustomNetwork: {
Expand Down Expand Up @@ -670,7 +671,7 @@ const state = {
[CHAIN_IDS.OPTIMISM_TESTNET]: false,
[CHAIN_IDS.AVALANCHE_TESTNET]: true,
},
firstTimeFlowType: 'create',
firstTimeFlowType: FirstTimeFlowType.create,
completedOnboarding: true,
knownMethodData: {
'0x60806040': {
Expand Down
84 changes: 84 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"ignorePaths": ["app/images", "package.json"],
"ignoreWords": [
"acitores",
"autofetch",
"azuretools",
"Brainstem",
"C01LUJL3T98",
"C05QXJA7NP8",
"cids",
"eamodio",
"initialisation",
"koalaman",
"mockttp",
"multibase",
"multicodec",
"namelookup",
"pluggable",
"protobufjs",
"regadas",
"remotedev",
"rvest",
"sesify",
"siginsights",
"testrpc",
"txinsights",
"webextension",
"xvfb"
],
"useGitignore": true,
"version": "0.2",
"words": [
"bignumber",
"blockaid",
"browserlistrc",
"cimg",
"codecov",
"codespace",
"codespaces",
"corepack",
"datetime",
"datetimes",
"dedupe",
"depcheck",
"devcontainer",
"devcontainers",
"endregion",
"ensdomains",
"flamegraph",
"FONTCONFIG",
"hardfork",
"hexstring",
"jazzicon",
"keccak",
"lavadome",
"lavamoat",
"lavapack",
"lockdown",
"metamaskbot",
"metamaskrc",
"metametrics",
"mocharc",
"MULTICHAIN",
"MULTIPROVIDER",
"npmcli",
"onboarded",
"pageload",
"petnames",
"pipefail",
"quickstart",
"recompiles",
"shellcheck",
"sourcemaps",
"sprintf",
"testcase",
"TESTFILES",
"testid",
"tsbuildinfo",
"tsconfigs",
"typecheck",
"yargs",
"yarnpkg"
]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"type": "pickString",
"id": "browserToUse",
"description": "Which browser do you want to test with?",
"options": ["chrome", "firefox"],
"options": ["chrome", "firefox", "all"],
"default": "chrome"
}
],
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"cSpell.words": ["blockaid", "lavamoat"],
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.tabSize": 2,
"files.associations": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
diff --git a/helpers/construct.js b/helpers/construct.js
index 3d3c232dcb226892cdf6181c6f4f4f40f2325fcc..da7e2696a244fadd35f0eeb5cae5f577ee3c7442 100644
index 771e1d7952e80f11619424fbabb3744b959ffa49..5fe152bc1129bd8c8b7bb217ca1972ac4e089051 100644
--- a/helpers/construct.js
+++ b/helpers/construct.js
@@ -1,18 +1,21 @@
@@ -1,10 +1,21 @@
-var setPrototypeOf = require("./setPrototypeOf.js");
-var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
-function _construct(Parent, args, Class) {
- if (isNativeReflectConstruct()) {
- module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
- } else {
- module.exports = _construct = function _construct(Parent, args, Class) {
- var a = [null];
- a.push.apply(a, args);
- var Constructor = Function.bind.apply(Parent, a);
- var instance = new Constructor();
- if (Class) setPrototypeOf(instance, Class.prototype);
- return instance;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
- }
- return _construct.apply(null, arguments);
-function _construct(t, e, r) {
- if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
- var o = [null];
- o.push.apply(o, e);
- var p = new (t.bind.apply(t, o))();
- return r && setPrototypeOf(p, r.prototype), p;
-}
-module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
\ No newline at end of file
+// All of MetaMask's supported browsers include `Reflect.construct` support, so
+// we don't need this polyfill.
+
+// This Proxy preseves the two properties that were added by `@babel/runtime`.
+// This Proxy preserves the two properties that were added by `@babel/runtime`.
+// I am not entire sure what these properties are for (maybe ES5/ES6
+// interoperability?) but they have been preserved just in case.
+const reflectProxy = new Proxy(
+const reflectProxy = new Proxy(
+ Reflect.construct,
+ {
+ get: function (target, property) {
Expand All @@ -39,7 +31,7 @@ index 3d3c232dcb226892cdf6181c6f4f4f40f2325fcc..da7e2696a244fadd35f0eeb5cae5f577
+ }
+ return Reflect.get(...arguments);
+ }
+ }
+ }
+);
+
+module.exports = reflectProxy;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/dist/util.js b/dist/util.js
index b9d1a7cca20c9da0d5d72010868dd84a58ea7442..6133b38ff6d584e3682eab627f9404d3e157c162 100644
--- a/dist/util.js
+++ b/dist/util.js
@@ -246,6 +246,9 @@ exports.safelyExecuteWithTimeout = safelyExecuteWithTimeout;
* @returns A 0x-prefixed hexidecimal checksummed address, if address is valid. Otherwise original input 0x-prefixe, if address is valid. Otherwise original input 0x-prefixed.
*/
function toChecksumHexAddress(address) {
+ if (address === undefined || address === null) {
+ return address;
+ }
const hexPrefixed = (0, utils_1.add0x)(address);
if (!(0, utils_1.isHexString)(hexPrefixed)) {
// Version 5.1 of ethereumjs-utils would have returned '0xY' for input 'y'
12 changes: 12 additions & 0 deletions .yarn/patches/@metamask-controller-utils-patch-a87ddc3d4b.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/dist/types.js b/dist/types.js
index c59368ae1b156162acec2aacb6d593c5122e9b09..012bb5197bbeaa5738b8144a540d3db8aa8cb85c 100644
--- a/dist/types.js
+++ b/dist/types.js
@@ -9,6 +9,7 @@ exports.InfuraNetworkType = {
goerli: 'goerli',
sepolia: 'sepolia',
'linea-goerli': 'linea-goerli',
+ "linea-sepolia": "linea-sepolia",
'linea-mainnet': 'linea-mainnet',
};
/**
Loading

0 comments on commit cbea90c

Please sign in to comment.