diff --git a/.circleci/config.yml b/.circleci/config.yml index 1755e91b46a1..54656c08828d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -125,6 +125,9 @@ workflows: - prep-build-test-flask: requires: - prep-deps + - prep-build-test-mmi: + requires: + - prep-deps - prep-build-storybook: requires: - prep-deps @@ -162,6 +165,12 @@ workflows: - test-e2e-firefox-snaps-flask: requires: - prep-build-test-flask + - test-e2e-chrome-mmi: + requires: + - prep-build-test-mmi + - test-e2e-chrome-rpc-mmi: + requires: + - prep-build-test-mmi - test-e2e-chrome-mv3: requires: - prep-build-test-mv3 @@ -248,6 +257,8 @@ workflows: - test-e2e-firefox-snaps - test-e2e-chrome-snaps-flask - test-e2e-firefox-snaps-flask + - test-e2e-chrome-mmi + - test-e2e-chrome-rpc-mmi - test-storybook - benchmark: requires: @@ -579,6 +590,27 @@ jobs: - dist-test-flask - builds-test-flask + prep-build-test-mmi: + executor: node-browsers-medium-plus + steps: + - run: *shallow-git-clone + - attach_workspace: + at: . + - run: + name: Build extension for testing + command: yarn build:test:mmi + - run: + name: Move test build to 'dist-test' to avoid conflict with production build + command: mv ./dist ./dist-test-mmi + - run: + name: Move test zips to 'builds-test' to avoid conflict with production build + command: mv ./builds ./builds-test-mmi + - persist_to_workspace: + root: . + paths: + - dist-test-mmi + - builds-test-mmi + prep-build-test-mv3: executor: node-browsers-medium-plus steps: @@ -855,6 +887,42 @@ jobs: - store_test_results: path: test/test-results/e2e.xml + test-e2e-chrome-rpc-mmi: + executor: node-browsers + steps: + - checkout + - run: + name: Re-Install Chrome + command: ./.circleci/scripts/chrome-install.sh + - attach_workspace: + at: . + - run: + name: Move test build to dist + command: mv ./dist-test-mmi ./dist + - run: + name: Move test zips to builds + command: mv ./builds-test-mmi ./builds + - run: + name: test:e2e:chrome:rpc + command: | + if .circleci/scripts/test-run-e2e.sh + then + yarn test:e2e:chrome:rpc --retries 2 --debug --build-type=mmi + fi + no_output_timeout: 20m + - run: + name: Merge JUnit report + command: | + if [ "$(ls -A test/test-results/e2e)" ]; then + yarn test:e2e:report + fi + when: always + - store_artifacts: + path: test-artifacts + destination: test-artifacts + - store_test_results: + path: test/test-results/e2e.xml + test-e2e-firefox-snaps: executor: node-browsers parallelism: 4 @@ -1003,6 +1071,43 @@ jobs: - store_test_results: path: test/test-results/e2e.xml + test-e2e-chrome-mmi: + executor: node-browsers + parallelism: 4 + steps: + - run: *shallow-git-clone + - run: + name: Re-Install Chrome + command: ./.circleci/scripts/chrome-install.sh + - attach_workspace: + at: . + - run: + name: Move test build to dist + command: mv ./dist-test-mmi ./dist + - run: + name: Move test zips to builds + command: mv ./builds-test-mmi ./builds + - run: + name: test:e2e:chrome:mmi + command: | + if .circleci/scripts/test-run-e2e.sh + then + yarn test:e2e:chrome:mmi --retries 2 --debug --build-type=mmi + fi + no_output_timeout: 20m + - run: + name: Merge JUnit report + command: | + if [ "$(ls -A test/test-results/e2e)" ]; then + yarn test:e2e:report + fi + when: always + - store_artifacts: + path: test-artifacts + destination: test-artifacts + - store_test_results: + path: test/test-results/e2e.xml + test-e2e-firefox: executor: node-browsers-medium-plus parallelism: 8 diff --git a/README.md b/README.md index c817f3c570d6..a07efd30327c 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,16 @@ Single e2e tests can be run with `yarn test:e2e:single test/e2e/tests/TEST_NAME. For example, to run the `account-details` tests using Chrome, with debug logging and with the browser set to remain open upon failure, you would use: `yarn test:e2e:single test/e2e/tests/account-details.spec.js --browser=chrome --debug --leave-running` +#### Running specific builds types e2e test + +Differnt build types have different e2e tests sets. In order to run them look in the `packaje.json` file. You will find: +```console + "test:e2e:chrome:mmi": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mmi", + "test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps", + "test:e2e:chrome:mv3": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mv3", +``` +Note: MMI runs a subset of MetaMask's e2e tests. To facilitate this, we have appended the `@no-mmi` tags to the names of those tests that are not applicable to this build type. + ### Changing dependencies Whenever you change dependencies (adding, removing, or updating, either in `package.json` or `yarn.lock`), there are various files that must be kept up-to-date. diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index e11ed08c5669..e168df836073 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -1600,9 +1600,6 @@ "message": "Dateiimport fehlgeschlagen? Bitte hier klicken!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "Die abgelegte Datei ist zu groß." - }, "flaskWelcomeUninstall": { "message": "Sie sollten diese Erweiterung deinstallieren.", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index c6ba71ba5f04..601de5052597 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -1600,9 +1600,6 @@ "message": "Η εισαγωγή αρχείων δεν λειτουργεί; Κάντε κλικ εδώ!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "Το υποβαλλόμενο αρχείο είναι πολύ μεγάλο." - }, "flaskWelcomeUninstall": { "message": "θα πρέπει να απεγκαταστήσετε αυτή την επέκταση", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 342649dbb644..9f31d16f2ab4 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1628,9 +1628,6 @@ "message": "File import not working? Click here!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "The dropped file is too big." - }, "flaskWelcomeUninstall": { "message": "you should uninstall this extension", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 1289b6ec18f6..8f3def01527a 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -1600,9 +1600,6 @@ "message": "¿No funciona la importación del archivo? Haga clic aquí.", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "El archivo arrastrado es demasiado grande." - }, "flaskWelcomeUninstall": { "message": "le recomendamos que desinstale esta extensión", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index b5e898b17e64..e3704bf6508e 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -1600,9 +1600,6 @@ "message": "L’importation de fichier ne fonctionne pas ? Cliquez ici !", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "Le fichier déconnecté est trop volumineux." - }, "flaskWelcomeUninstall": { "message": "vous devriez désinstaller cette extension", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 8305de259fb3..101d7c02646a 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -1600,9 +1600,6 @@ "message": "फाइल इम्पोर्ट काम नहीं कर रहा है? यहां क्लिक करें!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "ड्रॉप की गई फाइल बहुत बड़ी है।" - }, "flaskWelcomeUninstall": { "message": "आपको इस एक्सटेन्शन को अनइंस्टाल करना चाहिए", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 092c28c62c9e..fc4fc7531fa8 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -1600,9 +1600,6 @@ "message": "Impor file tidak bekerja? Klik di sini!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "File yang didrop terlalu besar." - }, "flaskWelcomeUninstall": { "message": "Anda harus menghapus ekstensi ini", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 7e78096819ad..bb2c6d540be7 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -1600,9 +1600,6 @@ "message": "ファイルのインポートが機能していない場合、ここをクリックしてください!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "ドロップされたファイルが大きすぎます。" - }, "flaskWelcomeUninstall": { "message": "この拡張機能はアンインストールしてください", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 852c9eff84ff..ce14c8c40777 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -1600,9 +1600,6 @@ "message": "파일 가져오기가 작동하지 않나요? 여기를 클릭하세요.", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "드롭한 파일 크기가 너무 큽니다." - }, "flaskWelcomeUninstall": { "message": "이 확장 프로그램을 삭제해야 합니다", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index fd60c9ecbf9f..3a20e56b4899 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -1600,9 +1600,6 @@ "message": "A importação de arquivo não está funcionando? Clique aqui!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "O arquivo inserido é grande demais." - }, "flaskWelcomeUninstall": { "message": "você deve desinstalar essa extensão", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 7618ac9e2ed0..9e73a224001a 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -1600,9 +1600,6 @@ "message": "Импорт файлов не работает? Нажмите здесь!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "Добавленный файл слишком велик." - }, "flaskWelcomeUninstall": { "message": "вам нужно должны удалить это расширение", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index b69e584676af..7160c8b8a0ea 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -1600,9 +1600,6 @@ "message": "Hindi gumagana ang pag-import ng file? Mag-click dito!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "Napakalaki ng na-drop na file." - }, "flaskWelcomeUninstall": { "message": "dapat mong i-uninstall ang extension na ito", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index adbc419d8435..a896fc4505d0 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -1600,9 +1600,6 @@ "message": "Dosya içe aktarma çalışmıyor mu? Buraya tıklayın!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "Bırakılan dosya çok büyük." - }, "flaskWelcomeUninstall": { "message": "bu uzantıyı kaldırmalısın", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 64af5ae9448f..f0c5824066f3 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -1600,9 +1600,6 @@ "message": "Tính năng nhập tập tin không hoạt động? Nhấp vào đây!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "Kích thước tập tin thả vào quá lớn." - }, "flaskWelcomeUninstall": { "message": "bạn nên gỡ cài đặt tiện ích mở rộng này", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index a0a2c30ef84a..4e47e7b4e445 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -1600,9 +1600,6 @@ "message": "文件导入失败?点击这里!", "description": "Helps user import their account from a JSON file" }, - "fileTooBig": { - "message": "拖放的文件太大。" - }, "flaskWelcomeUninstall": { "message": "您应该卸载此扩展程序", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index c6238f0b8a15..f4eee8a6ee92 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -2791,7 +2791,9 @@ export default class TransactionController extends EventEmitter { const currentTransactions = this.store.getState().transactions || {}; const incomingTransactions = transactions - .filter((tx) => !this._hasTransactionHash(tx.hash, currentTransactions)) + .filter((tx) => + this._hasNoDuplicateIncoming(tx.hash, currentTransactions), + ) .reduce((result, tx) => { result[tx.id] = tx; return result; @@ -2809,8 +2811,21 @@ export default class TransactionController extends EventEmitter { this.store.updateState({ lastFetchedBlockNumbers }); } - _hasTransactionHash(hash, transactions) { - return Object.values(transactions).some((tx) => tx.hash === hash); + /** + * This function checks if there is not any transaction in the provided + * transactions object that has the same hash as the provided txHash and has a + * type of 'incoming'. + * + * @param {string} txHash - The transaction hash to compare with. + * @param {object} transactions - The transactions to check in. + * @returns {boolean} Returns false if there is a transaction that has the + * same hash as the provided txHash and has a type of 'incoming'. Otherwise, + * it returns true. + */ + _hasNoDuplicateIncoming(txHash, transactions) { + return !Object.values(transactions).some( + (tx) => tx.hash === txHash && tx.type === TransactionType.incoming, + ); } // Approvals diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js index d882b1064698..046ed4bae3ad 100644 --- a/app/scripts/controllers/transactions/index.test.js +++ b/app/scripts/controllers/transactions/index.test.js @@ -3426,13 +3426,34 @@ describe('Transaction Controller', function () { }); }); - it('ignores new transactions if hash matches existing transaction', async function () { - const existingTransaction = TRANSACTION_META_MOCK; - const incomingTransaction1 = { ...TRANSACTION_META_MOCK, id: 2 }; - const incomingTransaction2 = { ...TRANSACTION_META_MOCK, id: 3 }; + it('ignores new transactions if hash matches existing incoming transaction', async function () { + const existingTransaction = { + ...TRANSACTION_META_MOCK, + id: 1, + type: TransactionType.incoming, + }; + const existingTransaction2 = { + ...TRANSACTION_META_MOCK, + id: 2, + hash: '0xNewHash', + type: TransactionType.simpleSend, + }; + + const incomingTransaction1 = { + ...TRANSACTION_META_MOCK, + id: 3, + type: TransactionType.incoming, + }; + const incomingTransaction2 = { + ...TRANSACTION_META_MOCK, + id: 4, + hash: '0xNewHash', + type: TransactionType.incoming, + }; txController.store.getState().transactions = { [existingTransaction.id]: existingTransaction, + [existingTransaction2.id]: existingTransaction2, }; await incomingTransactionHelperEventMock.firstCall.args[1]({ @@ -3442,6 +3463,8 @@ describe('Transaction Controller', function () { assert.deepEqual(txController.store.getState().transactions, { [existingTransaction.id]: existingTransaction, + [existingTransaction2.id]: existingTransaction2, + [incomingTransaction2.id]: incomingTransaction2, }); }); }); diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 08d2838bf391..c02f711a04c5 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -860,6 +860,9 @@ export default class MetamaskController extends EventEmitter { saveState: async () => { await this.keyringController.persistAllKeyrings(); }, + removeAccount: async (address) => { + await this.removeAccount(address); + }, }); builder.type = SnapKeyring.type; return builder; diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index a6eca099ed40..0470833108c3 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -161,29 +161,13 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": true, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, + "@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "webpack>events": true } }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true - } - }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": { "globals": { "Headers": true, @@ -208,6 +192,7 @@ "crypto": true }, "packages": { + "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true, "@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true } }, @@ -934,7 +919,7 @@ "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -942,21 +927,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-json-rpc-middleware>clone": { "packages": { "browserify>buffer": true @@ -979,7 +949,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true } @@ -1051,7 +1021,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "mocha>serialize-javascript>randombytes": true, "webpack>events": true @@ -1107,17 +1077,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/ppom-validator>elliptic": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>hdkey": { "packages": { "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": true, @@ -1137,32 +1115,6 @@ "koa>content-disposition>safe-buffer": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": true, - "bn.js": true, - "browserify>buffer": true, - "eth-sig-util>ethereumjs-util>ethjs-util": true, - "eth-sig-util>tweetnacl": true, - "eth-sig-util>tweetnacl-util": true - } - }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-token-tracker": { "globals": { "console.warn": true @@ -1292,6 +1244,17 @@ "webpack>events": true } }, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, "@metamask/eth-trezor-keyring>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1306,7 +1269,7 @@ }, "@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": { "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true } }, "@metamask/eth-trezor-keyring>@trezor/connect-web": { @@ -1567,7 +1530,7 @@ "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1575,21 +1538,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1605,26 +1553,39 @@ }, "@metamask/keyring-controller>ethereumjs-wallet": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": true, "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, "eth-lattice-keyring>gridplus-sdk>aes-js": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, "mocha>serialize-javascript>randombytes": true, "uuid": true } }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>assert": true, + "browserify>buffer": true, + "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "ethereumjs-util>ethereum-cryptography>hash.js": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, @@ -1663,7 +1624,7 @@ "@metamask/message-manager>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1671,21 +1632,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/message-manager>jsonschema": { "packages": { "browserify>url": true @@ -3602,13 +3548,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3649,11 +3603,19 @@ "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "ethereumjs-util": { "packages": { "bn.js": true, @@ -3716,14 +3678,9 @@ }, "ethereumjs-util>ethereum-cryptography": { "packages": { - "browserify>assert": true, "browserify>buffer": true, - "browserify>crypto-browserify>create-hmac": true, - "ethereumjs-util>ethereum-cryptography>bs58check": true, - "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "koa>content-disposition>safe-buffer": true, "mocha>serialize-javascript>randombytes": true } }, diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index bede398269d4..4c633de6fec1 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -161,29 +161,13 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": true, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, + "@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "webpack>events": true } }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true - } - }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": { "globals": { "Headers": true, @@ -208,6 +192,7 @@ "crypto": true }, "packages": { + "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true, "@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true } }, @@ -1005,7 +990,7 @@ "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1013,21 +998,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-json-rpc-middleware>clone": { "packages": { "browserify>buffer": true @@ -1050,7 +1020,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true } @@ -1122,7 +1092,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "mocha>serialize-javascript>randombytes": true, "webpack>events": true @@ -1178,17 +1148,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/ppom-validator>elliptic": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>hdkey": { "packages": { "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": true, @@ -1210,11 +1188,11 @@ }, "@metamask/eth-snap-keyring": { "globals": { - "console.error": true, - "console.warn": true + "console.error": true }, "packages": { "@ethereumjs/tx": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "@metamask/eth-snap-keyring>@metamask/keyring-api": true, "@metamask/eth-snap-keyring>@metamask/utils": true, "@metamask/eth-snap-keyring>uuid": true, @@ -1225,27 +1203,32 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": true, - "bn.js": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-snap-keyring>@metamask/utils": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "eth-sig-util>tweetnacl": true, "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true, + "superstruct": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { "globals": { - "TextEncoder": true, - "crypto": true + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true, + "superstruct": true } }, "@metamask/eth-snap-keyring>@metamask/keyring-api": { @@ -1420,6 +1403,17 @@ "webpack>events": true } }, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, "@metamask/eth-trezor-keyring>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1434,7 +1428,7 @@ }, "@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": { "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true } }, "@metamask/eth-trezor-keyring>@trezor/connect-web": { @@ -1718,7 +1712,7 @@ "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1726,21 +1720,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1756,26 +1735,39 @@ }, "@metamask/keyring-controller>ethereumjs-wallet": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": true, "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, "eth-lattice-keyring>gridplus-sdk>aes-js": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, "mocha>serialize-javascript>randombytes": true, "uuid": true } }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>assert": true, + "browserify>buffer": true, + "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "ethereumjs-util>ethereum-cryptography>hash.js": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, @@ -1814,7 +1806,7 @@ "@metamask/message-manager>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1822,21 +1814,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/message-manager>jsonschema": { "packages": { "browserify>url": true @@ -4094,13 +4071,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -4141,11 +4126,19 @@ "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "ethereumjs-util": { "packages": { "bn.js": true, @@ -4208,14 +4201,9 @@ }, "ethereumjs-util>ethereum-cryptography": { "packages": { - "browserify>assert": true, "browserify>buffer": true, - "browserify>crypto-browserify>create-hmac": true, - "ethereumjs-util>ethereum-cryptography>bs58check": true, - "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "koa>content-disposition>safe-buffer": true, "mocha>serialize-javascript>randombytes": true } }, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 873139ec3333..aa332f56b1bb 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -161,29 +161,13 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": true, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, + "@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "webpack>events": true } }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true - } - }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": { "globals": { "Headers": true, @@ -208,6 +192,7 @@ "crypto": true }, "packages": { + "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true, "@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true } }, @@ -1005,7 +990,7 @@ "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1013,21 +998,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-json-rpc-middleware>clone": { "packages": { "browserify>buffer": true @@ -1050,7 +1020,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true } @@ -1122,7 +1092,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "mocha>serialize-javascript>randombytes": true, "webpack>events": true @@ -1178,17 +1148,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/ppom-validator>elliptic": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>hdkey": { "packages": { "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": true, @@ -1210,11 +1188,11 @@ }, "@metamask/eth-snap-keyring": { "globals": { - "console.error": true, - "console.warn": true + "console.error": true }, "packages": { "@ethereumjs/tx": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "@metamask/eth-snap-keyring>@metamask/keyring-api": true, "@metamask/eth-snap-keyring>@metamask/utils": true, "@metamask/eth-snap-keyring>uuid": true, @@ -1225,27 +1203,32 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": true, - "bn.js": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-snap-keyring>@metamask/utils": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "eth-sig-util>tweetnacl": true, "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true, + "superstruct": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { "globals": { - "TextEncoder": true, - "crypto": true + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true, + "superstruct": true } }, "@metamask/eth-snap-keyring>@metamask/keyring-api": { @@ -1420,6 +1403,17 @@ "webpack>events": true } }, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, "@metamask/eth-trezor-keyring>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1434,7 +1428,7 @@ }, "@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": { "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true } }, "@metamask/eth-trezor-keyring>@trezor/connect-web": { @@ -1718,7 +1712,7 @@ "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1726,21 +1720,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1756,26 +1735,39 @@ }, "@metamask/keyring-controller>ethereumjs-wallet": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": true, "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, "eth-lattice-keyring>gridplus-sdk>aes-js": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, "mocha>serialize-javascript>randombytes": true, "uuid": true } }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>assert": true, + "browserify>buffer": true, + "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "ethereumjs-util>ethereum-cryptography>hash.js": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, @@ -1814,7 +1806,7 @@ "@metamask/message-manager>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1822,21 +1814,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/message-manager>jsonschema": { "packages": { "browserify>url": true @@ -4110,13 +4087,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -4157,11 +4142,19 @@ "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "ethereumjs-util": { "packages": { "bn.js": true, @@ -4224,14 +4217,9 @@ }, "ethereumjs-util>ethereum-cryptography": { "packages": { - "browserify>assert": true, "browserify>buffer": true, - "browserify>crypto-browserify>create-hmac": true, - "ethereumjs-util>ethereum-cryptography>bs58check": true, - "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "koa>content-disposition>safe-buffer": true, "mocha>serialize-javascript>randombytes": true } }, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index b338c1e8f697..c8b44246f8b9 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -161,29 +161,13 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": true, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, + "@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "webpack>events": true } }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true - } - }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": { "globals": { "Headers": true, @@ -208,6 +192,7 @@ "crypto": true }, "packages": { + "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true, "@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true } }, @@ -934,7 +919,7 @@ "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -942,21 +927,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-json-rpc-middleware>clone": { "packages": { "browserify>buffer": true @@ -979,7 +949,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true } @@ -1051,7 +1021,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "mocha>serialize-javascript>randombytes": true, "webpack>events": true @@ -1107,17 +1077,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/ppom-validator>elliptic": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>hdkey": { "packages": { "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": true, @@ -1137,32 +1115,6 @@ "koa>content-disposition>safe-buffer": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": true, - "bn.js": true, - "browserify>buffer": true, - "eth-sig-util>ethereumjs-util>ethjs-util": true, - "eth-sig-util>tweetnacl": true, - "eth-sig-util>tweetnacl-util": true - } - }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-token-tracker": { "globals": { "console.warn": true @@ -1292,6 +1244,17 @@ "webpack>events": true } }, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, "@metamask/eth-trezor-keyring>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1306,7 +1269,7 @@ }, "@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": { "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true } }, "@metamask/eth-trezor-keyring>@trezor/connect-web": { @@ -1567,7 +1530,7 @@ "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1575,21 +1538,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1605,26 +1553,39 @@ }, "@metamask/keyring-controller>ethereumjs-wallet": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": true, "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, "eth-lattice-keyring>gridplus-sdk>aes-js": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, "mocha>serialize-javascript>randombytes": true, "uuid": true } }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>assert": true, + "browserify>buffer": true, + "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "ethereumjs-util>ethereum-cryptography>hash.js": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, @@ -1663,7 +1624,7 @@ "@metamask/message-manager>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1671,21 +1632,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/message-manager>jsonschema": { "packages": { "browserify>url": true @@ -3881,13 +3827,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3928,11 +3882,19 @@ "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "ethereumjs-util": { "packages": { "bn.js": true, @@ -3995,14 +3957,9 @@ }, "ethereumjs-util>ethereum-cryptography": { "packages": { - "browserify>assert": true, "browserify>buffer": true, - "browserify>crypto-browserify>create-hmac": true, - "ethereumjs-util>ethereum-cryptography>bs58check": true, - "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "koa>content-disposition>safe-buffer": true, "mocha>serialize-javascript>randombytes": true } }, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 99beea63a6c4..2f2ebb2330f9 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -161,29 +161,13 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": true, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, + "@ethereumjs/tx>ethereum-cryptography": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "webpack>events": true } }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, - "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true - } - }, - "@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@ethereumjs/tx>@ethereumjs/util>micro-ftch": { "globals": { "Headers": true, @@ -208,6 +192,7 @@ "crypto": true }, "packages": { + "@ethereumjs/tx>ethereum-cryptography>@noble/curves": true, "@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true } }, @@ -1074,7 +1059,7 @@ "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1082,21 +1067,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-json-rpc-middleware>clone": { "packages": { "browserify>buffer": true @@ -1119,7 +1089,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true } @@ -1191,7 +1161,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "mocha>serialize-javascript>randombytes": true, "webpack>events": true @@ -1247,17 +1217,25 @@ }, "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": { "packages": { + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "@metamask/ppom-validator>elliptic": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/eth-ledger-bridge-keyring>hdkey": { "packages": { "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": true, @@ -1277,32 +1255,6 @@ "koa>content-disposition>safe-buffer": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": true, - "bn.js": true, - "browserify>buffer": true, - "eth-sig-util>ethereumjs-util>ethjs-util": true, - "eth-sig-util>tweetnacl": true, - "eth-sig-util>tweetnacl-util": true - } - }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/eth-token-tracker": { "globals": { "console.warn": true @@ -1432,6 +1384,17 @@ "webpack>events": true } }, + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, "@metamask/eth-trezor-keyring>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1446,7 +1409,7 @@ }, "@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": { "packages": { - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true + "@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true } }, "@metamask/eth-trezor-keyring>@trezor/connect-web": { @@ -1707,7 +1670,7 @@ "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1715,21 +1678,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1745,26 +1693,39 @@ }, "@metamask/keyring-controller>ethereumjs-wallet": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": true, "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, "eth-lattice-keyring>gridplus-sdk>aes-js": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, "mocha>serialize-javascript>randombytes": true, "uuid": true } }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": { + "packages": { + "browserify>assert": true, + "browserify>buffer": true, + "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "ethereumjs-util>ethereum-cryptography>hash.js": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true + } + }, "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { + "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, @@ -1803,7 +1764,7 @@ "@metamask/message-manager>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": true, + "@ethereumjs/tx>ethereum-cryptography": true, "bn.js": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, @@ -1811,21 +1772,6 @@ "eth-sig-util>tweetnacl-util": true } }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/message-manager>jsonschema": { "packages": { "browserify>url": true @@ -3742,13 +3688,21 @@ "bn.js": true, "browserify>assert": true, "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true, "koa>content-disposition>safe-buffer": true } }, + "eth-sig-util>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "eth-sig-util>ethereumjs-util>ethjs-util": { "packages": { "browserify>buffer": true, @@ -3789,11 +3743,19 @@ "browserify>assert": true, "browserify>buffer": true, "eth-sig-util>ethereumjs-util>ethjs-util": true, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-util>rlp": true } }, + "ethereumjs-abi>ethereumjs-util>ethereum-cryptography": { + "packages": { + "browserify>buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>secp256k1": true, + "mocha>serialize-javascript>randombytes": true + } + }, "ethereumjs-util": { "packages": { "bn.js": true, @@ -3856,14 +3818,9 @@ }, "ethereumjs-util>ethereum-cryptography": { "packages": { - "browserify>assert": true, "browserify>buffer": true, - "browserify>crypto-browserify>create-hmac": true, - "ethereumjs-util>ethereum-cryptography>bs58check": true, - "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "koa>content-disposition>safe-buffer": true, "mocha>serialize-javascript>randombytes": true } }, diff --git a/package.json b/package.json index 0ff9576f0d03..3495c0719a06 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "benchmark:firefox": "SELENIUM_BROWSER=firefox ts-node test/e2e/benchmark.js", "build:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' SENTRY_DSN_DEV=https://fake@sentry.io/0000000 PORTFOLIO_URL=http://127.0.0.1:8080 yarn build test", "build:test:flask": "BLOCKAID_FILE_CDN=storage.googleapis.com/ppom-mock-cdn yarn build test --build-type flask", + "build:test:mmi": "yarn build test --build-type mmi", "build:test:mv3": "ENABLE_MV3=true SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' SENTRY_DSN_DEV=https://fake@sentry.io/0000000 PORTFOLIO_URL=http://127.0.0.1:8080 yarn build test", "build:test:dev:mv3": "ENABLE_MV3=true SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' SENTRY_DSN_DEV=https://fake@sentry.io/0000000 PORTFOLIO_URL=http://127.0.0.1:8080 yarn build:dev testDev --apply-lavamoat=false", "test": "yarn lint && yarn test:unit && yarn test:unit:jest", @@ -36,6 +37,7 @@ "test:unit:global": "mocha test/unit-global/*.test.js", "test:unit:mocha": "node ./test/run-unit-tests.js --mocha", "test:e2e:chrome": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js", + "test:e2e:chrome:mmi": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mmi", "test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps", "test:e2e:chrome:mv3": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mv3", "test:e2e:chrome:rpc": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --rpc", @@ -245,7 +247,7 @@ "@metamask/eth-json-rpc-middleware": "^11.0.0", "@metamask/eth-keyring-controller": "^10.0.1", "@metamask/eth-ledger-bridge-keyring": "^0.15.0", - "@metamask/eth-snap-keyring": "^0.1.4", + "@metamask/eth-snap-keyring": "^0.2.2", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/eth-trezor-keyring": "^1.1.0", "@metamask/etherscan-link": "^2.2.0", diff --git a/shared/constants/swaps.ts b/shared/constants/swaps.ts index 73e2926e7143..1b60dc8f95fc 100644 --- a/shared/constants/swaps.ts +++ b/shared/constants/swaps.ts @@ -142,8 +142,6 @@ export const WETH_ZKSYNC_ERA_CONTRACT_ADDRESS = const SWAPS_TESTNET_CHAIN_ID = '0x539'; -export const MMI_SWAPS_URL = 'https://metamask-institutional.io/swap'; - export const SWAPS_API_V2_BASE_URL = 'https://swap.metaswap.codefi.network'; export const SWAPS_DEV_API_V2_BASE_URL = 'https://swap.dev-api.cx.metamask.io'; export const GAS_API_BASE_URL = 'https://gas-api.metaswap.codefi.network'; diff --git a/test/e2e/metrics/permissions-approved.spec.js b/test/e2e/metrics/permissions-approved.spec.js index 1a7b7cc71f70..9bca8354b92c 100644 --- a/test/e2e/metrics/permissions-approved.spec.js +++ b/test/e2e/metrics/permissions-approved.spec.js @@ -45,7 +45,7 @@ async function mockSegment(mockServer) { } describe('Permissions Approved Event', function () { - it('Successfully tracked when connecting to dapp', async function () { + it('Successfully tracked when connecting to dapp @no-mmi', async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/metrics/signature-approved.spec.js b/test/e2e/metrics/signature-approved.spec.js index 989656832184..cb5a0deb9f0e 100644 --- a/test/e2e/metrics/signature-approved.spec.js +++ b/test/e2e/metrics/signature-approved.spec.js @@ -77,7 +77,7 @@ async function clickSignOnSignatureConfirmation(driver) { await driver.getAllWindowHandles(); } -describe('Signature Approved Event', function () { +describe('Signature Approved Event @no-mmi', function () { it('Successfully tracked for signTypedData_v4', async function () { await withFixtures( { diff --git a/test/e2e/metrics/swaps.spec.js b/test/e2e/metrics/swaps.spec.js index ba7e7db5270c..1f49b5899737 100644 --- a/test/e2e/metrics/swaps.spec.js +++ b/test/e2e/metrics/swaps.spec.js @@ -99,7 +99,7 @@ async function mockSegmentAndMetaswapRequests(mockServer) { ]; } -describe('Swap Eth for another Token', function () { +describe('Swap Eth for another Token @no-mmi', function () { it('Completes a Swap between ETH and DAI after changing initial rate', async function () { const { initialBalanceInHex } = genRandInitBal(); diff --git a/test/e2e/metrics/transaction-finalized.spec.js b/test/e2e/metrics/transaction-finalized.spec.js index 1fbfeba0dd55..e24a9bd11fc5 100644 --- a/test/e2e/metrics/transaction-finalized.spec.js +++ b/test/e2e/metrics/transaction-finalized.spec.js @@ -134,7 +134,7 @@ const eventHasZeroAddressAnonymousId = (payload) => payload.anonymousId === '0x0000000000000000'; describe('Transaction Finalized Event', function () { - it('Successfully tracked when sending a transaction', async function () { + it('Successfully tracked when sending a transaction @no-mmi', async function () { await withFixtures( { fixtures: new FixtureBuilder() diff --git a/test/e2e/metrics/wallet-created.spec.js b/test/e2e/metrics/wallet-created.spec.js index c1c573e00e47..17152df356fa 100644 --- a/test/e2e/metrics/wallet-created.spec.js +++ b/test/e2e/metrics/wallet-created.spec.js @@ -49,7 +49,7 @@ async function mockSegment(mockServer) { } describe('Wallet Created Events', function () { - it('are sent when onboarding user who chooses to opt in metrics', async function () { + it('are sent when onboarding user who chooses to opt in metrics @no-mmi', async function () { await withFixtures( { fixtures: new FixtureBuilder({ onboarding: true }) diff --git a/test/e2e/nft/erc1155-interaction.spec.js b/test/e2e/nft/erc1155-interaction.spec.js index c6cb2020c78b..948458ef7c8e 100644 --- a/test/e2e/nft/erc1155-interaction.spec.js +++ b/test/e2e/nft/erc1155-interaction.spec.js @@ -132,7 +132,7 @@ describe('ERC1155 NFTs testdapp interaction', function () { ); }); - it('should enable approval for a third party address to manage all ERC1155 token', async function () { + it('should enable approval for a third party address to manage all ERC1155 token @no-mmi', async function () { const expectedMessageTitle = 'Allow access to and transfer all of your NFTs from this collection?'; const expectedDescription = @@ -222,7 +222,7 @@ describe('ERC1155 NFTs testdapp interaction', function () { ); }); - it('should revoke approval for a third party address to manage all ERC1155 token', async function () { + it('should revoke approval for a third party address to manage all ERC1155 token @no-mmi', async function () { const expectedMessageTitle = 'Revoke permission to access and transfer all of your NFTs from this collection?'; const expectedDescription = diff --git a/test/e2e/nft/erc721-interaction.spec.js b/test/e2e/nft/erc721-interaction.spec.js index bbfd544e76cf..9d169e6ebce2 100644 --- a/test/e2e/nft/erc721-interaction.spec.js +++ b/test/e2e/nft/erc721-interaction.spec.js @@ -15,7 +15,7 @@ describe('ERC721 NFTs testdapp interaction', function () { ], }; - it('should prompt users to add their NFTs to their wallet (one by one)', async function () { + it('should prompt users to add their NFTs to their wallet (one by one) @no-mmi', async function () { await withFixtures( { dapp: true, @@ -359,7 +359,7 @@ describe('ERC721 NFTs testdapp interaction', function () { ); }); - it('should enable approval for a third party address to manage all ERC721 NFTs', async function () { + it('should enable approval for a third party address to manage all ERC721 NFTs @no-mmi', async function () { await withFixtures( { dapp: true, @@ -430,7 +430,7 @@ describe('ERC721 NFTs testdapp interaction', function () { ); }); - it('should disable approval for a third party address to manage all ERC721 NFTs', async function () { + it('should disable approval for a third party address to manage all ERC721 NFTs @no-mmi', async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/run-all.js b/test/e2e/run-all.js index d8094187a018..5065da716d62 100644 --- a/test/e2e/run-all.js +++ b/test/e2e/run-all.js @@ -53,6 +53,10 @@ async function main() { 'Run tests in debug mode, logging each driver interaction', type: 'boolean', }) + .option('mmi', { + description: `Run only mmi related tests`, + type: 'boolean', + }) .option('snaps', { description: `run snaps e2e tests`, type: 'boolean', @@ -89,6 +93,7 @@ async function main() { browser, debug, retries, + mmi, snaps, mv3, rpc, @@ -151,6 +156,9 @@ async function main() { if (updateSnapshot) { args.push('--update-snapshot'); } + if (mmi) { + args.push('--mmi'); + } // For running E2Es in parallel in CI const currentChunkIndex = process.env.CIRCLE_NODE_INDEX ?? 0; diff --git a/test/e2e/run-e2e-test.js b/test/e2e/run-e2e-test.js index a7b8f8602c8c..ca8ee6966ccd 100644 --- a/test/e2e/run-e2e-test.js +++ b/test/e2e/run-e2e-test.js @@ -25,6 +25,10 @@ async function main() { 'Run tests in debug mode, logging each driver interaction', type: 'boolean', }) + .option('mmi', { + description: 'Run only mmi related tests', + type: 'boolean', + }) .option('retries', { default: 0, description: @@ -60,6 +64,7 @@ async function main() { const { browser, debug, + mmi, e2eTestPath, retries, retryUntilFailure, @@ -117,6 +122,13 @@ async function main() { const configFile = path.join(__dirname, '.mocharc.js'); const extraArgs = process.env.E2E_ARGS?.split(' ') || []; + // If mmi flag is passed + if (mmi) { + // Tests that contains `@no-mmi` will be grep (-g) and inverted (-i) + // meaning that all tests with @no-mmi in the title will be ignored + extraArgs.push('-g', '@no-mmi', '-i'); + } + const dir = 'test/test-results/e2e'; fs.mkdir(dir, { recursive: true }); diff --git a/test/e2e/snaps/enums.js b/test/e2e/snaps/enums.js index 6ec77de3087e..d16ed59ae4a4 100644 --- a/test/e2e/snaps/enums.js +++ b/test/e2e/snaps/enums.js @@ -2,5 +2,5 @@ module.exports = { TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/snaps/test-snaps/0.38.0-flask.1/', TEST_SNAPS_SIMPLE_KEYRING_WEBSITE_URL: - 'https://metamask.github.io/snap-simple-keyring/0.1.4/', + 'https://metamask.github.io/snap-simple-keyring/0.2.2/', }; diff --git a/test/e2e/snaps/test-snap-manageAccount.spec.js b/test/e2e/snaps/test-snap-manageAccount.spec.js index 44ca13dbc3f6..1c634ec7331b 100644 --- a/test/e2e/snaps/test-snap-manageAccount.spec.js +++ b/test/e2e/snaps/test-snap-manageAccount.spec.js @@ -81,15 +81,12 @@ describe('Test Snap Account', function () { // create new account on dapp await driver.clickElement({ - text: 'Create Account', + text: 'Create account', tag: 'div', }); - // create name for account - await driver.fill("[placeholder='Name']", 'snap account'); - await driver.clickElement({ - text: 'Execute', + text: 'Create Account', tag: 'button', }); diff --git a/test/e2e/swaps/swap-eth.spec.js b/test/e2e/swaps/swap-eth.spec.js index 380ce2965987..d6693368ed39 100644 --- a/test/e2e/swaps/swap-eth.spec.js +++ b/test/e2e/swaps/swap-eth.spec.js @@ -9,7 +9,7 @@ const { changeExchangeRate, } = require('./shared'); -describe('Swap Eth for another Token', function () { +describe('Swap Eth for another Token @no-mmi', function () { it('Completes second Swaps while first swap is processing', async function () { withFixturesOptions.ganacheOptions.blockTime = 10; diff --git a/test/e2e/swaps/swaps-notifications.spec.js b/test/e2e/swaps/swaps-notifications.spec.js index 2a5a4b9bb25c..4aa0508696af 100644 --- a/test/e2e/swaps/swaps-notifications.spec.js +++ b/test/e2e/swaps/swaps-notifications.spec.js @@ -8,7 +8,7 @@ const { checkNotification, } = require('./shared'); -describe('Swaps - notifications', function () { +describe('Swaps - notifications @no-mmi', function () { async function mockTradesApiPriceSlippageError(mockServer) { await mockServer .forGet('https://swap.metaswap.codefi.network/networks/1/trades') diff --git a/test/e2e/tests/add-account.spec.js b/test/e2e/tests/add-account.spec.js index 93b0696b33df..b44fbad027d6 100644 --- a/test/e2e/tests/add-account.spec.js +++ b/test/e2e/tests/add-account.spec.js @@ -55,7 +55,7 @@ describe('Add account', function () { ); }); - it('should not affect public address when using secret recovery phrase to recover account with non-zero balance', async function () { + it('should not affect public address when using secret recovery phrase to recover account with non-zero balance @no-mmi', async function () { await withFixtures( { fixtures: new FixtureBuilder({ onboarding: true }).build(), @@ -161,7 +161,7 @@ describe('Add account', function () { ); }); - it('should be possible to remove an account imported with a private key, but should not be possible to remove an account generated from the SRP imported in onboarding', async function () { + it('should be possible to remove an account imported with a private key, but should not be possible to remove an account generated from the SRP imported in onboarding @no-mmi', async function () { const testPrivateKey = '14abe6f4aab7f9f626fe981c864d0adeb5685f289ac9270c27b8fd790b4235d6'; diff --git a/test/e2e/tests/chain-interactions.spec.js b/test/e2e/tests/chain-interactions.spec.js index efb83f35eb34..3ed9be54fdb4 100644 --- a/test/e2e/tests/chain-interactions.spec.js +++ b/test/e2e/tests/chain-interactions.spec.js @@ -15,7 +15,7 @@ describe('Chain Interactions', function () { ], concurrent: { port, chainId }, }; - it('should add the Ganache test chain and not switch the network', async function () { + it('should add the Ganache test chain and not switch the network @no-mmi', async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/tests/custom-token-add-approve.spec.js b/test/e2e/tests/custom-token-add-approve.spec.js index f5f58e5d8ebb..03aaecac7b1f 100644 --- a/test/e2e/tests/custom-token-add-approve.spec.js +++ b/test/e2e/tests/custom-token-add-approve.spec.js @@ -81,7 +81,7 @@ describe('Create token, approve token and approve token without gas', function ( ); }); - it('approves an already created token and displays the token approval data', async function () { + it('approves an already created token and displays the token approval data @no-mmi', async function () { await withFixtures( { dapp: true, @@ -199,7 +199,7 @@ describe('Create token, approve token and approve token without gas', function ( ); }); - it('set custom spending cap, customizes gas, edit spending cap and checks transaction in transaction list', async function () { + it('set custom spending cap, customizes gas, edit spending cap and checks transaction in transaction list @no-mmi', async function () { await withFixtures( { dapp: true, @@ -341,7 +341,7 @@ describe('Create token, approve token and approve token without gas', function ( ); }); - it('set maximum spending cap, submits the transaction and finds the transaction in the transactions list', async function () { + it('set maximum spending cap, submits the transaction and finds the transaction in the transactions list @no-mmi', async function () { await withFixtures( { dapp: true, @@ -425,7 +425,7 @@ describe('Create token, approve token and approve token without gas', function ( ); }); - it('approves token without gas, set site suggested spending cap, submits the transaction and finds the transaction in the transactions list', async function () { + it('approves token without gas, set site suggested spending cap, submits the transaction and finds the transaction in the transactions list @no-mmi', async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/tests/edit-gas-fee.spec.js b/test/e2e/tests/edit-gas-fee.spec.js index 965ffaec7054..38a71361359f 100644 --- a/test/e2e/tests/edit-gas-fee.spec.js +++ b/test/e2e/tests/edit-gas-fee.spec.js @@ -8,7 +8,7 @@ const { const FixtureBuilder = require('../fixture-builder'); describe('Editing Confirm Transaction', function () { - it('allows selecting high, medium, low gas estimates on edit gas fee popover', async function () { + it('allows selecting high, medium, low gas estimates on edit gas fee popover @no-mmi', async function () { const ganacheOptions = { hardfork: 'london', accounts: [ @@ -179,7 +179,7 @@ describe('Editing Confirm Transaction', function () { ); }); - it('should use dapp suggested estimates for transaction coming from dapp', async function () { + it('should use dapp suggested estimates for transaction coming from dapp @no-mmi', async function () { const ganacheOptions = { hardfork: 'london', accounts: [ diff --git a/test/e2e/tests/errors.spec.js b/test/e2e/tests/errors.spec.js index 9c4927a7838e..245a26cbd925 100644 --- a/test/e2e/tests/errors.spec.js +++ b/test/e2e/tests/errors.spec.js @@ -273,7 +273,7 @@ describe('Sentry errors', function () { }); }); - describe('before initialization, after opting into metrics', function () { + describe('before initialization, after opting into metrics @no-mmi', function () { it('should send error events in background', async function () { await withFixtures( { @@ -589,7 +589,7 @@ describe('Sentry errors', function () { }); }); - describe('after initialization, after opting into metrics', function () { + describe('after initialization, after opting into metrics @no-mmi', function () { it('should send error events in background', async function () { await withFixtures( { @@ -784,7 +784,7 @@ describe('Sentry errors', function () { }); }); - it('should have no policy gaps for UI controller state', async function () { + it('should have no policy gaps for UI controller state @no-mmi', async function () { await withFixtures( { fixtures: new FixtureBuilder().build(), @@ -808,7 +808,7 @@ describe('Sentry errors', function () { ); }); - it('should not have extra properties in UI state mask', async function () { + it('should not have extra properties in UI state mask @no-mmi', async function () { const expectedMissingState = { currentPopupId: false, // Initialized as undefined // Part of transaction controller store, but missing from the initial diff --git a/test/e2e/tests/incremental-security.spec.js b/test/e2e/tests/incremental-security.spec.js index e96b49c195e8..961dcc904959 100644 --- a/test/e2e/tests/incremental-security.spec.js +++ b/test/e2e/tests/incremental-security.spec.js @@ -17,7 +17,7 @@ describe('Incremental Security', function () { }, ], }; - it('Back up Secret Recovery Phrase from backup reminder', async function () { + it('Back up Secret Recovery Phrase from backup reminder @no-mmi', async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/tests/portfolio-site.spec.js b/test/e2e/tests/portfolio-site.spec.js index 93e0d0877518..b708460e0a13 100644 --- a/test/e2e/tests/portfolio-site.spec.js +++ b/test/e2e/tests/portfolio-site.spec.js @@ -12,7 +12,7 @@ describe('Portfolio site', function () { }, ], }; - it('should link to the portfolio site', async function () { + it('should link to the portfolio site @no-mmi', async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/tests/send-eth.spec.js b/test/e2e/tests/send-eth.spec.js index b0c4838c62ce..320102bc57e1 100644 --- a/test/e2e/tests/send-eth.spec.js +++ b/test/e2e/tests/send-eth.spec.js @@ -399,7 +399,7 @@ describe('Send ETH from inside MetaMask to a Multisig Address', function () { ], }; - it('finds the transaction in the transactions list', async function () { + it('finds the transaction in the transactions list @no-mmi', async function () { await withFixtures( { fixtures: new FixtureBuilder().build(), diff --git a/test/e2e/tests/signature-request.spec.js b/test/e2e/tests/signature-request.spec.js index 375f643be807..bbe628d9a831 100644 --- a/test/e2e/tests/signature-request.spec.js +++ b/test/e2e/tests/signature-request.spec.js @@ -124,7 +124,7 @@ describe('Sign Typed Data Signature Request', function () { }); testData.forEach((data) => { - it(`can queue multiple Signature Requests of ${data.type} and confirm`, async function () { + it(`can queue multiple Signature Requests of ${data.type} and confirm @no-mmi`, async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/tests/simple-send.spec.js b/test/e2e/tests/simple-send.spec.js index e8c582a2c7c7..3e692ed0e599 100644 --- a/test/e2e/tests/simple-send.spec.js +++ b/test/e2e/tests/simple-send.spec.js @@ -7,7 +7,7 @@ const { const FixtureBuilder = require('../fixture-builder'); describe('Simple send', function () { - it('can send a simple transaction from one account to another', async function () { + it('can send a simple transaction from one account to another @no-mmi', async function () { const ganacheOptions = { accounts: [ { diff --git a/test/e2e/tests/terms-of-use.spec.js b/test/e2e/tests/terms-of-use.spec.js index f224cb55a251..a8be7b5f1cb1 100644 --- a/test/e2e/tests/terms-of-use.spec.js +++ b/test/e2e/tests/terms-of-use.spec.js @@ -12,7 +12,7 @@ describe('Terms of use', function () { }, ], }; - it('accepts the updated terms of use', async function () { + it('accepts the updated terms of use @no-mmi', async function () { const firstOfJan = 1672574400; await withFixtures( { diff --git a/ui/components/app/transaction-list/transaction-list.component.js b/ui/components/app/transaction-list/transaction-list.component.js index 93111fa6a8e8..cc0db825dba3 100644 --- a/ui/components/app/transaction-list/transaction-list.component.js +++ b/ui/components/app/transaction-list/transaction-list.component.js @@ -5,7 +5,7 @@ import { nonceSortedCompletedTransactionsSelector, nonceSortedPendingTransactionsSelector, } from '../../../selectors/transactions'; -import { getCurrentChainId } from '../../../selectors'; +import { getCurrentChainId, getSelectedAddress } from '../../../selectors'; import { useI18nContext } from '../../../hooks/useI18nContext'; import TransactionListItem from '../transaction-list-item'; import SmartTransactionListItem from '../transaction-list-item/smart-transaction-list-item.component'; @@ -113,6 +113,7 @@ export default function TransactionList({ nonceSortedCompletedTransactionsSelector, ); const chainId = useSelector(getCurrentChainId); + const selectedAddress = useSelector(getSelectedAddress); const renderDateStamp = (index, dateGroup) => { return index === 0 ? ( { + const isIncomingTxsButToAnotherAddress = (transaction) => + transaction.type === TransactionType.incoming && + transaction.txParams.to.toLowerCase() !== selectedAddress.toLowerCase(); + + dateGroup.transactionGroups = dateGroup.transactionGroups.map( + (transactionGroup) => { + transactionGroup.transactions = transactionGroup.transactions.filter( + (transaction) => !isIncomingTxsButToAnotherAddress(transaction), + ); + + return transactionGroup; + }, + ); + + return dateGroup; + }; + + // Remove transaction groups with no transactions + const removeTxGroupsWithNoTx = (dateGroup) => { + dateGroup.transactionGroups = dateGroup.transactionGroups.filter( + (transactionGroup) => { + return transactionGroup.transactions.length > 0; + }, + ); + + return dateGroup; + }; + + // Remove date groups with no transaction groups + const dateGroupsWithTransactionGroups = (dateGroup) => + dateGroup.transactionGroups.length > 0; + return ( @@ -209,32 +245,39 @@ export default function TransactionList({ )} {completedTransactions.length > 0 ? ( - completedTransactions.slice(0, limit).map((dateGroup) => { - return dateGroup.transactionGroups.map( - (transactionGroup, index) => { - return ( - <> - {renderDateStamp(index, dateGroup)} - {transactionGroup.initialTransaction?.transactionType === - TransactionType.smart ? ( - - ) : ( - - )} - - ); - }, - ); - }) + completedTransactions + .map(removeIncomingTxsButToAnotherAddress) + .map(removeTxGroupsWithNoTx) + .filter(dateGroupsWithTransactionGroups) + .slice(0, limit) + .map((dateGroup) => { + return dateGroup.transactionGroups.map( + (transactionGroup, index) => { + return ( + <> + {renderDateStamp(index, dateGroup)} + {transactionGroup.initialTransaction + ?.transactionType === TransactionType.smart ? ( + + ) : ( + + )} + + ); + }, + ); + }) ) : ( diff --git a/ui/components/app/wallet-overview/eth-overview.js b/ui/components/app/wallet-overview/eth-overview.js index 4c10a8edded0..15695dd237b5 100644 --- a/ui/components/app/wallet-overview/eth-overview.js +++ b/ui/components/app/wallet-overview/eth-overview.js @@ -14,7 +14,6 @@ import { getMmiPortfolioEnabled, getMmiPortfolioUrl, } from '../../../selectors/institutional/selectors'; -import { MMI_SWAPS_URL } from '../../../../shared/constants/swaps'; ///: END:ONLY_INCLUDE_IN import { I18nContext } from '../../../contexts/i18n'; import { @@ -112,7 +111,7 @@ const EthOverview = ({ className, showAddress }) => { onClick={() => { stakingEvent(); global.platform.openTab({ - url: 'https://metamask-institutional.io/stake', + url: `${mmiPortfolioUrl}/stake`, }); }} /> @@ -125,7 +124,9 @@ const EthOverview = ({ className, showAddress }) => { label={t('portfolio')} onClick={() => { portfolioEvent(); - window.open(mmiPortfolioUrl, '_blank'); + global.platform.openTab({ + url: mmiPortfolioUrl, + }); }} /> )} @@ -262,7 +263,7 @@ const EthOverview = ({ className, showAddress }) => { onClick={() => { ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) global.platform.openTab({ - url: MMI_SWAPS_URL, + url: `${mmiPortfolioUrl}/swap`, }); ///: END:ONLY_INCLUDE_IN diff --git a/ui/components/app/wallet-overview/eth-overview.test.js b/ui/components/app/wallet-overview/eth-overview.test.js index 32e73fbee9a9..bad0339b6ed7 100644 --- a/ui/components/app/wallet-overview/eth-overview.test.js +++ b/ui/components/app/wallet-overview/eth-overview.test.js @@ -196,6 +196,12 @@ describe('EthOverview', () => { const mockedStoreWithCustodyKeyring = { metamask: { ...mockStore.metamask, + mmiConfiguration: { + portfolio: { + enabled: true, + url: 'https://metamask-institutional.io', + }, + }, keyrings: [ { type: 'Custody', @@ -224,9 +230,7 @@ describe('EthOverview', () => { await waitFor(() => expect(openTabSpy).toHaveBeenCalledWith({ - url: expect.stringContaining( - 'https://metamask-institutional.io/swap', - ), + url: 'https://metamask-institutional.io/swap', }), ); }); diff --git a/ui/components/app/wallet-overview/token-overview.js b/ui/components/app/wallet-overview/token-overview.js index cb7fcc4fd9a2..650404c86c5f 100644 --- a/ui/components/app/wallet-overview/token-overview.js +++ b/ui/components/app/wallet-overview/token-overview.js @@ -25,7 +25,6 @@ import { getMmiPortfolioEnabled, getMmiPortfolioUrl, } from '../../../selectors/institutional/selectors'; -import { MMI_SWAPS_URL } from '../../../../shared/constants/swaps'; ///: END:ONLY_INCLUDE_IN import { getIsSwapsChain, @@ -178,7 +177,7 @@ const TokenOverview = ({ className, token }) => { onClick={() => { stakingEvent(); global.platform.openTab({ - url: 'https://metamask-institutional.io/stake', + url: `${mmiPortfolioUrl}/stake`, }); }} /> @@ -195,7 +194,9 @@ const TokenOverview = ({ className, token }) => { data-testid="token-overview-mmi-portfolio" onClick={() => { portfolioEvent(); - window.open(mmiPortfolioUrl, '_blank'); + global.platform.openTab({ + url: mmiPortfolioUrl, + }); }} /> )} @@ -252,7 +253,7 @@ const TokenOverview = ({ className, token }) => { onClick={() => { ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) global.platform.openTab({ - url: MMI_SWAPS_URL, + url: `${mmiPortfolioUrl}/swap`, }); ///: END:ONLY_INCLUDE_IN diff --git a/ui/components/component-library/modal-content/README.mdx b/ui/components/component-library/modal-content/README.mdx index 439525924ae8..6dceaea622d3 100644 --- a/ui/components/component-library/modal-content/README.mdx +++ b/ui/components/component-library/modal-content/README.mdx @@ -61,11 +61,9 @@ If you do require a larger modal size you can use the `modalDialogProps` to add ```jsx -import { DISPLAY } from '../../../helpers/constants/design-system'; +import { Display } from '../../../helpers/constants/design-system'; -import Box from '../../ui/box'; - -import { Modal, ModalContent, Text, Button, ButtonVariant } from '../../component-library'; +import { Box, Modal, ModalContent, Text, Button, ButtonVariant } from '../../component-library'; enum ModalContentSizeStoryOption { Sm = 'sm', @@ -80,7 +78,7 @@ const handleOnClick = (size: ModalContentSizeStoryOption) => { setShow({ ...show, [size]: !show[size] }); }; - + )} - {(!showJwtDropdown || showAddNewToken) && ( + {(!showJwtDropdown || addNewTokenClicked) && ( { > {props.jwtInputText} - {fileTooBigError && ( - - {t('fileTooBig')} - - )} +