From 9bb668d958af7f46aca3cf337890e41e4ccabab0 Mon Sep 17 00:00:00 2001 From: Hassan Malik <41640681+hmalik88@users.noreply.github.com> Date: Wed, 23 Feb 2022 15:16:41 -0500 Subject: [PATCH 01/18] minor fixes per snaps pr comments (#13721) --- ui/pages/settings/flask/view-snap/index.scss | 8 ++++++-- ui/pages/settings/flask/view-snap/view-snap.js | 11 ++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ui/pages/settings/flask/view-snap/index.scss b/ui/pages/settings/flask/view-snap/index.scss index d0efae6f7..4d672ef7a 100644 --- a/ui/pages/settings/flask/view-snap/index.scss +++ b/ui/pages/settings/flask/view-snap/index.scss @@ -6,8 +6,6 @@ } &__subheader { - @include H4; - padding: 16px 4px; border-bottom: 1px solid var(--alto); margin-right: 24px; @@ -51,12 +49,18 @@ } &__toggle-container { + margin-left: auto; + @media screen and (max-width: $break-small) { padding-left: 0; display: inline-block; } } + &__toggle-button { + margin-right: -12px; + } + &__content-container { @media screen and (max-width: $break-small) { width: 100%; diff --git a/ui/pages/settings/flask/view-snap/view-snap.js b/ui/pages/settings/flask/view-snap/view-snap.js index 14c2b050e..5986b7b5b 100644 --- a/ui/pages/settings/flask/view-snap/view-snap.js +++ b/ui/pages/settings/flask/view-snap/view-snap.js @@ -86,15 +86,12 @@ function ViewSnap() { url={authorshipPillUrl} /> - + @@ -155,8 +152,8 @@ function ViewSnap() { css={{ maxWidth: '175px', }} - onClick={async () => { - await dispatch(removeSnap(snap)); + onClick={() => { + dispatch(removeSnap(snap)); }} > {t('removeSnap')} From dcdfa29a8e22146cba403a55f95735fe812c77ca Mon Sep 17 00:00:00 2001 From: Hassan Malik <41640681+hmalik88@users.noreply.github.com> Date: Fri, 4 Mar 2022 12:00:51 -0500 Subject: [PATCH 02/18] Add custom CSS to Popover (#13740) * add boxes to popover sections for custom css * updated doc strings * added default props * render Boxes only if the props are not empty * possible fix * second fix * removed prop check function, converted header, footer and div elements to Box components and updated storybook and readme.mdx * remove non existing prop * fixed export issue * updated storybook --- ui/components/ui/popover/README.mdx | 16 --- ui/components/ui/popover/popover.component.js | 98 ++++++++++++------- ui/components/ui/popover/popover.stories.js | 21 ++-- 3 files changed, 77 insertions(+), 58 deletions(-) delete mode 100644 ui/components/ui/popover/README.mdx diff --git a/ui/components/ui/popover/README.mdx b/ui/components/ui/popover/README.mdx deleted file mode 100644 index 3a4c922db..000000000 --- a/ui/components/ui/popover/README.mdx +++ /dev/null @@ -1,16 +0,0 @@ -import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; - -import Popover from './popover.component'; - -# Popover - -A modal component to show info - - - - - -## Component API - - - diff --git a/ui/components/ui/popover/popover.component.js b/ui/components/ui/popover/popover.component.js index 4904046bb..09424163e 100644 --- a/ui/components/ui/popover/popover.component.js +++ b/ui/components/ui/popover/popover.component.js @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { useI18nContext } from '../../../hooks/useI18nContext'; +import Box from '../box'; const Popover = ({ title, @@ -18,9 +19,47 @@ const Popover = ({ CustomBackground, popoverRef, centerTitle, + headerProps = {}, + contentProps = {}, + footerProps = {}, }) => { const t = useI18nContext(); const showHeader = title || onBack || subtitle || onClose; + const Header = () => { + return ( + +
+

+ {onBack ? ( +

+ {onClose ? ( +
+ {subtitle ? ( +

{subtitle}

+ ) : null} +
+ ); + }; + return (
{CustomBackground ? ( @@ -33,47 +72,22 @@ const Popover = ({ ref={popoverRef} > {showArrow ?
: null} - {showHeader && ( -
-
-

- {onBack ? ( -

- {onClose ? ( -
- {subtitle ? ( -

{subtitle}

- ) : null} -
- )} + {showHeader &&
} {children ? ( -
+ {children} -
+ ) : null} {footer ? ( -
+ {footer} -
+ ) : null}
@@ -132,6 +146,18 @@ Popover.propTypes = { * Check if use centered title */ centerTitle: PropTypes.bool, + /** + * Box props for the header + */ + headerProps: PropTypes.shape({ ...Box.propTypes }), + /** + * Box props for the content + */ + contentProps: PropTypes.shape({ ...Box.propTypes }), + /** + * Box props for the footer + */ + footerProps: PropTypes.shape({ ...Box.propTypes }), }; export default class PopoverPortal extends PureComponent { diff --git a/ui/components/ui/popover/popover.stories.js b/ui/components/ui/popover/popover.stories.js index e23bd91c4..ef9f8e041 100644 --- a/ui/components/ui/popover/popover.stories.js +++ b/ui/components/ui/popover/popover.stories.js @@ -1,18 +1,12 @@ import React, { useState } from 'react'; import Button from '../button'; import Box from '../box'; -import README from './README.mdx'; import Popover from './popover.component'; export default { title: 'Components/UI/Popover', id: __filename, component: Popover, - parameters: { - docs: { - page: README, - }, - }, argTypes: { title: { control: 'text' }, subtitle: { control: 'text' }, @@ -26,6 +20,21 @@ export default { showArrow: { control: 'boolean' }, popoverRef: { control: 'object' }, centerTitle: { control: 'boolean' }, + headerProps: { + control: 'object', + description: + 'Box component props used to add container CSS for the header', + }, + contentProps: { + control: 'object', + description: + 'Box component props used to add container CSS for the content', + }, + footerProps: { + control: 'object', + description: + 'Box component props used to add container CSS for the footer', + }, }, }; From 99604e5642b24ead8e0f971a906d5f6828ad2175 Mon Sep 17 00:00:00 2001 From: Dan Finlay <542863+danfinlay@users.noreply.github.com> Date: Wed, 2 Mar 2022 23:56:04 -0800 Subject: [PATCH 03/18] Document Flask build flag (#13597) * Document Flask build flag Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com> --- development/build/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/development/build/README.md b/development/build/README.md index 7d6cd8d9c..85823992b 100644 --- a/development/build/README.md +++ b/development/build/README.md @@ -1,6 +1,7 @@ # The MetaMask Build System -> _tl;dr_ `yarn dist` for prod, `yarn start` for local development +> _tl;dr_ `yarn dist` for prod, `yarn start` for local development. +> Add `--build-type flask` to build Flask, our canary distribution with more experimental features. This directory contains the MetaMask build system, which is used to build the MetaMask Extension such that it can be used in a supported browser. From the repository root, the build system entry file is located at [`./development/build/index.js`](https://github.com/MetaMask/metamask-extension/blob/develop/development/build/index.js). @@ -40,7 +41,8 @@ Commands: e2e tests. Options: - --build-type The "type" of build to create. One of: "beta", "main" + --build-type The "type" of build to create. One of: "beta", "flask", + "main" [string] [default: "main"] --lint-fence-files Whether files with code fences should be linted after fences have been removed by the code fencing transform. From e795c29b3f9684ab07db14f2f2221b6c15efb699 Mon Sep 17 00:00:00 2001 From: Hassan Malik <41640681+hmalik88@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:32:09 -0500 Subject: [PATCH 04/18] Update snap install warning per designs and fix for popover component (#13844) * updated snap install warning per designs, hotfix for popover component to remove box styles from it's scss file and introduce them as default props * small fix --- .../app/flask/snap-install-warning/index.scss | 4 -- .../snap-install-warning.js | 29 ++++++------- ui/components/ui/popover/index.scss | 14 ------- ui/components/ui/popover/popover.component.js | 42 ++++++++++++++++--- 4 files changed, 51 insertions(+), 38 deletions(-) diff --git a/ui/components/app/flask/snap-install-warning/index.scss b/ui/components/app/flask/snap-install-warning/index.scss index 2f9830668..53f5ed74b 100644 --- a/ui/components/app/flask/snap-install-warning/index.scss +++ b/ui/components/app/flask/snap-install-warning/index.scss @@ -7,10 +7,6 @@ gap: 0 16px; } - &__content { - padding: 0 16px 24px; - } - &__footer { display: flex; flex-flow: row; diff --git a/ui/components/app/flask/snap-install-warning/snap-install-warning.js b/ui/components/app/flask/snap-install-warning/snap-install-warning.js index 1b90ec38d..942ee2c25 100644 --- a/ui/components/app/flask/snap-install-warning/snap-install-warning.js +++ b/ui/components/app/flask/snap-install-warning/snap-install-warning.js @@ -43,21 +43,22 @@ export default function SnapInstallWarning({ onCancel, onSubmit, snapName }) { className="snap-install-warning" title={t('areYouSure')} footer={} + headerProps={{ padding: [6, 6, 0] }} + contentProps={{ padding: [0, 6, 4] }} + footerProps={{ padding: [4, 6] }} > -
- - {t('snapInstallWarningCheck')} - -
- - -
+ + {t('snapInstallWarningCheck')} + +
+ +
); diff --git a/ui/components/ui/popover/index.scss b/ui/components/ui/popover/index.scss index f048a171c..9e0142075 100644 --- a/ui/components/ui/popover/index.scss +++ b/ui/components/ui/popover/index.scss @@ -21,12 +21,7 @@ } &-header { - display: flex; - padding: 24px 16px 16px; - flex-direction: column; - background: white; position: relative; - border-radius: 10px; &__title { display: flex; @@ -78,13 +73,8 @@ &-content { overflow-y: auto; position: relative; - display: flex; flex: 1; - flex-direction: column; - justify-content: flex-start; - align-items: stretch; align-content: stretch; - border-radius: 10px; } &-container { @@ -100,11 +90,7 @@ } &-footer { - display: flex; - flex-direction: row; - justify-content: space-between; border-top: 1px solid #d2d8dd; - padding: 16px 24px 24px; > :only-child { margin: 0 auto; diff --git a/ui/components/ui/popover/popover.component.js b/ui/components/ui/popover/popover.component.js index 09424163e..2cdaee0d5 100644 --- a/ui/components/ui/popover/popover.component.js +++ b/ui/components/ui/popover/popover.component.js @@ -4,6 +4,33 @@ import PropTypes from 'prop-types'; import classnames from 'classnames'; import { useI18nContext } from '../../../hooks/useI18nContext'; import Box from '../box'; +import { + ALIGN_ITEMS, + FLEX_DIRECTION, + JUSTIFY_CONTENT, +} from '../../../helpers/constants/design-system'; + +const defaultHeaderProps = { + padding: [6, 4, 4], + display: 'flex', + flexDirection: FLEX_DIRECTION.COLUMN, + backgroundColor: 'white', + borderRadius: 'xl', +}; + +const defaultContentProps = { + display: 'flex', + flexDirection: FLEX_DIRECTION.COLUMN, + justifyContent: JUSTIFY_CONTENT.FLEX_START, + alignItems: ALIGN_ITEMS.STRETCH, + borderRadius: 'xl', +}; + +const defaultFooterProps = { + display: 'flex', + justifyContent: JUSTIFY_CONTENT.SPACE_BETWEEN, + padding: [4, 6, 6], +}; const Popover = ({ title, @@ -19,15 +46,18 @@ const Popover = ({ CustomBackground, popoverRef, centerTitle, - headerProps = {}, - contentProps = {}, - footerProps = {}, + headerProps = defaultHeaderProps, + contentProps = defaultContentProps, + footerProps = defaultFooterProps, }) => { const t = useI18nContext(); const showHeader = title || onBack || subtitle || onClose; const Header = () => { return ( - +
{children} @@ -84,7 +114,7 @@ const Popover = ({ {footer ? ( {footer} From 0461bbcded9150922cbda22a1fd286cdb32932b0 Mon Sep 17 00:00:00 2001 From: Hennadii Ivtushok Date: Wed, 9 Mar 2022 22:20:48 +0200 Subject: [PATCH 05/18] Snap removal confirmation (#13619) * Add Snap removal confirmation * Add styling for Snap removal confirmation * Update styling * Update button margin * Re-use styling code * Address comments * Update Popover props * Lint * Lint Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com> Co-authored-by: Erik Marks --- app/_locales/en/messages.json | 7 ++ ui/components/app/app-components.scss | 1 + .../app/flask/snap-remove-warning/index.js | 1 + .../app/flask/snap-remove-warning/index.scss | 12 ++++ .../snap-remove-warning.js | 64 +++++++++++++++++++ .../settings/flask/view-snap/view-snap.js | 18 ++++-- 6 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 ui/components/app/flask/snap-remove-warning/index.js create mode 100644 ui/components/app/flask/snap-remove-warning/index.scss create mode 100644 ui/components/app/flask/snap-remove-warning/snap-remove-warning.js diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 7fb828590..b1621ed39 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2299,6 +2299,9 @@ "personalAddressDetected": { "message": "Personal address detected. Input the token contract address." }, + "pleaseConfirm": { + "message": "Please confirm" + }, "plusXMore": { "message": "+ $1 more", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" @@ -2434,6 +2437,10 @@ "removeSnap": { "message": "Remove Snap" }, + "removeSnapConfirmation": { + "message": "Are you sure you want to remove $1?", + "description": "$1 represents the name of the snap" + }, "removeSnapDescription": { "message": "This action will delete the snap, its data and revoke your given permissions." }, diff --git a/ui/components/app/app-components.scss b/ui/components/app/app-components.scss index a135c0766..2eb88d5dd 100644 --- a/ui/components/app/app-components.scss +++ b/ui/components/app/app-components.scss @@ -30,6 +30,7 @@ @import 'edit-gas-fee-popover/edit-gas-tooltip/index'; @import 'flask/experimental-area/index'; @import 'flask/snap-install-warning/index'; +@import 'flask/snap-remove-warning/index'; @import 'flask/snap-settings-card/index'; @import 'flask/snaps-authorship-pill/index'; @import 'gas-customization/gas-modal-page-container/index'; diff --git a/ui/components/app/flask/snap-remove-warning/index.js b/ui/components/app/flask/snap-remove-warning/index.js new file mode 100644 index 000000000..fe427dde6 --- /dev/null +++ b/ui/components/app/flask/snap-remove-warning/index.js @@ -0,0 +1 @@ +export { default } from './snap-remove-warning'; diff --git a/ui/components/app/flask/snap-remove-warning/index.scss b/ui/components/app/flask/snap-remove-warning/index.scss new file mode 100644 index 000000000..cd7a17016 --- /dev/null +++ b/ui/components/app/flask/snap-remove-warning/index.scss @@ -0,0 +1,12 @@ +.snap-remove-warning { + color: var(--black); + + &__footer-button { + height: 40px; + margin-inline-end: 24px; + + &:last-of-type { + margin-inline-end: 0; + } + } +} diff --git a/ui/components/app/flask/snap-remove-warning/snap-remove-warning.js b/ui/components/app/flask/snap-remove-warning/snap-remove-warning.js new file mode 100644 index 000000000..075a1dc81 --- /dev/null +++ b/ui/components/app/flask/snap-remove-warning/snap-remove-warning.js @@ -0,0 +1,64 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { useI18nContext } from '../../../../hooks/useI18nContext'; +import Typography from '../../../ui/typography/typography'; +import { TYPOGRAPHY } from '../../../../helpers/constants/design-system'; +import Box from '../../../ui/box/box'; +import Popover from '../../../ui/popover'; +import Button from '../../../ui/button'; + +export default function SnapRemoveWarning({ onCancel, onSubmit, snapName }) { + const t = useI18nContext(); + + const SnapRemoveWarningFooter = () => { + return ( + <> + + + + ); + }; + + return ( + } + onClose={onCancel} + headerProps={{ padding: [6, 4, 0, 6] }} + > + + + {t('removeSnapConfirmation', [snapName])} + + + + ); +} + +SnapRemoveWarning.propTypes = { + /** + * onCancel handler + */ + onCancel: PropTypes.func, + /** + * onSubmit handler + */ + onSubmit: PropTypes.func, + /** + * Name of snap + */ + snapName: PropTypes.string, +}; diff --git a/ui/pages/settings/flask/view-snap/view-snap.js b/ui/pages/settings/flask/view-snap/view-snap.js index 5986b7b5b..334654b54 100644 --- a/ui/pages/settings/flask/view-snap/view-snap.js +++ b/ui/pages/settings/flask/view-snap/view-snap.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import Button from '../../../../components/ui/button'; @@ -12,6 +12,7 @@ import { } from '../../../../helpers/constants/design-system'; import SnapsAuthorshipPill from '../../../../components/app/flask/snaps-authorship-pill'; import Box from '../../../../components/ui/box'; +import SnapRemoveWarning from '../../../../components/app/flask/snap-remove-warning'; import ToggleButton from '../../../../components/ui/toggle-button'; import PermissionsConnectPermissionList from '../../../../components/app/permissions-connect-permission-list/permissions-connect-permission-list'; import ConnectedSitesList from '../../../../components/app/connected-sites-list'; @@ -39,6 +40,8 @@ function ViewSnap() { return snapState.id === decoded; }); + const [isShowingRemoveWarning, setIsShowingRemoveWarning] = useState(false); + useEffect(() => { if (!snap) { history.push(SNAPS_LIST_ROUTE); @@ -152,12 +155,19 @@ function ViewSnap() { css={{ maxWidth: '175px', }} - onClick={() => { - dispatch(removeSnap(snap)); - }} + onClick={() => setIsShowingRemoveWarning(true)} > {t('removeSnap')} + {isShowingRemoveWarning && ( + setIsShowingRemoveWarning(false)} + onSubmit={async () => { + await dispatch(removeSnap(snap)); + }} + snapName={snap.manifest.proposedName} + /> + )}
From 059d5d048804a0d278878dcbf3c8b9ea8c35954d Mon Sep 17 00:00:00 2001 From: Shane Date: Thu, 10 Mar 2022 14:01:55 -0800 Subject: [PATCH 06/18] Fixed firefox Snaps + add initial end-to-end tests (#13671) * Changed registryUrl for snaps only in firefox Fixed getPlatform to only be imported into metamask-controller in flask Removed snaps specific testrunner script and use run-all with a cli option * Fixed flakey tests * Removed unneeded await * Added delay * Fixed linting --- .circleci/config.yml | 87 ++++++++++++++++ app/scripts/metamask-controller.js | 8 ++ package.json | 3 + test/e2e/run-all.js | 20 +++- test/e2e/snaps/test-snap-confirm.spec.js | 98 +++++++++++++++++++ test/e2e/snaps/test-snap-error.spec.js | 90 +++++++++++++++++ test/e2e/webdriver/chrome.js | 2 +- test/e2e/webdriver/driver.js | 2 +- test/e2e/webdriver/firefox.js | 13 ++- test/e2e/webdriver/index.js | 4 +- .../permissions-connect.component.js | 2 +- 11 files changed, 315 insertions(+), 14 deletions(-) create mode 100644 test/e2e/snaps/test-snap-confirm.spec.js create mode 100644 test/e2e/snaps/test-snap-error.spec.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 1f6300816..b8666d879 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,6 +53,9 @@ workflows: - prep-build-test: requires: - prep-deps + - prep-build-test-flask: + requires: + - prep-deps - prep-build-test-metrics: requires: - prep-deps @@ -78,6 +81,12 @@ workflows: - test-e2e-firefox: requires: - prep-build-test + - test-e2e-chrome-snaps: + requires: + - prep-build-test-flask + - test-e2e-firefox-snaps: + requires: + - prep-build-test-flask - test-e2e-chrome-metrics: requires: - prep-build-test-metrics @@ -130,6 +139,8 @@ workflows: - test-e2e-firefox - test-e2e-chrome-metrics - test-e2e-firefox-metrics + - test-e2e-chrome-snaps + - test-e2e-firefox-snaps - benchmark: requires: - prep-build-test @@ -283,6 +294,28 @@ jobs: - dist-flask - builds-flask + prep-build-test-flask: + executor: node-browsers-medium-plus + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Build extension for testing + command: yarn build:test:flask + - run: + name: Move test build to 'dist-test' to avoid conflict with production build + command: mv ./dist ./dist-test-flask + - run: + name: Move test zips to 'builds-test' to avoid conflict with production build + command: mv ./builds ./builds-test-flask + - persist_to_workspace: + root: . + paths: + - dist-test-flask + - builds-test-flask + + prep-build-test: executor: node-browsers-medium-plus steps: @@ -465,6 +498,60 @@ jobs: path: test-artifacts destination: test-artifacts + test-e2e-firefox-snaps: + executor: node-browsers + steps: + - checkout + - run: + name: Install Firefox + command: ./.circleci/scripts/firefox-install.sh + - attach_workspace: + at: . + - run: + name: Move test build to dist + command: mv ./dist-test-flask ./dist + - run: + name: Move test zips to builds + command: mv ./builds-test-flask ./builds + - run: + name: test:e2e:firefox:snaps + command: | + if .circleci/scripts/test-run-e2e.sh + then + yarn test:e2e:firefox:snaps --retries 2 + fi + no_output_timeout: 20m + - store_artifacts: + path: test-artifacts + destination: test-artifacts + + test-e2e-chrome-snaps: + 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-flask ./dist + - run: + name: Move test zips to builds + command: mv ./builds-test-flask ./builds + - run: + name: test:e2e:chrome:snaps + command: | + if .circleci/scripts/test-run-e2e.sh + then + yarn test:e2e:chrome:snaps --retries 2 + fi + no_output_timeout: 20m + - store_artifacts: + path: test-artifacts + destination: test-artifacts + test-e2e-chrome-metrics: executor: node-browsers steps: diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 2de2dd25e..54727ba03 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -70,6 +70,7 @@ import { MILLISECOND } from '../../shared/constants/time'; import { ///: BEGIN:ONLY_INCLUDE_IN(flask) MESSAGE_TYPE, + PLATFORM_FIREFOX, ///: END:ONLY_INCLUDE_IN POLLING_TOKEN_ENVIRONMENT_TYPES, SUBJECT_TYPES, @@ -130,6 +131,10 @@ import { ///: END:ONLY_INCLUDE_IN } from './controllers/permissions'; +///: BEGIN:ONLY_INCLUDE_IN(flask) +import { getPlatform } from './lib/util'; +///: END:ONLY_INCLUDE_IN + export const METAMASK_CONTROLLER_EVENTS = { // Fired after state changes that impact the extension badge (unapproved msg count) // The process of updating the badge happens in app/scripts/background.js. @@ -603,7 +608,10 @@ export default class MetamaskController extends EventEmitter { ], }); + const usingFirefox = getPlatform() === PLATFORM_FIREFOX; + this.snapController = new SnapController({ + npmRegistryUrl: usingFirefox ? 'https://registry.npmjs.cf/' : undefined, endowmentPermissionNames: Object.values(EndowmentPermissions), terminateAllSnaps: this.workerController.terminateAllSnaps.bind( this.workerController, diff --git a/package.json b/package.json index b09149dab..b01ccf93d 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/benchmark.js", "benchmark:firefox": "SELENIUM_BROWSER=firefox node test/e2e/benchmark.js", "build:test": "yarn build test", + "build:test:flask": "yarn build test --build-type flask", "build:test:metrics": "SEGMENT_HOST='http://localhost:9090' SEGMENT_WRITE_KEY='FAKE' yarn build test", "test": "yarn lint && yarn test:unit && yarn test:unit:jest", "dapp": "node development/static-server.js node_modules/@metamask/test-dapp/dist --port 8080", @@ -30,8 +31,10 @@ "test:unit:mocha": "mocha './app/**/*.test.js'", "test:e2e:chrome": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js", "test:e2e:chrome:metrics": "SELENIUM_BROWSER=chrome node test/e2e/run-e2e-test.js test/e2e/metrics.spec.js", + "test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps", "test:e2e:firefox": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js", "test:e2e:firefox:metrics": "SELENIUM_BROWSER=firefox node test/e2e/run-e2e-test.js test/e2e/metrics.spec.js", + "test:e2e:firefox:snaps": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js --snaps", "test:e2e:single": "node test/e2e/run-e2e-test.js", "test:coverage:mocha": "nyc --reporter=text --reporter=html yarn test:unit:mocha", "test:coverage:jest": "yarn test:unit:jest --coverage --maxWorkers=2", diff --git a/test/e2e/run-all.js b/test/e2e/run-all.js index a73021bd4..70e184652 100644 --- a/test/e2e/run-all.js +++ b/test/e2e/run-all.js @@ -17,6 +17,10 @@ async function main() { type: 'string', choices: ['chrome', 'firefox'], }) + .option('snaps', { + description: `run snaps e2e tests`, + type: 'boolean', + }) .option('retries', { description: 'Set how many times the test should be retried upon failure.', @@ -26,16 +30,22 @@ async function main() { .strict() .help('help'); - const { browser, retries } = argv; + const { browser, retries, snaps } = argv; - const testDir = path.join(__dirname, 'tests'); - const metamaskUiTest = path.join(__dirname, 'metamask-ui.spec.js'); + let testDir = path.join(__dirname, 'tests'); + + if (snaps) { + testDir = path.join(__dirname, 'snaps'); + } const testFilenames = await fs.readdir(testDir); const testPaths = testFilenames.map((filename) => path.join(testDir, filename), ); - const allE2eTestPaths = [...testPaths, metamaskUiTest]; + + if (!snaps) { + testPaths.push(path.join(__dirname, 'metamask-ui.spec.js')); + } const runE2eTestPath = path.join(__dirname, 'run-e2e-test.js'); @@ -47,7 +57,7 @@ async function main() { args.push('--retries', retries); } - for (const testPath of allE2eTestPaths) { + for (const testPath of testPaths) { await runInShell('node', [...args, testPath]); } } diff --git a/test/e2e/snaps/test-snap-confirm.spec.js b/test/e2e/snaps/test-snap-confirm.spec.js new file mode 100644 index 000000000..2100c2ff5 --- /dev/null +++ b/test/e2e/snaps/test-snap-confirm.spec.js @@ -0,0 +1,98 @@ +const { strict: assert } = require('assert'); +const { withFixtures } = require('../helpers'); + +describe('Test Snap Confirm', function () { + it('can pop up a snap confirm and get its result', async function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: 25000000000000000000, + }, + ], + }; + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + driverOptions: { + type: 'flask', + }, + }, + async ({ driver }) => { + await driver.navigate(); + + // enter pw into extension + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // navigate to test snaps page and connect + await driver.driver.get('https://metamask.github.io/test-snaps/'); + await driver.fill('.snapId', 'npm:@metamask/test-snap-confirm'); + await driver.clickElement({ + text: 'Connect To Confirm Snap', + tag: 'button', + }); + + // switch to metamask extension and click connect + await driver.waitUntilXWindowHandles(2, 5000, 10000); + let windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement( + { + text: 'Connect', + tag: 'button', + }, + 10000, + ); + + await driver.delay(2000); + + // approve install of snap + await driver.waitUntilXWindowHandles(2, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement({ + text: 'Approve & Install', + tag: 'button', + }); + + // click send inputs on test snap page + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.clickElement({ + text: 'Send Inputs to Hello Snap', + tag: 'button', + }); + + // hit 'approve' on the custom confirm + await driver.waitUntilXWindowHandles(2, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement({ + text: 'Approve', + tag: 'button', + }); + + // check the results of the custom confirm + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + const confirmResult = await driver.findElement('.sendResults'); + assert.equal(await confirmResult.getText(), 'true'); + }, + ); + }); +}); diff --git a/test/e2e/snaps/test-snap-error.spec.js b/test/e2e/snaps/test-snap-error.spec.js new file mode 100644 index 000000000..91ebd2ce1 --- /dev/null +++ b/test/e2e/snaps/test-snap-error.spec.js @@ -0,0 +1,90 @@ +const { strict: assert } = require('assert'); +const { withFixtures } = require('../helpers'); +const { PAGES } = require('../webdriver/driver'); + +describe('Test Snap Error', function () { + it('can pop up a snap error and see the error', async function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: 25000000000000000000, + }, + ], + }; + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + driverOptions: { type: 'flask' }, + }, + async ({ driver }) => { + await driver.navigate(); + + // enter pw into extension + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // navigate to test snaps page and connect + await driver.driver.get('https://metamask.github.io/test-snaps/'); + await driver.fill('.snapId2', 'npm:@metamask/test-snap-error'); + await driver.clickElement({ + text: 'Connect Error Snap', + tag: 'button', + }); + + // switch to metamask extension and click connect + await driver.waitUntilXWindowHandles(2, 5000, 10000); + let windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement( + { + text: 'Connect', + tag: 'button', + }, + 10000, + ); + + await driver.delay(2000); + + // approve install of snap + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement({ + text: 'Approve & Install', + tag: 'button', + }); + + // click send inputs on test snap page + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.clickElement({ + text: 'Send Test to Error Snap', + tag: 'button', + }); + + await driver.navigate(PAGES.HOME); + + const error = await driver.findElement( + '.home-notification__content-container', + ); + const text = await error.getText(); + assert.equal( + text.includes( + "Snap Error: 'random error inside'. Error Code: '-32603'", + ), + true, + ); + }, + ); + }); +}); diff --git a/test/e2e/webdriver/chrome.js b/test/e2e/webdriver/chrome.js index f5af2bad4..05ce2b65d 100644 --- a/test/e2e/webdriver/chrome.js +++ b/test/e2e/webdriver/chrome.js @@ -69,7 +69,7 @@ class ChromeDriver { for (let i = 0; i < extensions.length; i++) { const extension = extensions[i].shadowRoot const name = extension.querySelector('#name').textContent - if (name === "${extensionName}") { + if (name.startsWith("${extensionName}")) { return extensions[i].getAttribute("id") } } diff --git a/test/e2e/webdriver/driver.js b/test/e2e/webdriver/driver.js index 770b702b8..89062263f 100644 --- a/test/e2e/webdriver/driver.js +++ b/test/e2e/webdriver/driver.js @@ -382,7 +382,7 @@ class Driver { const ignoredLogTypes = ['WARNING']; const ignoredErrorMessages = [ // Third-party Favicon 404s show up as errors - 'favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)', + 'favicon.ico - Failed to load resource: the server responded with a status of 404', // Sentry rate limiting 'Failed to load resource: the server responded with a status of 429', // 4Byte diff --git a/test/e2e/webdriver/firefox.js b/test/e2e/webdriver/firefox.js index bde4564c2..cfb458353 100644 --- a/test/e2e/webdriver/firefox.js +++ b/test/e2e/webdriver/firefox.js @@ -31,9 +31,10 @@ class FirefoxDriver { * @param {Object} options - the options for the build * @param options.responsive * @param options.port + * @param options.type * @returns {Promise<{driver: !ThenableWebDriver, extensionUrl: string, extensionId: string}>} */ - static async build({ responsive, port }) { + static async build({ responsive, port, type }) { const templateProfile = fs.mkdtempSync(TEMP_PROFILE_PATH_PREFIX); const options = new firefox.Options().setProfile(templateProfile); options.setProxy(proxy.manual({ https: HTTPS_PROXY_HOST })); @@ -48,9 +49,13 @@ class FirefoxDriver { const driver = builder.build(); const fxDriver = new FirefoxDriver(driver); - const extensionId = await fxDriver.installExtension( - `builds/metamask-firefox-${version}.zip`, - ); + let extensionString = `builds/metamask-firefox-${version}.zip`; + + if (type) { + extensionString = `builds/metamask-${type}-firefox-${version}.zip`; + } + + const extensionId = await fxDriver.installExtension(extensionString); const internalExtensionId = await fxDriver.getInternalId(); if (responsive) { diff --git a/test/e2e/webdriver/index.js b/test/e2e/webdriver/index.js index eb552f34d..fee966d8f 100644 --- a/test/e2e/webdriver/index.js +++ b/test/e2e/webdriver/index.js @@ -4,14 +4,14 @@ const Driver = require('./driver'); const ChromeDriver = require('./chrome'); const FirefoxDriver = require('./firefox'); -async function buildWebDriver({ responsive, port } = {}) { +async function buildWebDriver({ responsive, port, type } = {}) { const browser = process.env.SELENIUM_BROWSER; const { driver: seleniumDriver, extensionId, extensionUrl, - } = await buildBrowserWebDriver(browser, { responsive, port }); + } = await buildBrowserWebDriver(browser, { responsive, port, type }); await setupFetchMocking(seleniumDriver); const driver = new Driver(seleniumDriver, browser, extensionUrl); diff --git a/ui/pages/permissions-connect/permissions-connect.component.js b/ui/pages/permissions-connect/permissions-connect.component.js index e6e85d8b0..30022f3c9 100644 --- a/ui/pages/permissions-connect/permissions-connect.component.js +++ b/ui/pages/permissions-connect/permissions-connect.component.js @@ -43,7 +43,7 @@ export default class PermissionConnect extends Component { extensionId: PropTypes.string, iconUrl: PropTypes.string, name: PropTypes.string, - origin: PropTypes.string.isRequired, + origin: PropTypes.string, subjectType: PropTypes.string, }), isRequestingAccounts: PropTypes.bool.isRequired, From bd48a2acb8a6e9f6991d9c74a43bfaf1a15cfecb Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 10 Mar 2022 20:36:21 -0330 Subject: [PATCH 07/18] Fix snap e2e tests (#13912) The snap e2e tests introduced in #13671 were broken due to a conflict with the changes in #13895. The latter PR changed the version name for non-main builds so that it always includes the build type. The Firefox webdriver has been updated to use the new `getVersion` utility, ensuring that it always looks for the correct build filename. --- test/e2e/webdriver/firefox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e/webdriver/firefox.js b/test/e2e/webdriver/firefox.js index cfb458353..71111df58 100644 --- a/test/e2e/webdriver/firefox.js +++ b/test/e2e/webdriver/firefox.js @@ -4,7 +4,8 @@ const path = require('path'); const { Builder, By, until } = require('selenium-webdriver'); const firefox = require('selenium-webdriver/firefox'); const proxy = require('selenium-webdriver/proxy'); -const { version } = require('../../../package.json'); +const { getVersion } = require('../../../development/lib/get-version'); +const { BuildType } = require('../../../development/lib/build-type'); /** * The prefix for temporary Firefox profiles. All Firefox profiles used for e2e tests @@ -49,6 +50,7 @@ class FirefoxDriver { const driver = builder.build(); const fxDriver = new FirefoxDriver(driver); + const version = getVersion(type || BuildType.main, 0); let extensionString = `builds/metamask-firefox-${version}.zip`; if (type) { From 29e083c4c4107dd5e378ccea4d6b90b08424ae24 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 14 Mar 2022 18:40:21 +0100 Subject: [PATCH 08/18] Show snap version on install (#13931) * Add version to Snap install page * Fix text sizing inconsistency * Use a localized string for shorthand versions --- app/_locales/en/messages.json | 4 +++ .../snap-settings-card/snap-settings-card.js | 2 +- .../permissions-connect-header.component.js | 33 +++++++++++++++++++ .../flask/snap-install/index.scss | 4 +++ .../flask/snap-install/snap-install.js | 17 ++++++---- 5 files changed, 52 insertions(+), 8 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b1621ed39..1b537468e 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2669,6 +2669,10 @@ "settings": { "message": "Settings" }, + "shorthandVersion": { + "message": "v$1", + "description": "$1 is replaced by a version string (e.g. 1.2.3)" + }, "show": { "message": "Show" }, diff --git a/ui/components/app/flask/snap-settings-card/snap-settings-card.js b/ui/components/app/flask/snap-settings-card/snap-settings-card.js index 95afbc810..51f594a5a 100644 --- a/ui/components/app/flask/snap-settings-card/snap-settings-card.js +++ b/ui/components/app/flask/snap-settings-card/snap-settings-card.js @@ -180,7 +180,7 @@ const SnapSettingsCard = ({ tag="span" className="snap-settings-card__version" > - v {version} + {t('shorthandVersion', [version])} )} diff --git a/ui/components/app/permissions-connect-header/permissions-connect-header.component.js b/ui/components/app/permissions-connect-header/permissions-connect-header.component.js index 33dc5f3b8..c5ddf0110 100644 --- a/ui/components/app/permissions-connect-header/permissions-connect-header.component.js +++ b/ui/components/app/permissions-connect-header/permissions-connect-header.component.js @@ -5,12 +5,24 @@ import Box from '../../ui/box'; import { FLEX_DIRECTION, JUSTIFY_CONTENT, + ///: BEGIN:ONLY_INCLUDE_IN(flask) + COLORS, + TYPOGRAPHY, + TEXT_ALIGN, + ///: END:ONLY_INCLUDE_IN } from '../../../helpers/constants/design-system'; ///: BEGIN:ONLY_INCLUDE_IN(flask) import SnapsAuthorshipPill from '../flask/snaps-authorship-pill'; +import Typography from '../../ui/typography'; ///: END:ONLY_INCLUDE_IN export default class PermissionsConnectHeader extends Component { + ///: BEGIN:ONLY_INCLUDE_IN(flask) + static contextTypes = { + t: PropTypes.func, + }; + ///: END:ONLY_INCLUDE_IN + static propTypes = { iconUrl: PropTypes.string, iconName: PropTypes.string.isRequired, @@ -20,6 +32,7 @@ export default class PermissionsConnectHeader extends Component { headerText: PropTypes.string, ///: BEGIN:ONLY_INCLUDE_IN(flask) npmPackageName: PropTypes.string, + snapVersion: PropTypes.string, ///: END:ONLY_INCLUDE_IN }; @@ -47,10 +60,12 @@ export default class PermissionsConnectHeader extends Component { headerText, ///: BEGIN:ONLY_INCLUDE_IN(flask) npmPackageName, + snapVersion, ///: END:ONLY_INCLUDE_IN } = this.props; ///: BEGIN:ONLY_INCLUDE_IN(flask) const npmPackageUrl = `https://www.npmjs.com/package/${npmPackageName}`; + const { t } = this.context; ///: END:ONLY_INCLUDE_IN return ( + {t('shorthandVersion', [snapVersion])} + + ) + ///: END:ONLY_INCLUDE_IN + }
{headerText}
); diff --git a/ui/pages/permissions-connect/flask/snap-install/index.scss b/ui/pages/permissions-connect/flask/snap-install/index.scss index 5d692bb06..b15fe2aa6 100644 --- a/ui/pages/permissions-connect/flask/snap-install/index.scss +++ b/ui/pages/permissions-connect/flask/snap-install/index.scss @@ -22,6 +22,10 @@ } } + .version { + font-family: monospace; + } + .page-container__footer { width: 100%; } diff --git a/ui/pages/permissions-connect/flask/snap-install/snap-install.js b/ui/pages/permissions-connect/flask/snap-install/snap-install.js index 950f8d317..497ca45af 100644 --- a/ui/pages/permissions-connect/flask/snap-install/snap-install.js +++ b/ui/pages/permissions-connect/flask/snap-install/snap-install.js @@ -75,16 +75,18 @@ export default function SnapInstall({ headerText={null} // TODO(ritave): Add header text when snaps support description siteOrigin={targetSubjectMetadata.origin} npmPackageName={npmId} + snapVersion={targetSubjectMetadata.version} boxProps={{ alignItems: ALIGN_ITEMS.CENTER }} /> - - - {t('snapRequestsPermission')} - + {t('snapRequestsPermission')} + @@ -149,5 +151,6 @@ SnapInstall.propTypes = { name: PropTypes.string, origin: PropTypes.string.isRequired, sourceCode: PropTypes.string, + version: PropTypes.string, }).isRequired, }; From ce9dc12f75945fb08dc53e7ed28847c7f22ed49e Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 15 Mar 2022 08:54:37 -0230 Subject: [PATCH 09/18] Automate the Flask release process (#13898) * Automate the Flask release A Flask release will now be published alongside each main extension release. The version of each Flask release will be the same as the extension version except it will have the suffix `-flask.0`. * Programmatically remove build prefix The create GH release Bash script derives the Flask version from the Flask build filename by removing the build prefix, leaving just the version. Rather than hard-coding the prefix size to remove, it is now calculated programmatically so that it is easier to read and update. * Fix tag publishing The tab publishing step used the wrong credentials, and didn't properly identify the commit author. This has now been fixed. --- .circleci/config.yml | 10 ++- .../scripts/release-create-gh-release.sh | 46 ++++++++--- development/metamaskbot-build-announce.js | 2 +- development/sentry-publish.js | 77 ++++++++++++++----- development/sentry-upload-artifacts.sh | 17 +++- 5 files changed, 118 insertions(+), 34 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8666d879..76992feca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -160,6 +160,7 @@ workflows: requires: - prep-deps - prep-build + - prep-build-flask - all-tests-pass - job-publish-storybook: filters: @@ -371,7 +372,7 @@ jobs: root: . paths: - storybook-build - + test-storybook: executor: node-browsers steps: @@ -718,8 +719,11 @@ jobs: - attach_workspace: at: . - run: - name: sentry sourcemaps upload - command: SENTRY_ORG=metamask SENTRY_PROJECT=metamask yarn sentry:publish + name: Publish main release to Sentry + command: yarn sentry:publish + - run: + name: Publish Flask release to Sentry + command: yarn sentry:publish --build-type flask - run: name: Create GitHub release command: | diff --git a/.circleci/scripts/release-create-gh-release.sh b/.circleci/scripts/release-create-gh-release.sh index 93303f576..54d3946a9 100755 --- a/.circleci/scripts/release-create-gh-release.sh +++ b/.circleci/scripts/release-create-gh-release.sh @@ -26,25 +26,53 @@ function install_github_cli () popd } +function print_flask_version () +{ + local flask_filename + flask_filename="$(find ./builds-flask -type f -name 'metamask-flask-chrome-*.zip' -exec basename {} .zip \;)" + + local flask_build_filename_prefix + flask_build_filename_prefix='metamask-flask-chrome-' + local flask_build_filename_prefix_size + flask_build_filename_prefix_size="${#flask_build_filename_prefix}" + + # Use substring parameter expansion to remove the filename prefix, leaving just the version + echo "${flask_filename:$flask_build_filename_prefix_size}" +} + +function publish_flask_tag () +{ + local flask_version="${1}"; shift + + git config user.email "metamaskbot@users.noreply.github.com" + git config user.name "MetaMask Bot" + git tag -a "v${flask_version}" -m "Flask version ${flask_version}" + repo_slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" + git push "https://$GITHUB_TOKEN@github.com/$repo_slug" "v${flask_version}" +} + current_commit_msg=$(git show -s --format='%s' HEAD) if [[ $current_commit_msg =~ Version[-[:space:]](v[[:digit:]]+.[[:digit:]]+.[[:digit:]]+) ]] then tag="${BASH_REMATCH[1]}" + flask_version="$(print_flask_version)" install_github_cli printf '%s\n' 'Creating GitHub Release' release_body="$(awk -v version="${tag##v}" -f .circleci/scripts/show-changelog.awk CHANGELOG.md)" - pushd builds - hub release create \ - --attach metamask-chrome-*.zip \ - --attach metamask-firefox-*.zip \ - --message "Version ${tag##v}" \ - --message "$release_body" \ - --commitish "$CIRCLE_SHA1" \ - "$tag" - popd + hub release create \ + --attach builds/metamask-chrome-*.zip \ + --attach builds/metamask-firefox-*.zip \ + --attach builds-flask/metamask-flask-chrome-*.zip \ + --attach builds-flask/metamask-flask-firefox-*.zip \ + --message "Version ${tag##v}" \ + --message "$release_body" \ + --commitish "$CIRCLE_SHA1" \ + "$tag" + + publish_flask_tag "${flask_version}" else printf '%s\n' 'Version not found in commit message; skipping GitHub Release' exit 0 diff --git a/development/metamaskbot-build-announce.js b/development/metamaskbot-build-announce.js index 2d09a93d1..8f1a0bece 100755 --- a/development/metamaskbot-build-announce.js +++ b/development/metamaskbot-build-announce.js @@ -3,7 +3,7 @@ const { promises: fs } = require('fs'); const path = require('path'); const fetch = require('node-fetch'); const glob = require('fast-glob'); -const VERSION = require('../dist/chrome/manifest.json').version; // eslint-disable-line import/no-unresolved +const VERSION = require('../package.json').version; const { getHighlights } = require('./highlights'); start().catch(console.error); diff --git a/development/sentry-publish.js b/development/sentry-publish.js index 81fa58790..5a988c65b 100644 --- a/development/sentry-publish.js +++ b/development/sentry-publish.js @@ -1,6 +1,11 @@ #!/usr/bin/env node -const VERSION = require('../dist/chrome/manifest.json').version; // eslint-disable-line import/no-unresolved + +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); + const { runCommand, runInShell } = require('./lib/run-command'); +const { getVersion } = require('./lib/get-version'); +const { BuildType } = require('./lib/build-type'); start().catch((error) => { console.error(error); @@ -8,34 +13,63 @@ start().catch((error) => { }); async function start() { - if (!process.env.SENTRY_ORG) { - throw new Error('Missing required "SENTRY_ORG" environment variable'); - } else if (!process.env.SENTRY_PROJECT) { - throw new Error('Missing required "SENTRY_PROJECT" environment variable'); - } + const { argv } = yargs(hideBin(process.argv)).usage( + '$0 [options]', + 'Publish a release to Sentry', + (_yargs) => + _yargs + .option('org', { + default: 'metamask', + description: 'The Sentry organization', + type: 'string', + }) + .option('project', { + default: 'metamask', + description: 'The Sentry project to publish', + type: 'string', + }) + .option('build-type', { + default: BuildType.main, + description: 'The MetaMask extension build type', + choices: Object.values(BuildType), + }) + .option('build-version', { + default: 0, + description: 'The MetaMask extension build version', + type: 'number', + }), + ); + + const { buildType, buildVersion, org, project } = argv; + + process.env.SENTRY_ORG = org; + process.env.SENTRY_PROJECT = project; const authWorked = await checkIfAuthWorks(); if (!authWorked) { throw new Error(`Sentry auth failed`); } + + const version = getVersion(buildType, buildVersion); + // check if version exists or not - const versionAlreadyExists = await checkIfVersionExists(); + const versionAlreadyExists = await checkIfVersionExists(version); // abort if versions exists if (versionAlreadyExists) { console.log( - `Version "${VERSION}" already exists on Sentry, skipping version creation`, + `Version "${version}" already exists on Sentry, skipping version creation`, ); } else { // create sentry release - console.log(`creating Sentry release for "${VERSION}"...`); - await runCommand('sentry-cli', ['releases', 'new', VERSION]); + console.log(`creating Sentry release for "${version}"...`); + await runCommand('sentry-cli', ['releases', 'new', version]); console.log( - `removing any existing files from Sentry release "${VERSION}"...`, + `removing any existing files from Sentry release "${version}"...`, ); await runCommand('sentry-cli', [ 'releases', 'files', - VERSION, + version, 'delete', '--all', ]); @@ -43,18 +77,23 @@ async function start() { // check if version has artifacts or not const versionHasArtifacts = - versionAlreadyExists && (await checkIfVersionHasArtifacts()); + versionAlreadyExists && (await checkIfVersionHasArtifacts(version)); if (versionHasArtifacts) { console.log( - `Version "${VERSION}" already has artifacts on Sentry, skipping sourcemap upload`, + `Version "${version}" already has artifacts on Sentry, skipping sourcemap upload`, ); return; } + const additionalUploadArgs = []; + if (buildType !== BuildType.main) { + additionalUploadArgs.push('--dist-directory', `dist-${buildType}`); + } // upload sentry source and sourcemaps await runInShell('./development/sentry-upload-artifacts.sh', [ '--release', - VERSION, + version, + ...additionalUploadArgs, ]); } @@ -64,17 +103,17 @@ async function checkIfAuthWorks() { ); } -async function checkIfVersionExists() { +async function checkIfVersionExists(version) { return await doesNotFail(() => - runCommand('sentry-cli', ['releases', 'info', VERSION]), + runCommand('sentry-cli', ['releases', 'info', version]), ); } -async function checkIfVersionHasArtifacts() { +async function checkIfVersionHasArtifacts(version) { const [artifact] = await runCommand('sentry-cli', [ 'releases', 'files', - VERSION, + version, 'list', ]); // When there's no artifacts, we get a response from the shell like this ['', ''] diff --git a/development/sentry-upload-artifacts.sh b/development/sentry-upload-artifacts.sh index 673e1dd73..9d2fd32b4 100755 --- a/development/sentry-upload-artifacts.sh +++ b/development/sentry-upload-artifacts.sh @@ -23,17 +23,20 @@ Upload JavaScript bundles and sourcemaps to Sentry Options: -h, --help Show help text -r, --release Sentry release to upload files to (defaults to 'VERSION' environment variable) + --dist-directory The 'dist' directory to use. Defaults to 'dist'. EOF } function upload_sourcemaps { local release="${1}"; shift + local dist_directory="${1}"; shift - sentry-cli releases files "${release}" upload-sourcemaps ./dist/chrome/*.js ./dist/sourcemaps/ --rewrite --url-prefix 'metamask' + sentry-cli releases files "${release}" upload-sourcemaps "${dist_directory}"/chrome/*.js "${dist_directory}"/sourcemaps/ --rewrite --url-prefix 'metamask' } function main { local release=VERSION + local dist_directory='dist' while :; do case "${1-default}" in @@ -51,6 +54,16 @@ function main { release="${2}" shift ;; + --dist-directory) + if [[ -z $2 ]] + then + printf "'dist-directory' option requires an argument.\\n" >&2 + printf '%s\n' "${__SEE_HELP_MESSAGE__}" >&2 + exit 1 + fi + dist_directory="${2}" + shift + ;; *) break esac @@ -70,7 +83,7 @@ function main { fi printf 'uploading source files and sourcemaps for Sentry release "%s"...\n' "${release}" - upload_sourcemaps "${release}" + upload_sourcemaps "${release}" "${dist_directory}" printf 'all done!\n' } From 680d30f09584ebf37c9a66fe102d4767ef027be5 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Mon, 14 Mar 2022 12:37:19 -0700 Subject: [PATCH 10/18] snaps-skunkworks@0.10.2 (#13901) --- .../permissions/caveat-mutators.js | 2 +- .../permissions/caveat-mutators.test.js | 2 +- .../permissions/flask/snap-permissions.js | 11 ++- .../controllers/permissions/specifications.js | 5 +- .../createMethodMiddleware.js | 4 +- app/scripts/metamask-controller.js | 3 +- lavamoat/browserify/beta/policy.json | 7 +- lavamoat/browserify/flask/policy.json | 9 +- lavamoat/browserify/main/policy.json | 7 +- package.json | 12 ++- shared/constants/permissions.js | 3 + shared/constants/permissions.test.js | 12 ++- yarn.lock | 99 +++++++++++-------- 13 files changed, 103 insertions(+), 73 deletions(-) diff --git a/app/scripts/controllers/permissions/caveat-mutators.js b/app/scripts/controllers/permissions/caveat-mutators.js index fe61df6df..84f9a0ddb 100644 --- a/app/scripts/controllers/permissions/caveat-mutators.js +++ b/app/scripts/controllers/permissions/caveat-mutators.js @@ -1,4 +1,4 @@ -import { CaveatMutatorOperation } from '@metamask/snap-controllers'; +import { CaveatMutatorOperation } from '@metamask/controllers'; import { CaveatTypes } from '../../../../shared/constants/permissions'; /** diff --git a/app/scripts/controllers/permissions/caveat-mutators.test.js b/app/scripts/controllers/permissions/caveat-mutators.test.js index 93c3d0dad..476b3e1f6 100644 --- a/app/scripts/controllers/permissions/caveat-mutators.test.js +++ b/app/scripts/controllers/permissions/caveat-mutators.test.js @@ -1,4 +1,4 @@ -import { CaveatMutatorOperation } from '@metamask/snap-controllers'; +import { CaveatMutatorOperation } from '@metamask/controllers'; import { CaveatTypes } from '../../../../shared/constants/permissions'; import { CaveatMutatorFactories } from './caveat-mutators'; diff --git a/app/scripts/controllers/permissions/flask/snap-permissions.js b/app/scripts/controllers/permissions/flask/snap-permissions.js index bea6ba7a3..bde8c4c91 100644 --- a/app/scripts/controllers/permissions/flask/snap-permissions.js +++ b/app/scripts/controllers/permissions/flask/snap-permissions.js @@ -1,8 +1,9 @@ +import { endowmentPermissionBuilders } from '@metamask/controllers'; import { restrictedMethodPermissionBuilders, selectHooks, } from '@metamask/rpc-methods'; -import { endowmentPermissionBuilders } from '@metamask/snap-controllers'; +import { ExcludedSnapPermissions } from '../../../../../shared/constants/permissions'; /** * @returns {Record>} All endowment permission @@ -24,9 +25,11 @@ export const buildSnapEndowmentSpecifications = () => export function buildSnapRestrictedMethodSpecifications(hooks) { return Object.values(restrictedMethodPermissionBuilders).reduce( (specifications, { targetKey, specificationBuilder, methodHooks }) => { - specifications[targetKey] = specificationBuilder({ - methodHooks: selectHooks(hooks, methodHooks), - }); + if (!ExcludedSnapPermissions.has(targetKey)) { + specifications[targetKey] = specificationBuilder({ + methodHooks: selectHooks(hooks, methodHooks), + }); + } return specifications; }, {}, diff --git a/app/scripts/controllers/permissions/specifications.js b/app/scripts/controllers/permissions/specifications.js index 201810e54..bab176db2 100644 --- a/app/scripts/controllers/permissions/specifications.js +++ b/app/scripts/controllers/permissions/specifications.js @@ -1,7 +1,4 @@ -import { - constructPermission, - PermissionType, -} from '@metamask/snap-controllers'; +import { constructPermission, PermissionType } from '@metamask/controllers'; import { CaveatTypes, RestrictedMethods, diff --git a/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js b/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js index 74587ed73..642fdb1ce 100644 --- a/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js +++ b/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js @@ -1,10 +1,10 @@ ///: BEGIN:ONLY_INCLUDE_IN(flask) import { handlers as permittedSnapMethods } from '@metamask/rpc-methods/dist/permitted'; ///: END:ONLY_INCLUDE_IN -import { flatten } from 'lodash'; -import { permissionRpcMethods } from '@metamask/snap-controllers'; +import { permissionRpcMethods } from '@metamask/controllers'; import { selectHooks } from '@metamask/rpc-methods'; import { ethErrors } from 'eth-rpc-errors'; +import { flatten } from 'lodash'; import { UNSUPPORTED_RPC_METHODS } from '../../../../shared/constants/network'; import localHandlers from './handlers'; diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 54727ba03..0dc6bf8c4 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -585,7 +585,7 @@ export default class MetamaskController extends EventEmitter { this.workerController = new IframeExecutionService({ onError: this.onExecutionEnvironmentError.bind(this), iframeUrl: new URL( - 'https://metamask.github.io/iframe-execution-environment/0.3.1', + 'https://metamask.github.io/iframe-execution-environment/0.4.0', ), messenger: this.controllerMessenger.getRestricted({ name: 'ExecutionService', @@ -603,6 +603,7 @@ export default class MetamaskController extends EventEmitter { `${this.permissionController.name}:getEndowments`, `${this.permissionController.name}:getPermissions`, `${this.permissionController.name}:hasPermission`, + `${this.permissionController.name}:hasPermissions`, `${this.permissionController.name}:requestPermissions`, `${this.permissionController.name}:revokeAllPermissions`, ], diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 10a1dfc14..c6335a398 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -695,6 +695,7 @@ }, "@metamask/rpc-methods": { "packages": { + "@metamask/controllers": true, "@metamask/key-tree": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true @@ -734,25 +735,23 @@ "clearTimeout": true, "console.error": true, "console.log": true, - "fetch": true, "setTimeout": true }, "packages": { "@metamask/controllers": true, + "@metamask/execution-environments": true, "@metamask/object-multiplex": true, "@metamask/obs-store": true, "@metamask/post-message-stream": true, "@metamask/safe-event-emitter": true, - "@metamask/snap-workers": true, "ajv": true, "buffer": true, "concat-stream": true, + "cross-fetch": true, "crypto-browserify": true, - "deep-freeze-strict": true, "eth-rpc-errors": true, "fast-deep-equal": true, "gunzip-maybe": true, - "immer": true, "json-rpc-engine": true, "json-rpc-middleware-stream": true, "nanoid": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index df637e627..7e6d96da3 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -637,9 +637,9 @@ "setTimeout": true }, "packages": { + "@metamask/execution-environments": true, "@metamask/post-message-stream": true, "@metamask/snap-controllers": true, - "@metamask/snap-workers": true, "json-rpc-engine": true, "json-rpc-middleware-stream": true, "nanoid": true, @@ -714,6 +714,7 @@ }, "@metamask/rpc-methods": { "packages": { + "@metamask/controllers": true, "@metamask/key-tree": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true @@ -753,25 +754,23 @@ "clearTimeout": true, "console.error": true, "console.log": true, - "fetch": true, "setTimeout": true }, "packages": { "@metamask/controllers": true, + "@metamask/execution-environments": true, "@metamask/object-multiplex": true, "@metamask/obs-store": true, "@metamask/post-message-stream": true, "@metamask/safe-event-emitter": true, - "@metamask/snap-workers": true, "ajv": true, "buffer": true, "concat-stream": true, + "cross-fetch": true, "crypto-browserify": true, - "deep-freeze-strict": true, "eth-rpc-errors": true, "fast-deep-equal": true, "gunzip-maybe": true, - "immer": true, "json-rpc-engine": true, "json-rpc-middleware-stream": true, "nanoid": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 10a1dfc14..c6335a398 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -695,6 +695,7 @@ }, "@metamask/rpc-methods": { "packages": { + "@metamask/controllers": true, "@metamask/key-tree": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true @@ -734,25 +735,23 @@ "clearTimeout": true, "console.error": true, "console.log": true, - "fetch": true, "setTimeout": true }, "packages": { "@metamask/controllers": true, + "@metamask/execution-environments": true, "@metamask/object-multiplex": true, "@metamask/obs-store": true, "@metamask/post-message-stream": true, "@metamask/safe-event-emitter": true, - "@metamask/snap-workers": true, "ajv": true, "buffer": true, "concat-stream": true, + "cross-fetch": true, "crypto-browserify": true, - "deep-freeze-strict": true, "eth-rpc-errors": true, "fast-deep-equal": true, "gunzip-maybe": true, - "immer": true, "json-rpc-engine": true, "json-rpc-middleware-stream": true, "nanoid": true, diff --git a/package.json b/package.json index b01ccf93d..ed3cae201 100644 --- a/package.json +++ b/package.json @@ -116,16 +116,16 @@ "@metamask/eth-ledger-bridge-keyring": "^0.10.0", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/etherscan-link": "^2.1.0", - "@metamask/iframe-execution-environment-service": "^0.9.0", + "@metamask/iframe-execution-environment-service": "^0.10.2", "@metamask/jazzicon": "^2.0.0", "@metamask/logo": "^3.1.1", "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", "@metamask/providers": "^8.1.1", - "@metamask/rpc-methods": "^0.9.0", + "@metamask/rpc-methods": "^0.10.0", "@metamask/slip44": "^2.0.0", "@metamask/smart-transactions-controller": "^1.9.1", - "@metamask/snap-controllers": "^0.9.0", + "@metamask/snap-controllers": "^0.10.2", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", @@ -420,7 +420,11 @@ "ganache>leveldown": false, "geckodriver": true, "react-devtools>electron": true, - "eth-trezor-keyring>trezor-connect>@trezor/transport>protobufjs": false + "eth-trezor-keyring>trezor-connect>@trezor/transport>protobufjs": false, + "@metamask/iframe-execution-environment-service>@metamask/execution-environments": false, + "@metamask/snap-controllers>@metamask/execution-environments": false, + "@metamask/iframe-execution-environment-service>@metamask/snap-controllers>@metamask/execution-environments": false, + "@metamask/rpc-methods>@metamask/snap-controllers>@metamask/execution-environments": false } } } diff --git a/shared/constants/permissions.js b/shared/constants/permissions.js index ddfb12e23..982f20e7b 100644 --- a/shared/constants/permissions.js +++ b/shared/constants/permissions.js @@ -21,4 +21,7 @@ export const PermissionNamespaces = Object.freeze({ export const EndowmentPermissions = Object.freeze({ 'endowment:network-access': 'endowment:network-access', }); + +// Methods / permissions in external packages that we are temporarily excluding. +export const ExcludedSnapPermissions = new Set(['snap_notify']); ///: END:ONLY_INCLUDE_IN diff --git a/shared/constants/permissions.test.js b/shared/constants/permissions.test.js index 2c3b408f0..c6ace6243 100644 --- a/shared/constants/permissions.test.js +++ b/shared/constants/permissions.test.js @@ -1,6 +1,10 @@ -import { endowmentPermissionBuilders } from '@metamask/snap-controllers'; +import { endowmentPermissionBuilders } from '@metamask/controllers'; import { restrictedMethodPermissionBuilders } from '@metamask/rpc-methods'; -import { EndowmentPermissions, RestrictedMethods } from './permissions'; +import { + EndowmentPermissions, + ExcludedSnapPermissions, + RestrictedMethods, +} from './permissions'; describe('EndowmentPermissions', () => { it('has the expected permission keys', () => { @@ -15,7 +19,9 @@ describe('RestrictedMethods', () => { expect(Object.keys(RestrictedMethods).sort()).toStrictEqual( [ 'eth_accounts', - ...Object.keys(restrictedMethodPermissionBuilders), + ...Object.keys(restrictedMethodPermissionBuilders).filter( + (targetKey) => !ExcludedSnapPermissions.has(targetKey), + ), ].sort(), ); }); diff --git a/yarn.lock b/yarn.lock index d7ea8cf2c..4d5e908d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2806,22 +2806,37 @@ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.1.0.tgz#c0be8e68445b7b83cf85bcc03a56cdf8e256c973" integrity sha512-ADuWlTUkFfN2vXlz81Bg/0BA+XRor+CdK1055p6k7H6BLIPoDKn9SBOFld9haQFuR9cKh/JYHcnlSIv5R4fUEw== +"@metamask/execution-environments@^0.10.1", "@metamask/execution-environments@^0.10.2": + version "0.10.2" + resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.10.2.tgz#dfa4750a0eee4f51d9bc7e3c75a0e80a18798093" + integrity sha512-4bqDTk0oPRiju21M8KNaoxT8eiGaygyC2pldIrCDByfDqiIVkIpv8neol6EEH7ebMQkNiC4sr8IhfNFL7cJIdA== + dependencies: + "@metamask/object-multiplex" "^1.2.0" + "@metamask/post-message-stream" "^4.0.0" + "@metamask/providers" "^8.1.1" + "@metamask/snap-types" "^0.10.1" + cross-fetch "^3.1.5" + eth-rpc-errors "^4.0.3" + pump "^3.0.0" + ses "^0.15.7" + stream-browserify "^3.0.0" + "@metamask/forwarder@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@metamask/forwarder/-/forwarder-1.1.0.tgz#13829d8244bbf19ea658c0b20d21a77b67de0bdd" integrity sha512-Hggj4y0QIjDzKGTXzarhEPIQyFSB2bi2y6YLJNwaT4JmP30UB5Cj6gqoY0M4pj3QT57fzp0BUuGp7F/AUe28tw== -"@metamask/iframe-execution-environment-service@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@metamask/iframe-execution-environment-service/-/iframe-execution-environment-service-0.9.0.tgz#721e15ee4651741a599940dbcfa524cc55eaaa47" - integrity sha512-a240sg83sX1dxfBDdRd0uoujaN4V9VtHKELMcTMgpYCI0uE83//Q01a7L8MiBtLhzr8o4D/xXRUIDR0Y9NKc3Q== +"@metamask/iframe-execution-environment-service@^0.10.2": + version "0.10.2" + resolved "https://registry.yarnpkg.com/@metamask/iframe-execution-environment-service/-/iframe-execution-environment-service-0.10.2.tgz#85e38616af2a46b170c4940e2d7c5cd8eeaa4c48" + integrity sha512-99hAcMyeqacmhh4dsD4my55Y6g5v2L6ftXmTu7cfl+EKy39t5miWSKTGbL4dDocsAiKI/7nI9LMyyWFgcDCx8Q== dependencies: - "@metamask/controllers" "^25.1.0" + "@metamask/controllers" "^26.0.0" + "@metamask/execution-environments" "^0.10.2" "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^4.0.0" - "@metamask/snap-controllers" "^0.9.0" - "@metamask/snap-types" "^0.9.0" - "@metamask/snap-workers" "^0.9.0" + "@metamask/snap-controllers" "^0.10.2" + "@metamask/snap-types" "^0.10.1" eth-rpc-errors "^4.0.3" json-rpc-engine "^6.1.0" json-rpc-middleware-stream "^3.0.0" @@ -2915,13 +2930,15 @@ pump "^3.0.0" webextension-polyfill-ts "^0.25.0" -"@metamask/rpc-methods@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.9.0.tgz#eb55cc39d2ea9a663211e8d805bdf566af70c764" - integrity sha512-wii0TMuRscet8+x3tqfAcEmY0TrMFzOnD3QFpFVUy3fznv4b/EzDD/XLQToafd2yUaDjUrrS9FHwU9omqzPxcg== +"@metamask/rpc-methods@^0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.10.0.tgz#8d7ea5e378a9144b4171f4f846d06d10657ed02e" + integrity sha512-nHFO8Dg4L422cKMgLXnfkX0F3z7j3N/7KyLPgxCoOhHvFz35uwC1jxz9WWF2+yv7j1Y8hVkRg4umyg76/IXZLg== dependencies: + "@metamask/controllers" "^26.0.0" "@metamask/key-tree" "^3.0.1" - "@metamask/snap-controllers" "^0.9.0" + "@metamask/snap-controllers" "^0.10.0" + "@metamask/types" "^1.1.0" eth-rpc-errors "^4.0.2" "@metamask/safe-event-emitter@^2.0.0": @@ -2947,20 +2964,22 @@ isomorphic-fetch "^3.0.0" lodash "^4.17.21" -"@metamask/snap-controllers@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.9.0.tgz#e0006fc9991e995dd86dff792106990aae2aeda0" - integrity sha512-os3fEai0w4ctpyy6ExlthY8tnww98Vm+RVwOZgrCKDY5dAXqlSXpyWc1uOfkQyiPhUEJtdznJTWzaWzNIO9MfQ== +"@metamask/snap-controllers@^0.10.0", "@metamask/snap-controllers@^0.10.2": + version "0.10.2" + resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.10.2.tgz#0261ff82dd384f8a9398116967cfa2f7eb44b063" + integrity sha512-KFM7U6hCmUjevLK2hYUMcqRKtxK3/J2cI8uUbE1rx4zwBfDuN58RfI1s+69rZtblucqpnuqKs+Mc56lxb6+6oQ== dependencies: - "@metamask/controllers" "^25.1.0" + "@metamask/controllers" "^26.0.0" + "@metamask/execution-environments" "^0.10.2" "@metamask/object-multiplex" "^1.1.0" "@metamask/obs-store" "^7.0.0" "@metamask/post-message-stream" "4.0.0" "@metamask/safe-event-emitter" "^2.0.0" - "@metamask/snap-workers" "^0.9.0" "@types/deep-freeze-strict" "^1.1.0" + "@types/semver" "^7.3.9" ajv "^8.8.2" concat-stream "^2.0.0" + cross-fetch "^3.1.5" deep-freeze-strict "^1.1.1" eth-rpc-errors "^4.0.2" fast-deep-equal "^3.1.3" @@ -2974,17 +2993,12 @@ semver "^7.3.5" tar-stream "^2.2.0" -"@metamask/snap-types@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.9.0.tgz#aa164111be1b5c53fbaaf03c1bccbdbd0741daa4" - integrity sha512-pK4tvurUhcKMEkTD0XvQze5HCbtrgmpFWDztBekNIMJTXDrnYIEw4Dxn+LwCX7WJ0DN/03brQSEzmIrYbcBw7Q== +"@metamask/snap-types@^0.10.1": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.10.1.tgz#dd170813d38091473f9ae1fd1e9d64c46666ba0c" + integrity sha512-DsTAMSNmVWH/wXL4OWvnI4Wxh247d7PPD0jjxlMC3hEKB6hSdbCW3umwxqBCxgrU18gJOGwNJMygTolxO0SUrA== dependencies: - "@metamask/controllers" "^25.1.0" - -"@metamask/snap-workers@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-workers/-/snap-workers-0.9.0.tgz#215407b632fef4723dd75af7accf1f02a6a46916" - integrity sha512-+4YY5CQ7OPFPWh4QF5e4COgc0aWL6Df7Oc8/y//Sabp1rmXWI429OzCOlBi+NGJfQ1K7ORBMlRtOwYB9ZmWyLA== + "@metamask/controllers" "^26.0.0" "@metamask/test-dapp@^5.0.0": version "5.0.0" @@ -4662,6 +4676,11 @@ dependencies: "@types/node" "*" +"@types/semver@^7.3.9": + version "7.3.9" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" + integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ== + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -8842,12 +8861,12 @@ cross-fetch@^2.1.0: node-fetch "2.1.2" whatwg-fetch "2.0.4" -cross-fetch@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" - integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== +cross-fetch@^3.1.4, cross-fetch@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== dependencies: - node-fetch "2.6.1" + node-fetch "2.6.7" cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" @@ -19714,12 +19733,7 @@ node-fetch@2.1.2: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@~2.6.1: +node-fetch@2.6.7, node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@~2.6.1: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -24562,6 +24576,11 @@ ses@^0.12.4: "@agoric/make-hardener" "^0.1.2" "@agoric/transform-module" "^0.4.1" +ses@^0.15.7: + version "0.15.11" + resolved "https://registry.yarnpkg.com/ses/-/ses-0.15.11.tgz#851cb6a20d8967537075d25bb0185051c28c23db" + integrity sha512-lQg6q8/PVf+n18EjP+5Uv1tN9oVQ3br5QxJzPXoAVQleSYnlf20JY9coe7n1B9A6CtIKIHyr6m/TfskcRCufgA== + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" From 6ccf52b5aea209a510209dbef64f530a7f6fad45 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Mon, 14 Mar 2022 17:59:53 -0700 Subject: [PATCH 11/18] Fix yarn.lock (#13941) --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 4d5e908d2..65287507b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2806,7 +2806,7 @@ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.1.0.tgz#c0be8e68445b7b83cf85bcc03a56cdf8e256c973" integrity sha512-ADuWlTUkFfN2vXlz81Bg/0BA+XRor+CdK1055p6k7H6BLIPoDKn9SBOFld9haQFuR9cKh/JYHcnlSIv5R4fUEw== -"@metamask/execution-environments@^0.10.1", "@metamask/execution-environments@^0.10.2": +"@metamask/execution-environments@^0.10.2": version "0.10.2" resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.10.2.tgz#dfa4750a0eee4f51d9bc7e3c75a0e80a18798093" integrity sha512-4bqDTk0oPRiju21M8KNaoxT8eiGaygyC2pldIrCDByfDqiIVkIpv8neol6EEH7ebMQkNiC4sr8IhfNFL7cJIdA== From d6434b4ace6f24a32a989199b5265e69cecd5f86 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 16 Mar 2022 18:37:50 +0100 Subject: [PATCH 12/18] Fix permission list shrinking with less text (#13996) * Fix permission list shrinking with text * Fix linting issue --- ui/components/app/permission-page-container/index.scss | 2 ++ .../app/permissions-connect-permission-list/index.scss | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ui/components/app/permission-page-container/index.scss b/ui/components/app/permission-page-container/index.scss index aaf2753bd..5a087b18c 100644 --- a/ui/components/app/permission-page-container/index.scss +++ b/ui/components/app/permission-page-container/index.scss @@ -53,6 +53,7 @@ } &__requested { + width: 100%; text-align: left; } @@ -91,6 +92,7 @@ } &__permissions-container { + width: 100%; display: flex; flex-direction: column; margin-top: 38px; diff --git a/ui/components/app/permissions-connect-permission-list/index.scss b/ui/components/app/permissions-connect-permission-list/index.scss index adbe224b7..17be8eda6 100644 --- a/ui/components/app/permissions-connect-permission-list/index.scss +++ b/ui/components/app/permissions-connect-permission-list/index.scss @@ -1,7 +1,10 @@ .permissions-connect-permission-list { + width: 100%; + .permission { @include H6; + width: 100%; padding-bottom: 16px; border-bottom: 1px solid var(--Grey-100); display: flex; From cb89800a0a7166ce7796c3e35a9c271cf40d6e41 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Fri, 18 Mar 2022 18:07:12 +0100 Subject: [PATCH 13/18] snaps-skunkworks@0.10.3 (#14041) --- package.json | 6 +++--- yarn.lock | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index ed3cae201..a2606eca0 100644 --- a/package.json +++ b/package.json @@ -116,16 +116,16 @@ "@metamask/eth-ledger-bridge-keyring": "^0.10.0", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/etherscan-link": "^2.1.0", - "@metamask/iframe-execution-environment-service": "^0.10.2", + "@metamask/iframe-execution-environment-service": "^0.10.3", "@metamask/jazzicon": "^2.0.0", "@metamask/logo": "^3.1.1", "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", "@metamask/providers": "^8.1.1", - "@metamask/rpc-methods": "^0.10.0", + "@metamask/rpc-methods": "^0.10.3", "@metamask/slip44": "^2.0.0", "@metamask/smart-transactions-controller": "^1.9.1", - "@metamask/snap-controllers": "^0.10.2", + "@metamask/snap-controllers": "^0.10.3", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", diff --git a/yarn.lock b/yarn.lock index 65287507b..b60ef4acf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2806,15 +2806,15 @@ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.1.0.tgz#c0be8e68445b7b83cf85bcc03a56cdf8e256c973" integrity sha512-ADuWlTUkFfN2vXlz81Bg/0BA+XRor+CdK1055p6k7H6BLIPoDKn9SBOFld9haQFuR9cKh/JYHcnlSIv5R4fUEw== -"@metamask/execution-environments@^0.10.2": - version "0.10.2" - resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.10.2.tgz#dfa4750a0eee4f51d9bc7e3c75a0e80a18798093" - integrity sha512-4bqDTk0oPRiju21M8KNaoxT8eiGaygyC2pldIrCDByfDqiIVkIpv8neol6EEH7ebMQkNiC4sr8IhfNFL7cJIdA== +"@metamask/execution-environments@^0.10.3": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.10.3.tgz#3a080523a399614b4b993d87e6bb933ccc3bcf24" + integrity sha512-03zOThe9QhopfMHB8wlpOCLtxhKyPiyxr0RM97xBeKSXHgItsqRL8BBi9LW+ww8JEp9MAD2Bnbt1LEzSN5QjqA== dependencies: "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^4.0.0" "@metamask/providers" "^8.1.1" - "@metamask/snap-types" "^0.10.1" + "@metamask/snap-types" "^0.10.3" cross-fetch "^3.1.5" eth-rpc-errors "^4.0.3" pump "^3.0.0" @@ -2826,17 +2826,17 @@ resolved "https://registry.yarnpkg.com/@metamask/forwarder/-/forwarder-1.1.0.tgz#13829d8244bbf19ea658c0b20d21a77b67de0bdd" integrity sha512-Hggj4y0QIjDzKGTXzarhEPIQyFSB2bi2y6YLJNwaT4JmP30UB5Cj6gqoY0M4pj3QT57fzp0BUuGp7F/AUe28tw== -"@metamask/iframe-execution-environment-service@^0.10.2": - version "0.10.2" - resolved "https://registry.yarnpkg.com/@metamask/iframe-execution-environment-service/-/iframe-execution-environment-service-0.10.2.tgz#85e38616af2a46b170c4940e2d7c5cd8eeaa4c48" - integrity sha512-99hAcMyeqacmhh4dsD4my55Y6g5v2L6ftXmTu7cfl+EKy39t5miWSKTGbL4dDocsAiKI/7nI9LMyyWFgcDCx8Q== +"@metamask/iframe-execution-environment-service@^0.10.3": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@metamask/iframe-execution-environment-service/-/iframe-execution-environment-service-0.10.3.tgz#47059dcdac4ca0b6009a5c8c9e3488f3467effa0" + integrity sha512-4fJnsNC7drDXo3Eg8UfCNm9uwDKOo8W/AU4izFXXFjzkd5dVSfo2tWSdGMDJj1sxdgU6O1vr12yc9HxbnQXt9Q== dependencies: "@metamask/controllers" "^26.0.0" - "@metamask/execution-environments" "^0.10.2" + "@metamask/execution-environments" "^0.10.3" "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^4.0.0" - "@metamask/snap-controllers" "^0.10.2" - "@metamask/snap-types" "^0.10.1" + "@metamask/snap-controllers" "^0.10.3" + "@metamask/snap-types" "^0.10.3" eth-rpc-errors "^4.0.3" json-rpc-engine "^6.1.0" json-rpc-middleware-stream "^3.0.0" @@ -2930,14 +2930,14 @@ pump "^3.0.0" webextension-polyfill-ts "^0.25.0" -"@metamask/rpc-methods@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.10.0.tgz#8d7ea5e378a9144b4171f4f846d06d10657ed02e" - integrity sha512-nHFO8Dg4L422cKMgLXnfkX0F3z7j3N/7KyLPgxCoOhHvFz35uwC1jxz9WWF2+yv7j1Y8hVkRg4umyg76/IXZLg== +"@metamask/rpc-methods@^0.10.3": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.10.3.tgz#75816fd9fd14313d634a55e3877189ce8f102626" + integrity sha512-gEllV6CVpzjhjwGBFz2YgOov0vYXsYnpu5eg+0g8FMTGqhsgLuwLVEvPuAWKf9h+yR+Oflx+DRnKNrxtV/P/eg== dependencies: "@metamask/controllers" "^26.0.0" "@metamask/key-tree" "^3.0.1" - "@metamask/snap-controllers" "^0.10.0" + "@metamask/snap-controllers" "^0.10.3" "@metamask/types" "^1.1.0" eth-rpc-errors "^4.0.2" @@ -2964,13 +2964,13 @@ isomorphic-fetch "^3.0.0" lodash "^4.17.21" -"@metamask/snap-controllers@^0.10.0", "@metamask/snap-controllers@^0.10.2": - version "0.10.2" - resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.10.2.tgz#0261ff82dd384f8a9398116967cfa2f7eb44b063" - integrity sha512-KFM7U6hCmUjevLK2hYUMcqRKtxK3/J2cI8uUbE1rx4zwBfDuN58RfI1s+69rZtblucqpnuqKs+Mc56lxb6+6oQ== +"@metamask/snap-controllers@^0.10.3": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.10.3.tgz#5cd0cf22ddccf83bc7b52ef86f5cc7d44868d877" + integrity sha512-l8haEQ6B1bhiWN0WDXST3eHFn/hgE9bG+PvcjMRkd7ENOQptTjCKqiC4CojpEuY+VoHZ519CK7qZv+Zg4yQqOw== dependencies: "@metamask/controllers" "^26.0.0" - "@metamask/execution-environments" "^0.10.2" + "@metamask/execution-environments" "^0.10.3" "@metamask/object-multiplex" "^1.1.0" "@metamask/obs-store" "^7.0.0" "@metamask/post-message-stream" "4.0.0" @@ -2993,10 +2993,10 @@ semver "^7.3.5" tar-stream "^2.2.0" -"@metamask/snap-types@^0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.10.1.tgz#dd170813d38091473f9ae1fd1e9d64c46666ba0c" - integrity sha512-DsTAMSNmVWH/wXL4OWvnI4Wxh247d7PPD0jjxlMC3hEKB6hSdbCW3umwxqBCxgrU18gJOGwNJMygTolxO0SUrA== +"@metamask/snap-types@^0.10.3": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.10.3.tgz#733cbba058489eb084590788e9d9ad1eeff2a35a" + integrity sha512-Rdus61liExENanzBtu9QYRScyqzOQGvXuaaZJAVJN5TnsIt2hsOq9D6wktKvT3IHeKCF9ydFq4YWam2RcNccoQ== dependencies: "@metamask/controllers" "^26.0.0" From 5107f06afab8cdd61b25e8b09b0bc31b2637381d Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 21 Mar 2022 21:55:08 +0100 Subject: [PATCH 14/18] snaps-skunkworks@0.10.6 (#14070) * snaps-skunkworks@0.10.6 * iframe-execution-environment@0.4.2 Co-authored-by: Erik Marks --- app/scripts/metamask-controller.js | 2 +- package.json | 6 ++-- yarn.lock | 52 +++++++++++++++--------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 0dc6bf8c4..ccfee5ae5 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -585,7 +585,7 @@ export default class MetamaskController extends EventEmitter { this.workerController = new IframeExecutionService({ onError: this.onExecutionEnvironmentError.bind(this), iframeUrl: new URL( - 'https://metamask.github.io/iframe-execution-environment/0.4.0', + 'https://metamask.github.io/iframe-execution-environment/0.4.2', ), messenger: this.controllerMessenger.getRestricted({ name: 'ExecutionService', diff --git a/package.json b/package.json index a2606eca0..7caf2a003 100644 --- a/package.json +++ b/package.json @@ -116,16 +116,16 @@ "@metamask/eth-ledger-bridge-keyring": "^0.10.0", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/etherscan-link": "^2.1.0", - "@metamask/iframe-execution-environment-service": "^0.10.3", + "@metamask/iframe-execution-environment-service": "^0.10.6", "@metamask/jazzicon": "^2.0.0", "@metamask/logo": "^3.1.1", "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", "@metamask/providers": "^8.1.1", - "@metamask/rpc-methods": "^0.10.3", + "@metamask/rpc-methods": "^0.10.6", "@metamask/slip44": "^2.0.0", "@metamask/smart-transactions-controller": "^1.9.1", - "@metamask/snap-controllers": "^0.10.3", + "@metamask/snap-controllers": "^0.10.6", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", diff --git a/yarn.lock b/yarn.lock index b60ef4acf..96a3c74cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2806,15 +2806,15 @@ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.1.0.tgz#c0be8e68445b7b83cf85bcc03a56cdf8e256c973" integrity sha512-ADuWlTUkFfN2vXlz81Bg/0BA+XRor+CdK1055p6k7H6BLIPoDKn9SBOFld9haQFuR9cKh/JYHcnlSIv5R4fUEw== -"@metamask/execution-environments@^0.10.3": - version "0.10.3" - resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.10.3.tgz#3a080523a399614b4b993d87e6bb933ccc3bcf24" - integrity sha512-03zOThe9QhopfMHB8wlpOCLtxhKyPiyxr0RM97xBeKSXHgItsqRL8BBi9LW+ww8JEp9MAD2Bnbt1LEzSN5QjqA== +"@metamask/execution-environments@^0.10.6": + version "0.10.6" + resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.10.6.tgz#930ff056e63accf7ab7a59a28bd99064d217599c" + integrity sha512-6ID8vzmIiy418LqRiDKPuDl0RBhHmDMzhgyb65ia6zZNDXKhsBotF/lNMhtHlsAbD9+3XYhi/Nl6YprJxaRisA== dependencies: "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^4.0.0" "@metamask/providers" "^8.1.1" - "@metamask/snap-types" "^0.10.3" + "@metamask/snap-types" "^0.10.6" cross-fetch "^3.1.5" eth-rpc-errors "^4.0.3" pump "^3.0.0" @@ -2826,17 +2826,17 @@ resolved "https://registry.yarnpkg.com/@metamask/forwarder/-/forwarder-1.1.0.tgz#13829d8244bbf19ea658c0b20d21a77b67de0bdd" integrity sha512-Hggj4y0QIjDzKGTXzarhEPIQyFSB2bi2y6YLJNwaT4JmP30UB5Cj6gqoY0M4pj3QT57fzp0BUuGp7F/AUe28tw== -"@metamask/iframe-execution-environment-service@^0.10.3": - version "0.10.3" - resolved "https://registry.yarnpkg.com/@metamask/iframe-execution-environment-service/-/iframe-execution-environment-service-0.10.3.tgz#47059dcdac4ca0b6009a5c8c9e3488f3467effa0" - integrity sha512-4fJnsNC7drDXo3Eg8UfCNm9uwDKOo8W/AU4izFXXFjzkd5dVSfo2tWSdGMDJj1sxdgU6O1vr12yc9HxbnQXt9Q== +"@metamask/iframe-execution-environment-service@^0.10.6": + version "0.10.6" + resolved "https://registry.yarnpkg.com/@metamask/iframe-execution-environment-service/-/iframe-execution-environment-service-0.10.6.tgz#ba7e5499efba2018cef38fff916eaabbfbe1b27b" + integrity sha512-BZbE4+CffNmD1J7Mpvh/evvKcDuP82Jl9panIV0JKzddG8zzOi9xlGtImYf8QWjwN5zx2TyTHAb/WxA+R+nFzw== dependencies: "@metamask/controllers" "^26.0.0" - "@metamask/execution-environments" "^0.10.3" + "@metamask/execution-environments" "^0.10.6" "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^4.0.0" - "@metamask/snap-controllers" "^0.10.3" - "@metamask/snap-types" "^0.10.3" + "@metamask/snap-controllers" "^0.10.6" + "@metamask/snap-types" "^0.10.6" eth-rpc-errors "^4.0.3" json-rpc-engine "^6.1.0" json-rpc-middleware-stream "^3.0.0" @@ -2930,14 +2930,14 @@ pump "^3.0.0" webextension-polyfill-ts "^0.25.0" -"@metamask/rpc-methods@^0.10.3": - version "0.10.3" - resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.10.3.tgz#75816fd9fd14313d634a55e3877189ce8f102626" - integrity sha512-gEllV6CVpzjhjwGBFz2YgOov0vYXsYnpu5eg+0g8FMTGqhsgLuwLVEvPuAWKf9h+yR+Oflx+DRnKNrxtV/P/eg== +"@metamask/rpc-methods@^0.10.6": + version "0.10.6" + resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.10.6.tgz#6e91c2bf33c909e203db438effec6663da4e8692" + integrity sha512-cPqAQExwZGRLqtl22HUBVblr/tIAm/aI3ZMt6QKhwymwU7f/yM+4BOZB1M3+dVlhcIfX1SFFxDW3rFe+MsCksA== dependencies: "@metamask/controllers" "^26.0.0" "@metamask/key-tree" "^3.0.1" - "@metamask/snap-controllers" "^0.10.3" + "@metamask/snap-controllers" "^0.10.6" "@metamask/types" "^1.1.0" eth-rpc-errors "^4.0.2" @@ -2964,13 +2964,13 @@ isomorphic-fetch "^3.0.0" lodash "^4.17.21" -"@metamask/snap-controllers@^0.10.3": - version "0.10.3" - resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.10.3.tgz#5cd0cf22ddccf83bc7b52ef86f5cc7d44868d877" - integrity sha512-l8haEQ6B1bhiWN0WDXST3eHFn/hgE9bG+PvcjMRkd7ENOQptTjCKqiC4CojpEuY+VoHZ519CK7qZv+Zg4yQqOw== +"@metamask/snap-controllers@^0.10.6": + version "0.10.6" + resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.10.6.tgz#72fc52271264c4ae8c986ce4d1a64c34505c7a8b" + integrity sha512-Pa8g1dBVKtjkemRXFUPDQLnP8gcVmQpSgkTMK/m7tVqUinyZX7Gufq5wuApEh1pwRjMQ2R7he/zQn7oZ4qwTJw== dependencies: "@metamask/controllers" "^26.0.0" - "@metamask/execution-environments" "^0.10.3" + "@metamask/execution-environments" "^0.10.6" "@metamask/object-multiplex" "^1.1.0" "@metamask/obs-store" "^7.0.0" "@metamask/post-message-stream" "4.0.0" @@ -2993,10 +2993,10 @@ semver "^7.3.5" tar-stream "^2.2.0" -"@metamask/snap-types@^0.10.3": - version "0.10.3" - resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.10.3.tgz#733cbba058489eb084590788e9d9ad1eeff2a35a" - integrity sha512-Rdus61liExENanzBtu9QYRScyqzOQGvXuaaZJAVJN5TnsIt2hsOq9D6wktKvT3IHeKCF9ydFq4YWam2RcNccoQ== +"@metamask/snap-types@^0.10.6": + version "0.10.6" + resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.10.6.tgz#83e3eab797829a9f31906a27fa967a8096e5b704" + integrity sha512-6eSc9hHhC+X133Nw6/WSUy0RWRipdOF3NBKgGFYJxCpvhkY4jGxQ1HAKDUZRzZ3eSewsmQ4hhhIQ+zczj0Subw== dependencies: "@metamask/controllers" "^26.0.0" From 8ea8b50683579e9548977642c1b9c8cd17c94e96 Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Tue, 22 Mar 2022 19:59:51 -0700 Subject: [PATCH 15/18] Version v10.11.4 --- package.json | 2 +- yarn.lock | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7caf2a003..e91927dcf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.11.3", + "version": "10.11.4", "private": true, "repository": { "type": "git", diff --git a/yarn.lock b/yarn.lock index 96a3c74cf..f0fdbf330 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2707,6 +2707,46 @@ web3 "^0.20.7" web3-provider-engine "^16.0.3" +"@metamask/controllers@^26.0.0": + version "26.0.0" + resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-26.0.0.tgz#3df4a3071ffb26d357ba99f288d52fb9d913c35a" + integrity sha512-iAWDoP/omxGzPfYyBFRNPJ32zcYvZHnUhIM2LyWoCwQj9ZYC1qh+dDX6I0O5jEeQcBrEb+Nl6AcnwHKVdEUz5Q== + dependencies: + "@ethereumjs/common" "^2.3.1" + "@ethereumjs/tx" "^3.2.1" + "@metamask/contract-metadata" "^1.31.0" + "@metamask/metamask-eth-abis" "3.0.0" + "@metamask/types" "^1.1.0" + "@types/uuid" "^8.3.0" + abort-controller "^3.0.0" + async-mutex "^0.2.6" + babel-runtime "^6.26.0" + deep-freeze-strict "^1.1.1" + eth-ens-namehash "^2.0.8" + eth-json-rpc-infura "^5.1.0" + eth-keyring-controller "^6.2.1" + eth-method-registry "1.1.0" + eth-phishing-detect "^1.1.14" + eth-query "^2.1.2" + eth-rpc-errors "^4.0.0" + eth-sig-util "^3.0.0" + ethereumjs-util "^7.0.10" + ethereumjs-wallet "^1.0.1" + ethers "^5.4.1" + ethjs-unit "^0.1.6" + fast-deep-equal "^3.1.3" + immer "^9.0.6" + isomorphic-fetch "^3.0.0" + json-rpc-engine "^6.1.0" + jsonschema "^1.2.4" + multiformats "^9.5.2" + nanoid "^3.1.31" + punycode "^2.1.1" + single-call-balance-checker-abi "^1.0.0" + uuid "^8.3.2" + web3 "^0.20.7" + web3-provider-engine "^16.0.3" + "@metamask/controllers@^27.0.0": version "27.0.0" resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-27.0.0.tgz#23fb24960880047635a7e0b226375b843f385ad1" From 4139aa26a935986515bcc459d755bfab7ac6181e Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 10 Mar 2022 12:31:50 -0330 Subject: [PATCH 16/18] Derive version suffix from build type and version (#13895) The version of a build is now derived from both the `version` field in `package.json` and the requested build type and version. The build type and version are added onto the manifest version as a suffix, according to the SemVer prerelease format. We already have support in the extension for versions of this format, but to apply a Flask or Beta version required manual updates to `package.json`. Now it can be done just with build arguments. A `get-version` module was created to make it easier to generate the version in the various places we do that during the build. It was created in the `development/lib` directory because it will be used by other non-build development scripts in a future PR. The `BuildType` constant was extracted to its own module as well, and moved to the `development/lib` directory. This was to make it clear that it's used by various different development scripts, not just the build. --- development/build/etc.js | 12 ++++++---- development/build/index.js | 24 ++++++++++++++++--- development/build/manifest.js | 2 +- development/build/scripts.js | 15 ++++++++---- development/build/static.js | 2 +- .../build/transforms/remove-fenced-code.js | 2 +- .../transforms/remove-fenced-code.test.js | 2 +- development/build/utils.js | 17 +++---------- development/lib/build-type.js | 12 ++++++++++ development/lib/get-version.js | 21 ++++++++++++++++ 10 files changed, 79 insertions(+), 30 deletions(-) create mode 100644 development/lib/build-type.js create mode 100644 development/lib/get-version.js diff --git a/development/build/etc.js b/development/build/etc.js index fe30002d8..7b76e0b9c 100644 --- a/development/build/etc.js +++ b/development/build/etc.js @@ -4,13 +4,13 @@ const gulpZip = require('gulp-zip'); const del = require('del'); const pify = require('pify'); const pump = pify(require('pump')); -const { version } = require('../../package.json'); + +const { BuildType } = require('../lib/build-type'); const { createTask, composeParallel } = require('./task'); -const { BuildType } = require('./utils'); module.exports = createEtcTasks; -function createEtcTasks({ browserPlatforms, buildType, livereload }) { +function createEtcTasks({ browserPlatforms, buildType, livereload, version }) { const clean = createTask('clean', async function clean() { await del(['./dist/*']); await Promise.all( @@ -28,14 +28,16 @@ function createEtcTasks({ browserPlatforms, buildType, livereload }) { const zip = createTask( 'zip', composeParallel( - ...browserPlatforms.map((platform) => createZipTask(platform, buildType)), + ...browserPlatforms.map((platform) => + createZipTask(platform, buildType, version), + ), ), ); return { clean, reload, zip }; } -function createZipTask(platform, buildType) { +function createZipTask(platform, buildType, version) { return async () => { const path = buildType === BuildType.main diff --git a/development/build/index.js b/development/build/index.js index 987d99854..dd0e7b4c9 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -7,6 +7,8 @@ const path = require('path'); const livereload = require('gulp-livereload'); const minimist = require('minimist'); const { sync: globby } = require('globby'); +const { getVersion } = require('../lib/get-version'); +const { BuildType } = require('../lib/build-type'); const { createTask, composeSeries, @@ -18,7 +20,7 @@ const createScriptTasks = require('./scripts'); const createStyleTasks = require('./styles'); const createStaticAssetTasks = require('./static'); const createEtcTasks = require('./etc'); -const { BuildType, getBrowserVersionMap } = require('./utils'); +const { getBrowserVersionMap } = require('./utils'); // Packages required dynamically via browserify configuration in dependencies // Required for LavaMoat policy generation @@ -58,11 +60,12 @@ function defineAndRunBuildTasks() { shouldIncludeLockdown, shouldLintFenceFiles, skipStats, + version, } = parseArgv(); const browserPlatforms = ['firefox', 'chrome', 'brave', 'opera']; - const browserVersionMap = getBrowserVersionMap(browserPlatforms); + const browserVersionMap = getBrowserVersionMap(browserPlatforms, version); const ignoredFiles = getIgnoredFiles(buildType); @@ -89,12 +92,14 @@ function defineAndRunBuildTasks() { livereload, policyOnly, shouldLintFenceFiles, + version, }); const { clean, reload, zip } = createEtcTasks({ livereload, browserPlatforms, buildType, + version, }); // build for development (livereload) @@ -162,6 +167,7 @@ function defineAndRunBuildTasks() { function parseArgv() { const NamedArgs = { BuildType: 'build-type', + BuildVersion: 'build-version', LintFenceFiles: 'lint-fence-files', Lockdown: 'lockdown', PolicyOnly: 'policy-only', @@ -175,9 +181,10 @@ function parseArgv() { NamedArgs.PolicyOnly, NamedArgs.SkipStats, ], - string: [NamedArgs.BuildType], + string: [NamedArgs.BuildType, NamedArgs.BuildVersion], default: { [NamedArgs.BuildType]: BuildType.main, + [NamedArgs.BuildVersion]: '0', [NamedArgs.LintFenceFiles]: true, [NamedArgs.Lockdown]: true, [NamedArgs.PolicyOnly]: false, @@ -201,6 +208,14 @@ function parseArgv() { throw new Error(`MetaMask build: Invalid build type: "${buildType}"`); } + const rawBuildVersion = argv[NamedArgs.BuildVersion]; + const buildVersion = Number.parseInt(rawBuildVersion, 10); + if (rawBuildVersion.match(/^\d+$/u) === null || Number.isNaN(buildVersion)) { + throw new Error( + `MetaMask build: Invalid build version: "${rawBuildVersion}"`, + ); + } + // Manually default this to `false` for dev builds only. const shouldLintFenceFiles = process.argv.includes( `--${NamedArgs.LintFenceFiles}`, @@ -210,6 +225,8 @@ function parseArgv() { const policyOnly = argv[NamedArgs.PolicyOnly]; + const version = getVersion(buildType, buildVersion); + return { buildType, entryTask, @@ -218,6 +235,7 @@ function parseArgv() { shouldIncludeLockdown: argv[NamedArgs.Lockdown], shouldLintFenceFiles, skipStats: argv[NamedArgs.SkipStats], + version, }; } diff --git a/development/build/manifest.js b/development/build/manifest.js index 524f2ef3b..498ab2785 100644 --- a/development/build/manifest.js +++ b/development/build/manifest.js @@ -3,9 +3,9 @@ const path = require('path'); const { mergeWith, cloneDeep } = require('lodash'); const baseManifest = require('../../app/manifest/_base.json'); +const { BuildType } = require('../lib/build-type'); const { createTask, composeSeries } = require('./task'); -const { BuildType } = require('./utils'); module.exports = createManifestTasks; diff --git a/development/build/scripts.js b/development/build/scripts.js index d07f7bcfc..035c38969 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -45,7 +45,7 @@ const metamaskrc = require('rc')('metamask', { }); const { streamFlatMap } = require('../stream-flat-map.js'); -const { version } = require('../../package.json'); +const { BuildType } = require('../lib/build-type'); const { createTask, @@ -56,7 +56,6 @@ const { const { createRemoveFencedCodeTransform, } = require('./transforms/remove-fenced-code'); -const { BuildType } = require('./utils'); /** * The build environment. This describes the environment this build was produced in. @@ -147,6 +146,7 @@ function createScriptTasks({ livereload, shouldLintFenceFiles, policyOnly, + version, }) { // internal tasks const core = { @@ -192,6 +192,7 @@ function createScriptTasks({ policyOnly, shouldLintFenceFiles, testing, + version, }), ); @@ -344,6 +345,7 @@ function createFactoredBuild({ policyOnly, shouldLintFenceFiles, testing, + version, }) { return async function () { // create bundler setup and apply defaults @@ -355,7 +357,12 @@ function createFactoredBuild({ const reloadOnChange = Boolean(devMode); const minify = Boolean(devMode) === false; - const envVars = getEnvironmentVariables({ buildType, devMode, testing }); + const envVars = getEnvironmentVariables({ + buildType, + devMode, + testing, + version, + }); setupBundlerDefaults(buildConfiguration, { buildType, devMode, @@ -780,7 +787,7 @@ async function bundleIt(buildConfiguration, { reloadOnChange }) { } } -function getEnvironmentVariables({ buildType, devMode, testing }) { +function getEnvironmentVariables({ buildType, devMode, testing, version }) { const environment = getEnvironment({ devMode, testing }); if (environment === ENVIRONMENT.PRODUCTION && !process.env.SENTRY_DSN) { throw new Error('Missing SENTRY_DSN environment variable'); diff --git a/development/build/static.js b/development/build/static.js index 1ec935502..7efde5a72 100644 --- a/development/build/static.js +++ b/development/build/static.js @@ -4,9 +4,9 @@ const watch = require('gulp-watch'); const glob = require('fast-glob'); const locales = require('../../app/_locales/index.json'); +const { BuildType } = require('../lib/build-type'); const { createTask, composeSeries } = require('./task'); -const { BuildType } = require('./utils'); const EMPTY_JS_FILE = './development/empty.js'; diff --git a/development/build/transforms/remove-fenced-code.js b/development/build/transforms/remove-fenced-code.js index 71236e179..90d49972e 100644 --- a/development/build/transforms/remove-fenced-code.js +++ b/development/build/transforms/remove-fenced-code.js @@ -1,6 +1,6 @@ const path = require('path'); const { PassThrough, Transform } = require('stream'); -const { BuildType } = require('../utils'); +const { BuildType } = require('../../lib/build-type'); const { lintTransformedFile } = require('./utils'); const hasKey = (obj, key) => Reflect.hasOwnProperty.call(obj, key); diff --git a/development/build/transforms/remove-fenced-code.test.js b/development/build/transforms/remove-fenced-code.test.js index b3ff511e3..3be3e401a 100644 --- a/development/build/transforms/remove-fenced-code.test.js +++ b/development/build/transforms/remove-fenced-code.test.js @@ -1,5 +1,5 @@ const deepFreeze = require('deep-freeze-strict'); -const { BuildType } = require('../utils'); +const { BuildType } = require('../../lib/build-type'); const { createRemoveFencedCodeTransform, removeFencedCode, diff --git a/development/build/utils.js b/development/build/utils.js index be33bf374..bd427d6bb 100644 --- a/development/build/utils.js +++ b/development/build/utils.js @@ -1,16 +1,5 @@ const semver = require('semver'); -const { version } = require('../../package.json'); - -/** - * The distribution this build is intended for. - * - * This should be kept in-sync with the `BuildType` map in `shared/constants/app.js`. - */ -const BuildType = { - beta: 'beta', - flask: 'flask', - main: 'main', -}; +const { BuildType } = require('../lib/build-type'); /** * Map the current version to a format that is compatible with each browser. @@ -20,11 +9,12 @@ const BuildType = { * where the build version is a positive integer. * * @param {string[]} platforms - A list of browsers to generate versions for. + * @param {string} version - The current version. * @returns {Object} An object with the browser as the key and the browser-specific version object * as the value. For example, the version `9.6.0-beta.1` would return the object * `{ firefox: { version: '9.6.0.beta1' }, chrome: { version: '9.6.0.1', version_name: '9.6.0-beta.1' } }`. */ -function getBrowserVersionMap(platforms) { +function getBrowserVersionMap(platforms, version) { const major = semver.major(version); const minor = semver.minor(version); const patch = semver.patch(version); @@ -62,6 +52,5 @@ function getBrowserVersionMap(platforms) { } module.exports = { - BuildType, getBrowserVersionMap, }; diff --git a/development/lib/build-type.js b/development/lib/build-type.js new file mode 100644 index 000000000..531ed18e9 --- /dev/null +++ b/development/lib/build-type.js @@ -0,0 +1,12 @@ +/** + * The distribution this build is intended for. + * + * This should be kept in-sync with the `BuildType` map in `shared/constants/app.js`. + */ +const BuildType = { + beta: 'beta', + flask: 'flask', + main: 'main', +}; + +module.exports = { BuildType }; diff --git a/development/lib/get-version.js b/development/lib/get-version.js new file mode 100644 index 000000000..92119c352 --- /dev/null +++ b/development/lib/get-version.js @@ -0,0 +1,21 @@ +const { version: manifestVersion } = require('../../package.json'); +const { BuildType } = require('./build-type'); + +/** + * Get the current version of the MetaMask extension. The base manifest version + * is modified according to the build type and version. + * + * The build version is needed because certain build types (such as beta) may + * be released multiple times during the release process. + * + * @param {BuildType} buildType - The build type. + * @param {number} buildVersion - The build version. + * @returns {string} The MetaMask extension version. + */ +function getVersion(buildType, buildVersion) { + return buildType === BuildType.main + ? manifestVersion + : `${manifestVersion}-${buildType}.${buildVersion}`; +} + +module.exports = { getVersion }; From 3363cdcce1a183efa6ed0c2c28def3f956662120 Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Tue, 22 Mar 2022 21:27:48 -0700 Subject: [PATCH 17/18] Fix lavamoat policy --- lavamoat/browserify/beta/policy.json | 1 + lavamoat/browserify/flask/policy.json | 2 +- lavamoat/browserify/main/policy.json | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index c6335a398..ba9056f3e 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -735,6 +735,7 @@ "clearTimeout": true, "console.error": true, "console.log": true, + "console.warn": true, "setTimeout": true }, "packages": { diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 7e6d96da3..3757925a1 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -630,7 +630,6 @@ "@metamask/iframe-execution-environment-service": { "globals": { "clearTimeout": true, - "console.log": true, "document.body.appendChild": true, "document.createElement": true, "document.getElementById": true, @@ -754,6 +753,7 @@ "clearTimeout": true, "console.error": true, "console.log": true, + "console.warn": true, "setTimeout": true }, "packages": { diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index c6335a398..ba9056f3e 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -735,6 +735,7 @@ "clearTimeout": true, "console.error": true, "console.log": true, + "console.warn": true, "setTimeout": true }, "packages": { From 2201c87c98002d99f11f9ba0cd4070dd0fbca1c0 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Wed, 23 Mar 2022 19:39:56 -0700 Subject: [PATCH 18/18] Update changelog (#14144) --- CHANGELOG.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45d71761e..e0b258263 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.11.4] +### Added +- **[FLASK]** Snap removal confirmation ([#13619](https://github.com/MetaMask/metamask-extension/pull/13619)) + +### Changed +- **[FLASK]** Update MetaMask Flask + - This is the first release of [MetaMask Flask](https://metamask.io/flask) since the initial release on January 18. This release includes a significant number of fixes and DevX improvements. Flask will henceforth be released at a more frequent cadence, usually in close proximity to releases of the regular MetaMask Extension. + - For reference, [#13462](https://github.com/MetaMask/metamask-extension/pull/13462) used the feature branch that produced the original Flask release after some additional changes were made. +- **[FLASK]** Update Snaps packages to version `^0.10.6` ([#13901](https://github.com/MetaMask/metamask-extension/pull/13901), [#14041](https://github.com/MetaMask/metamask-extension/pull/14041), [#14070](https://github.com/MetaMask/metamask-extension/pull/14070)) + - Updates the following packages from `0.9.0` to `0.10.6`: + - `@metamask/iframe-execution-environment-service` + - `@metamask/rpc-methods` + - `@metamask/snap-controllers` + - Updates the targeted [`iframe-execution-environment`](https://github.com/MetaMask/iframe-execution-environment) version from `0.3.1` to `0.4.2`. + - These changes encompass a variety of fixes and devX improvements. See the [releases](https://github.com/MetaMask/snaps-skunkworks/releases) of the Snaps monorepo for details. + +### Fixed +- **[FLASK]** Various UI issues ([#13462](https://github.com/MetaMask/metamask-extension/pull/13462)) + - _Note:_ The original Flask release was cut from the feature branch of [#13462](https://github.com/MetaMask/metamask-extension/pull/13462) before it was merged. + - Fix Snaps permission request confirmation page title ([#13342](https://github.com/MetaMask/metamask-extension/pull/13342)) + - Fix Snaps custom confirmation `textarea` height ([#13572](https://github.com/MetaMask/metamask-extension/pull/13572)) + - Fix various styling issues ([#13577](https://github.com/MetaMask/metamask-extension/pull/13577)) +- **[FLASK]** Fix Snap key management install warning appearance ([#13844](https://github.com/MetaMask/metamask-extension/pull/13844)) + ## [10.11.3] ### Changed - Split secret recovery phrase input into one-field-per-word ([#14016](https://github.com/MetaMask/metamask-extension/pull/14016)) @@ -2783,7 +2807,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.11.3...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.11.4...HEAD +[10.11.4]: https://github.com/MetaMask/metamask-extension/compare/v10.11.3...v10.11.4 [10.11.3]: https://github.com/MetaMask/metamask-extension/compare/v10.11.2...v10.11.3 [10.11.2]: https://github.com/MetaMask/metamask-extension/compare/v10.11.1...v10.11.2 [10.11.1]: https://github.com/MetaMask/metamask-extension/compare/v10.11.0...v10.11.1