Skip to content

Commit f29c8a2

Browse files
authored
Merge branch 'develop' into feat/convert-mmi-controller-to-non-controller
2 parents 57c8a45 + d6c1df4 commit f29c8a2

File tree

421 files changed

+18505
-13157
lines changed

Some content is hidden

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

421 files changed

+18505
-13157
lines changed

.circleci/config.yml

+28-47
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ aliases:
8787
cat ${HOME}/project/.circleci/scripts/enable-vnc.sh >> ~/.bashrc
8888
fi
8989
90-
# Check if MMI Optional tests should run
91-
- &check-mmi-optional
92-
name: Check if MMI Optional tests should run
90+
# Check if MMI tests should run
91+
- &check-mmi-trigger
92+
name: Check if MMI tests should run
9393
command: |
94-
RUN_MMI_OPTIONAL=$(cat ./RUN_MMI_OPTIONAL)
95-
if [[ "${RUN_MMI_OPTIONAL}" == "true" ]]; then
96-
echo "Running MMI Optional tests"
94+
source mmi_trigger.env
95+
if [ "${run_mmi_tests}" == "true" ]; then
96+
echo "Running MMI tests"
9797
else
98-
echo "Skipping MMI Optional tests"
98+
echo "Skipping MMI tests"
9999
circleci step halt
100100
fi
101101
@@ -114,7 +114,7 @@ workflows:
114114
- trigger-beta-build:
115115
requires:
116116
- prep-deps
117-
- check-pr-tag
117+
- check-mmi-trigger
118118
- prep-deps
119119
- get-changed-files-with-git-diff:
120120
filters:
@@ -179,7 +179,7 @@ workflows:
179179
- prep-build-test-mmi-playwright:
180180
requires:
181181
- prep-deps
182-
- check-pr-tag
182+
- check-mmi-trigger
183183
- prep-build-storybook:
184184
requires:
185185
- prep-deps
@@ -231,7 +231,7 @@ workflows:
231231
requires:
232232
- prep-build-test-mmi
233233
- get-changed-files-with-git-diff
234-
- test-e2e-mmi-playwright - OPTIONAL:
234+
- test-e2e-mmi-playwright:
235235
requires:
236236
- prep-build-test-mmi-playwright
237237
- test-e2e-chrome-rpc-mmi:
@@ -421,39 +421,6 @@ jobs:
421421
name: Create GitHub Pull Request for version
422422
command: .circleci/scripts/release-create-release-pr.sh
423423

424-
check-pr-tag:
425-
docker:
426-
- image: cimg/base:stable
427-
steps:
428-
- run:
429-
name: Check for MMI Team Tag
430-
command: |
431-
#!/bin/bash
432-
433-
GH_LABEL=team-mmi
434-
if [ -z "$CIRCLE_PULL_REQUESTS" ]; then
435-
echo "Skipping tag check; this is not a PR."
436-
echo "false" > ./RUN_MMI_OPTIONAL
437-
exit 0
438-
fi
439-
440-
echo $CIRCLE_PULL_REQUESTS | sed 's/,/\n/g'
441-
442-
# See if any associated PRs have matching label
443-
HAS_MATCHING_PR=$(echo $CIRCLE_PULL_REQUESTS \
444-
| sed -e 's#,#\n#g' -e 's#/github.com/#/api.github.com/repos/#g' -e 's#/pull/#/pulls/#g' \
445-
| xargs -n1 curl -s \
446-
| jq -s "map((.labels|map(select(.name==\"${GH_LABEL}\"))))|flatten|length > 0")
447-
448-
echo "${GH_LABEL} tag presence: ${HAS_MATCHING_PR}"
449-
450-
# assign the RUN_MMI_OPTIONAL variable
451-
echo "${HAS_MATCHING_PR}" > ./RUN_MMI_OPTIONAL
452-
- persist_to_workspace:
453-
root: .
454-
paths:
455-
- RUN_MMI_OPTIONAL
456-
457424
prep-deps:
458425
executor: node-browsers-medium
459426
steps:
@@ -839,7 +806,7 @@ jobs:
839806
- run: corepack enable
840807
- attach_workspace:
841808
at: .
842-
- run: *check-mmi-optional
809+
- run: *check-mmi-trigger
843810
- run:
844811
name: Build MMI extension for Playwright e2e
845812
command: |
@@ -854,7 +821,6 @@ jobs:
854821
- persist_to_workspace:
855822
root: .
856823
paths:
857-
- RUN_MMI_OPTIONAL
858824
- dist-test-mmi-playwright
859825
- builds-test-mmi-playwright
860826
- store_artifacts:
@@ -1306,15 +1272,15 @@ jobs:
13061272
- store_test_results:
13071273
path: test/test-results/e2e
13081274

1309-
test-e2e-mmi-playwright - OPTIONAL:
1275+
test-e2e-mmi-playwright:
13101276
executor: playwright
13111277
parallelism: 2
13121278
steps:
13131279
- run: *shallow-git-clone-and-enable-vnc
13141280
- run: corepack enable
13151281
- attach_workspace:
13161282
at: .
1317-
- run: *check-mmi-optional
1283+
- run: *check-mmi-trigger
13181284
- run:
13191285
name: Move test build to dist
13201286
command: mv ./dist-test-mmi-playwright ./dist
@@ -1743,3 +1709,18 @@ jobs:
17431709
- run:
17441710
name: All Tests Passed
17451711
command: echo 'whew - everything passed!'
1712+
1713+
check-mmi-trigger:
1714+
executor: node-browsers-medium
1715+
steps:
1716+
- checkout
1717+
- run:
1718+
name: Check for MMI Team Label or Reviewer
1719+
command: ./.circleci/scripts/check_mmi_trigger.sh
1720+
- store_artifacts:
1721+
path: mmi_trigger.env
1722+
destination: mmi_trigger.env
1723+
- persist_to_workspace:
1724+
root: .
1725+
paths:
1726+
- mmi_trigger.env
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
# Ensure required environment variables are set
5+
if [ -z "$CIRCLE_PULL_REQUEST" ] || [ -z "$GITHUB_TOKEN" ]; then
6+
echo "This appears to be a fork or required environment variables are not set."
7+
echo "Skipping MMI tests."
8+
echo "run_mmi_tests=false" > mmi_trigger.env
9+
exit 0
10+
fi
11+
12+
# Extract PR number from the pull request URL
13+
PR_NUMBER=$(echo "$CIRCLE_PULL_REQUEST" | awk -F'/' '{print $NF}')
14+
15+
# Define repository details
16+
REPO_OWNER="$CIRCLE_PROJECT_USERNAME"
17+
REPO_NAME=$(basename "$CIRCLE_REPOSITORY_URL" .git)
18+
19+
# Fetch PR details using GitHub API
20+
PR_DETAILS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
21+
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER")
22+
23+
# Fetch submitted reviews
24+
SUBMITTED_REVIEWS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
25+
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER/reviews")
26+
27+
# Check for label 'team-mmi'
28+
LABEL_EXISTS=$(jq -r '.labels[]? | select(.name == "team-mmi") | length > 0' <<< "$PR_DETAILS")
29+
30+
# Check for individual reviewer 'mmi'
31+
REVIEWER_REQUESTED=$(jq -r '.requested_reviewers[]? | select(.login == "mmi") | length > 0' <<< "$PR_DETAILS")
32+
33+
# Check for team reviewer 'mmi'
34+
TEAM_REQUESTED=$(jq -r '.requested_teams[]? | select(.slug == "mmi") | length > 0' <<< "$PR_DETAILS")
35+
36+
# Check if 'mmi' submitted a review
37+
REVIEWER_SUBMITTED=$(jq -r '.[]? | select(.user.login == "mmi") | length > 0' <<< "$SUBMITTED_REVIEWS")
38+
39+
# Determine which condition was met and trigger tests if needed
40+
if [[ "$LABEL_EXISTS" == "true" || "$REVIEWER_REQUESTED" == "true" || "$TEAM_REQUESTED" == "true" || "$REVIEWER_SUBMITTED" == "true" ]]; then
41+
echo "run_mmi_tests=true" > mmi_trigger.env
42+
43+
# Log exactly which condition was met
44+
echo "Conditions met:"
45+
if [[ "$LABEL_EXISTS" == "true" ]]; then
46+
echo "- Label 'team-mmi' found."
47+
fi
48+
if [[ "$REVIEWER_REQUESTED" == "true" ]]; then
49+
echo "- Reviewer 'mmi' requested."
50+
fi
51+
if [[ "$TEAM_REQUESTED" == "true" ]]; then
52+
echo "- Team 'mmi' requested."
53+
fi
54+
if [[ "$REVIEWER_SUBMITTED" == "true" ]]; then
55+
echo "- Reviewer 'mmi' submitted a review."
56+
fi
57+
else
58+
echo "run_mmi_tests=false" > mmi_trigger.env
59+
echo "Skipping MMI tests: Neither the 'team-mmi' label was found nor a reviewer from the 'MetaMask/mmi' team was assigned."
60+
fi

.metamaskrc.dist

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
; This variable is required
55
INFURA_PROJECT_ID=00000000000
66

7+
; This variable is not required but it's necessary for the storybook
8+
; to render stories that use onchain data.
9+
INFURA_STORYBOOK_PROJECT_ID=
10+
711
;PASSWORD=METAMASK PASSWORD
812
;SEGMENT_WRITE_KEY=
913
;BRIDGE_USE_DEV_APIS=

.storybook/main.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const path = require('path');
22
const { ProvidePlugin } = require('webpack');
33
const CopyWebpackPlugin = require('copy-webpack-plugin');
4+
const dotenv = require('dotenv');
5+
dotenv.config({ path: path.resolve(__dirname, '../.metamaskrc') });
6+
47
module.exports = {
58
core: {
69
disableTelemetry: true,
@@ -29,6 +32,7 @@ module.exports = {
2932
env: (config) => ({
3033
...config,
3134
ENABLE_CONFIRMATION_REDESIGN: true,
35+
INFURA_PROJECT_ID: process.env.INFURA_STORYBOOK_PROJECT_ID || '',
3236
}),
3337
// Uses babel.config.js settings and prevents "Missing class properties transform" error
3438
babel: async (options) => ({
@@ -48,10 +52,16 @@ module.exports = {
4852
config.resolve.alias['../../../../../../store/actions'] = require.resolve(
4953
'../ui/__mocks__/actions.js',
5054
);
55+
config.resolve.alias['../../../store/actions'] = require.resolve(
56+
'../ui/__mocks__/actions.js',
57+
);
5158
// Import within controller-utils crashes storybook.
5259
config.resolve.alias['@ethereumjs/util'] = require.resolve(
5360
'../ui/__mocks__/ethereumjs-util.js',
5461
);
62+
config.resolve.alias['./useNftCollectionsMetadata'] = require.resolve(
63+
'../ui/__mocks__/useNftCollectionsMetadata.js',
64+
);
5565
config.resolve.fallback = {
5666
child_process: false,
5767
constants: false,
@@ -86,7 +96,7 @@ module.exports = {
8696
sourceMap: true,
8797
implementation: require('sass-embedded'),
8898
sassOptions: {
89-
includePaths: ['ui/css/', 'node_modules/',],
99+
includePaths: ['ui/css/', 'node_modules/'],
90100
},
91101
},
92102
},
@@ -96,12 +106,7 @@ module.exports = {
96106
new CopyWebpackPlugin({
97107
patterns: [
98108
{
99-
from: path.join(
100-
'ui',
101-
'css',
102-
'utilities',
103-
'fonts/',
104-
),
109+
from: path.join('ui', 'css', 'utilities', 'fonts/'),
105110
to: 'fonts',
106111
},
107112
{

.storybook/test-data.js

+1
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,7 @@ const state = {
15961596
},
15971597
},
15981598
},
1599+
openSeaEnabled: true,
15991600
},
16001601
appState: {
16011602
shouldClose: false,

.yarn/patches/@babel-core-npm-7.23.2-b93f586907.patch

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/lib/index.js b/lib/index.js
2+
index 55b58e10eef589ff80ae33ebd1f1efe488b01153..e919c190d33ab9563f1364667fb4f5894bb6435d 100644
3+
--- a/lib/index.js
4+
+++ b/lib/index.js
5+
@@ -211,7 +211,6 @@ var _transform = require("./transform.js");
6+
var _transformFile = require("./transform-file.js");
7+
var _transformAst = require("./transform-ast.js");
8+
var _parse = require("./parse.js");
9+
-var thisFile = require("./index.js");
10+
;
11+
const version = exports.version = "7.25.9";
12+
const resolvePlugin = (name, dirname) => resolvers.resolvePlugin(name, dirname, false).filepath;

.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch renamed to .yarn/patches/@babel-runtime-npm-7.25.9-fe8c62510a.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
diff --git a/helpers/construct.js b/helpers/construct.js
2-
index 771e1d7952e80f11619424fbabb3744b959ffa49..5fe152bc1129bd8c8b7bb217ca1972ac4e089051 100644
2+
index aee8e70448824f509d6605e2dfa4455167442f21..00a69eba8d4c15a1f9aa318a50abb96c2ec447d9 100644
33
--- a/helpers/construct.js
44
+++ b/helpers/construct.js
5-
@@ -1,10 +1,21 @@
5+
@@ -1,10 +1,22 @@
6+
var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
67
-var setPrototypeOf = require("./setPrototypeOf.js");
7-
-var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
88
-function _construct(t, e, r) {
99
- if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
1010
- var o = [null];

.yarnrc.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ npmAuditIgnoreAdvisories:
117117
# Currently in use for the network list drag and drop functionality.
118118
# Maintenance has stopped and the project will be archived in 2025.
119119
- 'react-beautiful-dnd (deprecation)'
120-
120+
# New package name format for new versions: @ethereumjs/wallet.
121+
- 'ethereumjs-wallet (deprecation)'
121122
npmRegistries:
122123
'https://npm.pkg.github.com':
123124
npmAlwaysAuth: true

0 commit comments

Comments
 (0)