From b3be9ceffaf71c8d2b6499a766c9c69c250f6bd6 Mon Sep 17 00:00:00 2001 From: seaona Date: Wed, 2 Nov 2022 13:11:16 +0100 Subject: [PATCH 01/12] Run update-changelog script --- CHANGELOG.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 035fa837e..6734c137f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,93 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [10.22.0] +### Uncategorized +- Sync develop with master v10.21.1 ([#16351](https://github.com/MetaMask/metamask-extension/pull/16351)) +- Merge branch 'master' into develop +- Updating chromedriver to last stable version ([#16310](https://github.com/MetaMask/metamask-extension/pull/16310)) +- [LavaMoat] improve policy generation performance in dev workflow ([#16338](https://github.com/MetaMask/metamask-extension/pull/16338)) +- Fix "Learn more" link on Connected Account notification ([#16339](https://github.com/MetaMask/metamask-extension/pull/16339)) +- ci: temporarily downgrade ubuntu to 20.04 ([#16320](https://github.com/MetaMask/metamask-extension/pull/16320)) +- ensure that we default users with browser language code 'zh' to the supported 'zh_CN' language code ([#16329](https://github.com/MetaMask/metamask-extension/pull/16329)) +- remove unused zh locales directory in favor of zh_CN ([#16322](https://github.com/MetaMask/metamask-extension/pull/16322)) +- Sync v10.21.0 with develop ([#16309](https://github.com/MetaMask/metamask-extension/pull/16309)) +- Merge branch 'develop' into sync-master +- Remove 3box feature and delete ThreeBoxController ([#14571](https://github.com/MetaMask/metamask-extension/pull/14571)) +- [E2E] Restore tests ([#16298](https://github.com/MetaMask/metamask-extension/pull/16298)) +- Making permission and approval controller methods idempotent ([#15848](https://github.com/MetaMask/metamask-extension/pull/15848)) +- Merge remote-tracking branch 'origin/develop' into sync-master +- Exclude E2E tests for swaps until they are stabilised ([#16303](https://github.com/MetaMask/metamask-extension/pull/16303)) +- Add e2e tests for Swaps notifications ([#16202](https://github.com/MetaMask/metamask-extension/pull/16202)) +- E2e test fixtures ([#16061](https://github.com/MetaMask/metamask-extension/pull/16061)) +- Improve transaction confirmation page performance ([#16205](https://github.com/MetaMask/metamask-extension/pull/16205)) +- [MV3] Fix e2e `encrypt-decrypt` test for MV3 test build ([#16264](https://github.com/MetaMask/metamask-extension/pull/16264)) +- Fix e2e incremental-secuirty test for mv3 build ([#16265](https://github.com/MetaMask/metamask-extension/pull/16265)) +- [e2e] Fix Dapp interactions flaky test on chrome ([#16282](https://github.com/MetaMask/metamask-extension/pull/16282)) +- [FLASK] Allow snaps insights to show on regular EOA transactions ([#16093](https://github.com/MetaMask/metamask-extension/pull/16093)) +- TextFieldBase updates after design reveiw ([#16201](https://github.com/MetaMask/metamask-extension/pull/16201)) +- Adding `TextField` component ([#16105](https://github.com/MetaMask/metamask-extension/pull/16105)) +- Fix inputs that should allow decimals ([#16254](https://github.com/MetaMask/metamask-extension/pull/16254)) +- Chromedriver v106 ([#16213](https://github.com/MetaMask/metamask-extension/pull/16213)) +- [FLASK] Clear snap state on restore ([#16228](https://github.com/MetaMask/metamask-extension/pull/16228)) +- [FLASK] Fix flaky BIP-32 E2E test ([#16255](https://github.com/MetaMask/metamask-extension/pull/16255)) +- Continue converting tests from enzyme to @testing-library/react ([#16175](https://github.com/MetaMask/metamask-extension/pull/16175)) +- Fix/16207/text component storybook ([#16214](https://github.com/MetaMask/metamask-extension/pull/16214)) +- ci: fix stats-module-load-init step ([#16196](https://github.com/MetaMask/metamask-extension/pull/16196)) +- Sort add network list alphabetically ([#16089](https://github.com/MetaMask/metamask-extension/pull/16089)) +- [FLASK] Add E2E for `wallet_getSnaps` ([#16169](https://github.com/MetaMask/metamask-extension/pull/16169)) +- [FLASK] Create E2E Test for BIP-32 test-snap ([#16037](https://github.com/MetaMask/metamask-extension/pull/16037)) +- Feat/15089/add button link ([#16115](https://github.com/MetaMask/metamask-extension/pull/16115)) +- Keep imported tokens in the Assets list ([#16167](https://github.com/MetaMask/metamask-extension/pull/16167)) +- Update to text-field-base docs ([#16170](https://github.com/MetaMask/metamask-extension/pull/16170)) +- chore: add build stats history json file ([#16168](https://github.com/MetaMask/metamask-extension/pull/16168)) +- added AvatarFavicon component ([#16135](https://github.com/MetaMask/metamask-extension/pull/16135)) +- 16083: Fix deposit eth popover layout ([#16100](https://github.com/MetaMask/metamask-extension/pull/16100)) +- Added AvatarBadge component ([#15676](https://github.com/MetaMask/metamask-extension/pull/15676)) +- Added Tag Component ([#15947](https://github.com/MetaMask/metamask-extension/pull/15947)) +- Continue converting tests from enzyme to @testing-library/react ([#16032](https://github.com/MetaMask/metamask-extension/pull/16032)) +- Fix @keystonehq/bc-ur-registry patch ([#16155](https://github.com/MetaMask/metamask-extension/pull/16155)) +- Fixing forgot password action after wallet creation ([#16156](https://github.com/MetaMask/metamask-extension/pull/16156)) +- MV3 Segment Fix ([#16020](https://github.com/MetaMask/metamask-extension/pull/16020)) +- Show fiat conversion by default on custom networks ([#16132](https://github.com/MetaMask/metamask-extension/pull/16132)) +- Remove docs.google.com from blocked domains list ([#16154](https://github.com/MetaMask/metamask-extension/pull/16154)) +- Data from TokenListController gets cleared when the service worker restarts ([#16109](https://github.com/MetaMask/metamask-extension/pull/16109)) +- Update provider ([#16131](https://github.com/MetaMask/metamask-extension/pull/16131)) +- Persist state in metaRPCHandler so that we are sure state is persisted before sending back response to actions ([#15978](https://github.com/MetaMask/metamask-extension/pull/15978)) +- e2e test for gas API fallback ([#16137](https://github.com/MetaMask/metamask-extension/pull/16137)) +- add box height and width responsive sizes ([#16111](https://github.com/MetaMask/metamask-extension/pull/16111)) +- Update `eth-json-rpc-middleware` to v9.0.1 ([#16096](https://github.com/MetaMask/metamask-extension/pull/16096)) +- [MV3] Add e2e chrome test job for MV3 build ([#15991](https://github.com/MetaMask/metamask-extension/pull/15991)) +- add decrypt e2e ([#16122](https://github.com/MetaMask/metamask-extension/pull/16122)) +- [FLASK] Fix wrong action name for `wallet_getSnaps` hook ([#16125](https://github.com/MetaMask/metamask-extension/pull/16125)) +- Use current version of the phishing warning page ([#16123](https://github.com/MetaMask/metamask-extension/pull/16123)) +- added AvatarAccount component ([#15795](https://github.com/MetaMask/metamask-extension/pull/15795)) +- Feat/15951/add button secondary ([#16097](https://github.com/MetaMask/metamask-extension/pull/16097)) +- Fix intermittent storybook build failure ([#16124](https://github.com/MetaMask/metamask-extension/pull/16124)) +- Adding border radius full to `Box` component ([#16118](https://github.com/MetaMask/metamask-extension/pull/16118)) +- patch ethereumjs-util stripHexPrefix ([#16094](https://github.com/MetaMask/metamask-extension/pull/16094)) +- [FLASK] `snaps-skunkworks@0.22.0` ([#16069](https://github.com/MetaMask/metamask-extension/pull/16069)) +- Adding ast-types to resolutions ([#16103](https://github.com/MetaMask/metamask-extension/pull/16103)) +- Adding `TextFieldBase` component ([#16043](https://github.com/MetaMask/metamask-extension/pull/16043)) +- Created the NFT component for single NFT allowance ([#15825](https://github.com/MetaMask/metamask-extension/pull/15825)) +- Fixing Identicon import paths ([#16101](https://github.com/MetaMask/metamask-extension/pull/16101)) +- 15090: add primary button ([#16079](https://github.com/MetaMask/metamask-extension/pull/16079)) +- Review spending cap screen ([#15919](https://github.com/MetaMask/metamask-extension/pull/15919)) +- [FLASK] Fix transaction insight data display ([#16023](https://github.com/MetaMask/metamask-extension/pull/16023)) +- Removing use of window object from sentry code ([#16022](https://github.com/MetaMask/metamask-extension/pull/16022)) +- Lower coverage requirement ([#16087](https://github.com/MetaMask/metamask-extension/pull/16087)) +- Sign-in With Ethereum Design Update ([#16019](https://github.com/MetaMask/metamask-extension/pull/16019)) +- Renamed setApproveForAllArg variable to be isApprovalOrRejection ([#16012](https://github.com/MetaMask/metamask-extension/pull/16012)) +- forwarding refs to Box and Text component ([#16062](https://github.com/MetaMask/metamask-extension/pull/16062)) +- Replace setInterval with chrome alarms for MetaMetrics FinalizeEventFragment ([#16003](https://github.com/MetaMask/metamask-extension/pull/16003)) +- 15087: Add Button Base ([#15998](https://github.com/MetaMask/metamask-extension/pull/15998)) +- Add more unit / integration tests for Swaps ([#16040](https://github.com/MetaMask/metamask-extension/pull/16040)) +- Update Jest config to avoid transpiling dependencies ([#16068](https://github.com/MetaMask/metamask-extension/pull/16068)) +- ensure phishing-detection page preload works in MV3 ([#16029](https://github.com/MetaMask/metamask-extension/pull/16029)) +- Update eth-lattice-keyring to v0.12.3 ([#15997](https://github.com/MetaMask/metamask-extension/pull/15997)) +- Add Aurora to the popular custom network list ([#16039](https://github.com/MetaMask/metamask-extension/pull/16039)) +- Fixes display of avatr in flex display with elements of different heights ([#16047](https://github.com/MetaMask/metamask-extension/pull/16047)) +- Some icon fixes ([#16044](https://github.com/MetaMask/metamask-extension/pull/16044)) ## [10.21.1] ### Changed diff --git a/package.json b/package.json index 9560efab4..e294a75b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.21.1", + "version": "10.22.0", "private": true, "repository": { "type": "git", From 1e681f991859f816a9d5a44997dfda7504e38da3 Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Fri, 4 Nov 2022 23:17:53 +0530 Subject: [PATCH 02/12] Fix approve transaction call in _onBootCleanUp (#16382) --- app/scripts/controllers/transactions/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index c6cf3a061..cd4c8c1a0 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -1844,7 +1844,7 @@ export default class TransactionController extends EventEmitter { .forEach((txMeta) => { // Line below will try to publish transaction which is in // APPROVED state at the time of controller bootup - this.approveTransaction(txMeta); + this.approveTransaction(txMeta.id); }); } From 925253bc9fec3c6e9ea6da441db4548859eca054 Mon Sep 17 00:00:00 2001 From: seaona Date: Mon, 7 Nov 2022 12:19:15 +0100 Subject: [PATCH 03/12] Changelog updated --- CHANGELOG.md | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 035fa837e..450325476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [10.21.2] +### Fixed +- Fix undefined txParams when calling approveTransaction, by adding the id on the txMeta argument ([#16382](https://github.com/MetaMask/metamask-extension/pull/16382)) ## [10.21.1] ### Changed @@ -3253,7 +3256,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.21.1...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.21.2...HEAD +[10.21.2]: https://github.com/MetaMask/metamask-extension/compare/v10.21.1...v10.21.2 [10.21.1]: https://github.com/MetaMask/metamask-extension/compare/v10.21.0...v10.21.1 [10.21.0]: https://github.com/MetaMask/metamask-extension/compare/v10.20.0...v10.21.0 [10.20.0]: https://github.com/MetaMask/metamask-extension/compare/v10.19.0...v10.20.0 diff --git a/package.json b/package.json index dcc6805e3..058d84cd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.21.1", + "version": "10.21.2", "private": true, "repository": { "type": "git", From a970ac7901672227251392096373a189986f2c61 Mon Sep 17 00:00:00 2001 From: seaona Date: Mon, 7 Nov 2022 12:38:47 +0100 Subject: [PATCH 04/12] Fix lint --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 450325476..f24a4c728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + ## [10.21.2] ### Fixed - Fix undefined txParams when calling approveTransaction, by adding the id on the txMeta argument ([#16382](https://github.com/MetaMask/metamask-extension/pull/16382)) From ad5793bda9c22d7fbd2427f69662f1b974ff949f Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Tue, 8 Nov 2022 10:54:43 +0100 Subject: [PATCH 05/12] Sync master and update changelog --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6734c137f..e64ca1f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,6 +93,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixes display of avatr in flex display with elements of different heights ([#16047](https://github.com/MetaMask/metamask-extension/pull/16047)) - Some icon fixes ([#16044](https://github.com/MetaMask/metamask-extension/pull/16044)) +## [10.21.2] +### Fixed +- Fix undefined txParams when calling approveTransaction, by adding the id on the txMeta argument ([#16382](https://github.com/MetaMask/metamask-extension/pull/16382)) + ## [10.21.1] ### Changed - Improve rate limiting for metric events ([#16308](https://github.com/MetaMask/metamask-extension/pull/16308)) @@ -3340,7 +3344,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.21.1...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.22.0...HEAD +[10.22.0]: https://github.com/MetaMask/metamask-extension/compare/v10.21.2...v10.22.0 +[10.21.2]: https://github.com/MetaMask/metamask-extension/compare/v10.21.1...v10.21.2 [10.21.1]: https://github.com/MetaMask/metamask-extension/compare/v10.21.0...v10.21.1 [10.21.0]: https://github.com/MetaMask/metamask-extension/compare/v10.20.0...v10.21.0 [10.20.0]: https://github.com/MetaMask/metamask-extension/compare/v10.19.0...v10.20.0 From 18f11fc0bc499a529dd616c3daabd715c21559f4 Mon Sep 17 00:00:00 2001 From: Nicholas Ellul Date: Fri, 4 Nov 2022 09:26:51 -0400 Subject: [PATCH 06/12] Fix the rendering of certain domain names in connected-sites list (#16074) * Fix rendering origins in connected-sites list --- CHANGELOG.md | 2 ++ test/e2e/tests/dapp-interactions.spec.js | 4 ++-- .../signature-request-original.test.js.snap | 6 +++-- ui/components/ui/site-origin/site-origin.js | 2 +- .../ui/site-origin/site-origin.test.js | 24 +++++++++++++++++++ 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 ui/components/ui/site-origin/site-origin.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e64ca1f1b..37728f11b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [10.21.2] ### Fixed - Fix undefined txParams when calling approveTransaction, by adding the id on the txMeta argument ([#16382](https://github.com/MetaMask/metamask-extension/pull/16382)) +### Fixed +- Fix issue where domain names were not always beign rendered correctly in the connected sites list ([#16074](https://github.com/MetaMask/metamask-extension/pull/16074)) ## [10.21.1] ### Changed diff --git a/test/e2e/tests/dapp-interactions.spec.js b/test/e2e/tests/dapp-interactions.spec.js index de62b9449..652f28c1e 100644 --- a/test/e2e/tests/dapp-interactions.spec.js +++ b/test/e2e/tests/dapp-interactions.spec.js @@ -112,11 +112,11 @@ describe('Dapp interactions', function () { await driver.clickElement({ text: 'Connected sites', tag: 'span' }); const connectedDapp1 = await driver.isElementPresent({ text: 'http://127.0.0.1:8080', - tag: 'span', + tag: 'bdi', }); const connectedDapp2 = await driver.isElementPresent({ text: 'http://127.0.0.1:8081', - tag: 'span', + tag: 'bdi', }); assert.ok(connectedDapp1, 'Account not connected to Dapp1'); diff --git a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap index 9b00c9dc9..d1ed1310f 100644 --- a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap +++ b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap @@ -135,9 +135,11 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = `
- + https://happydapp.website/governance?futarchy=true - +
) : ( - {siteOrigin} + {siteOrigin} )}
); diff --git a/ui/components/ui/site-origin/site-origin.test.js b/ui/components/ui/site-origin/site-origin.test.js new file mode 100644 index 000000000..d27f1ce73 --- /dev/null +++ b/ui/components/ui/site-origin/site-origin.test.js @@ -0,0 +1,24 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import SiteOrigin from './site-origin'; + +describe('SiteOrigin', () => { + const defaultProps = { + siteOrigin: 'https://example.com', + iconSrc: 'https://example.com/icon.png', + iconName: 'icon', + chip: false, + className: '', + rightIcon: false, + }; + + it('renders number and hyphen prefixed domains correctly', () => { + const numberHyphenPrefixOrigin = '0-example.com'; + const wrapper = shallow( + , + ); + const bdiElement = wrapper.find('bdi'); + + expect(bdiElement.text()).toBe('0-example.com'); + }); +}); From 15c75306019be35fa187721734a4eb0f40460c97 Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:00:45 +0100 Subject: [PATCH 07/12] Changelog for 10.22.0 (#16436) * Changelog for 10.22.0 * Update CHANGELOG.md Fix crash after restoring MetaMask if you had snaps installed Co-authored-by: Frederik Bolding * Update CHANGELOG.md Fix a problem with displaying snaps transaction insight data Co-authored-by: Frederik Bolding * Update CHANGELOG.md Improve transaction confirmation page performance Co-authored-by: Frederik Bolding Co-authored-by: Frederik Bolding --- CHANGELOG.md | 113 +++++++++++++-------------------------------------- 1 file changed, 28 insertions(+), 85 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37728f11b..62ed4149e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,98 +5,41 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + ## [10.22.0] -### Uncategorized -- Sync develop with master v10.21.1 ([#16351](https://github.com/MetaMask/metamask-extension/pull/16351)) -- Merge branch 'master' into develop -- Updating chromedriver to last stable version ([#16310](https://github.com/MetaMask/metamask-extension/pull/16310)) -- [LavaMoat] improve policy generation performance in dev workflow ([#16338](https://github.com/MetaMask/metamask-extension/pull/16338)) +### Added +- Add Aurora network to the Popular Custom Network list ([#16039](https://github.com/MetaMask/metamask-extension/pull/16039)) +- Add array of valid sizes for Box `height` and `width` to support responsive layout ([#16111](https://github.com/MetaMask/metamask-extension/pull/16111)) +- [FLASK] Allow snaps insights to show on regular EOA transactions ([#16093](https://github.com/MetaMask/metamask-extension/pull/16093)) + +### Changed +- Update `eth-lattice-keyring` to `v0.12.3` ([#15997](https://github.com/MetaMask/metamask-extension/pull/15997)) + - Updates `@ethereumjs/util` to `v8.0.0` to reduce bundle size + - Removes `secp256k1` and `@ethereumjs/common` to reduce bundle size + - Updates `gridplus-sdk` to v2.2.9 + - Adds caching for calls to block explorers to improve UX ([PR](https://github.com/GridPlus/gridplus-sdk/pull/469)) +- Remove unused `zh` locales directory in favor of `zh_CN` for Chinese translations ([#16322](https://github.com/MetaMask/metamask-extension/pull/16322)) +- Remove 3box sync feature and delete the `ThreeBoxController` ([#14571](https://github.com/MetaMask/metamask-extension/pull/14571)) + +### Fixed +- Fix Secret Recovery Phrase video overlapping lateral box for smaller viewports ([#16345](https://github.com/MetaMask/metamask-extension/pull/16345)) - Fix "Learn more" link on Connected Account notification ([#16339](https://github.com/MetaMask/metamask-extension/pull/16339)) -- ci: temporarily downgrade ubuntu to 20.04 ([#16320](https://github.com/MetaMask/metamask-extension/pull/16320)) -- ensure that we default users with browser language code 'zh' to the supported 'zh_CN' language code ([#16329](https://github.com/MetaMask/metamask-extension/pull/16329)) -- remove unused zh locales directory in favor of zh_CN ([#16322](https://github.com/MetaMask/metamask-extension/pull/16322)) -- Sync v10.21.0 with develop ([#16309](https://github.com/MetaMask/metamask-extension/pull/16309)) -- Merge branch 'develop' into sync-master -- Remove 3box feature and delete ThreeBoxController ([#14571](https://github.com/MetaMask/metamask-extension/pull/14571)) -- [E2E] Restore tests ([#16298](https://github.com/MetaMask/metamask-extension/pull/16298)) -- Making permission and approval controller methods idempotent ([#15848](https://github.com/MetaMask/metamask-extension/pull/15848)) -- Merge remote-tracking branch 'origin/develop' into sync-master -- Exclude E2E tests for swaps until they are stabilised ([#16303](https://github.com/MetaMask/metamask-extension/pull/16303)) -- Add e2e tests for Swaps notifications ([#16202](https://github.com/MetaMask/metamask-extension/pull/16202)) -- E2e test fixtures ([#16061](https://github.com/MetaMask/metamask-extension/pull/16061)) +- Fix default users with browser language code `zh` to point the supported `zh_CN` language code ([#16329](https://github.com/MetaMask/metamask-extension/pull/16329)) +- Fix Forgot Password flow after Wallet Creation ([#16156](https://github.com/MetaMask/metamask-extension/pull/16156)) +- Fix fiat conversion for Popular Custom networks displaying it by default ([#16132](https://github.com/MetaMask/metamask-extension/pull/16132)) +- Fix restricted injection, by removing docs.google.com from blocked domains list ([#16154](https://github.com/MetaMask/metamask-extension/pull/16154)) +- Fix squeezing avatar, by adding a flex property to keep always the same ratio ([#16047](https://github.com/MetaMask/metamask-extension/pull/16047)) +- Swaps: fix tokens being removed from the Asset lists, after canceling a Swap ([#16167](https://github.com/MetaMask/metamask-extension/pull/16167)) +- Swaps: add debouncing for the `Swap from` and `Swap to` form fields ([#16326](https://github.com/MetaMask/metamask-extension/pull/16326)) +- [FLASK] Fix crash on snaps settings page if snap has no permissions ([#16354](https://github.com/MetaMask/metamask-extension/pull/16354)) - Improve transaction confirmation page performance ([#16205](https://github.com/MetaMask/metamask-extension/pull/16205)) -- [MV3] Fix e2e `encrypt-decrypt` test for MV3 test build ([#16264](https://github.com/MetaMask/metamask-extension/pull/16264)) -- Fix e2e incremental-secuirty test for mv3 build ([#16265](https://github.com/MetaMask/metamask-extension/pull/16265)) -- [e2e] Fix Dapp interactions flaky test on chrome ([#16282](https://github.com/MetaMask/metamask-extension/pull/16282)) -- [FLASK] Allow snaps insights to show on regular EOA transactions ([#16093](https://github.com/MetaMask/metamask-extension/pull/16093)) -- TextFieldBase updates after design reveiw ([#16201](https://github.com/MetaMask/metamask-extension/pull/16201)) -- Adding `TextField` component ([#16105](https://github.com/MetaMask/metamask-extension/pull/16105)) -- Fix inputs that should allow decimals ([#16254](https://github.com/MetaMask/metamask-extension/pull/16254)) -- Chromedriver v106 ([#16213](https://github.com/MetaMask/metamask-extension/pull/16213)) -- [FLASK] Clear snap state on restore ([#16228](https://github.com/MetaMask/metamask-extension/pull/16228)) -- [FLASK] Fix flaky BIP-32 E2E test ([#16255](https://github.com/MetaMask/metamask-extension/pull/16255)) -- Continue converting tests from enzyme to @testing-library/react ([#16175](https://github.com/MetaMask/metamask-extension/pull/16175)) -- Fix/16207/text component storybook ([#16214](https://github.com/MetaMask/metamask-extension/pull/16214)) -- ci: fix stats-module-load-init step ([#16196](https://github.com/MetaMask/metamask-extension/pull/16196)) -- Sort add network list alphabetically ([#16089](https://github.com/MetaMask/metamask-extension/pull/16089)) -- [FLASK] Add E2E for `wallet_getSnaps` ([#16169](https://github.com/MetaMask/metamask-extension/pull/16169)) -- [FLASK] Create E2E Test for BIP-32 test-snap ([#16037](https://github.com/MetaMask/metamask-extension/pull/16037)) -- Feat/15089/add button link ([#16115](https://github.com/MetaMask/metamask-extension/pull/16115)) -- Keep imported tokens in the Assets list ([#16167](https://github.com/MetaMask/metamask-extension/pull/16167)) -- Update to text-field-base docs ([#16170](https://github.com/MetaMask/metamask-extension/pull/16170)) -- chore: add build stats history json file ([#16168](https://github.com/MetaMask/metamask-extension/pull/16168)) -- added AvatarFavicon component ([#16135](https://github.com/MetaMask/metamask-extension/pull/16135)) -- 16083: Fix deposit eth popover layout ([#16100](https://github.com/MetaMask/metamask-extension/pull/16100)) -- Added AvatarBadge component ([#15676](https://github.com/MetaMask/metamask-extension/pull/15676)) -- Added Tag Component ([#15947](https://github.com/MetaMask/metamask-extension/pull/15947)) -- Continue converting tests from enzyme to @testing-library/react ([#16032](https://github.com/MetaMask/metamask-extension/pull/16032)) -- Fix @keystonehq/bc-ur-registry patch ([#16155](https://github.com/MetaMask/metamask-extension/pull/16155)) -- Fixing forgot password action after wallet creation ([#16156](https://github.com/MetaMask/metamask-extension/pull/16156)) -- MV3 Segment Fix ([#16020](https://github.com/MetaMask/metamask-extension/pull/16020)) -- Show fiat conversion by default on custom networks ([#16132](https://github.com/MetaMask/metamask-extension/pull/16132)) -- Remove docs.google.com from blocked domains list ([#16154](https://github.com/MetaMask/metamask-extension/pull/16154)) -- Data from TokenListController gets cleared when the service worker restarts ([#16109](https://github.com/MetaMask/metamask-extension/pull/16109)) -- Update provider ([#16131](https://github.com/MetaMask/metamask-extension/pull/16131)) -- Persist state in metaRPCHandler so that we are sure state is persisted before sending back response to actions ([#15978](https://github.com/MetaMask/metamask-extension/pull/15978)) -- e2e test for gas API fallback ([#16137](https://github.com/MetaMask/metamask-extension/pull/16137)) -- add box height and width responsive sizes ([#16111](https://github.com/MetaMask/metamask-extension/pull/16111)) -- Update `eth-json-rpc-middleware` to v9.0.1 ([#16096](https://github.com/MetaMask/metamask-extension/pull/16096)) -- [MV3] Add e2e chrome test job for MV3 build ([#15991](https://github.com/MetaMask/metamask-extension/pull/15991)) -- add decrypt e2e ([#16122](https://github.com/MetaMask/metamask-extension/pull/16122)) -- [FLASK] Fix wrong action name for `wallet_getSnaps` hook ([#16125](https://github.com/MetaMask/metamask-extension/pull/16125)) -- Use current version of the phishing warning page ([#16123](https://github.com/MetaMask/metamask-extension/pull/16123)) -- added AvatarAccount component ([#15795](https://github.com/MetaMask/metamask-extension/pull/15795)) -- Feat/15951/add button secondary ([#16097](https://github.com/MetaMask/metamask-extension/pull/16097)) -- Fix intermittent storybook build failure ([#16124](https://github.com/MetaMask/metamask-extension/pull/16124)) -- Adding border radius full to `Box` component ([#16118](https://github.com/MetaMask/metamask-extension/pull/16118)) -- patch ethereumjs-util stripHexPrefix ([#16094](https://github.com/MetaMask/metamask-extension/pull/16094)) -- [FLASK] `snaps-skunkworks@0.22.0` ([#16069](https://github.com/MetaMask/metamask-extension/pull/16069)) -- Adding ast-types to resolutions ([#16103](https://github.com/MetaMask/metamask-extension/pull/16103)) -- Adding `TextFieldBase` component ([#16043](https://github.com/MetaMask/metamask-extension/pull/16043)) -- Created the NFT component for single NFT allowance ([#15825](https://github.com/MetaMask/metamask-extension/pull/15825)) -- Fixing Identicon import paths ([#16101](https://github.com/MetaMask/metamask-extension/pull/16101)) -- 15090: add primary button ([#16079](https://github.com/MetaMask/metamask-extension/pull/16079)) -- Review spending cap screen ([#15919](https://github.com/MetaMask/metamask-extension/pull/15919)) -- [FLASK] Fix transaction insight data display ([#16023](https://github.com/MetaMask/metamask-extension/pull/16023)) -- Removing use of window object from sentry code ([#16022](https://github.com/MetaMask/metamask-extension/pull/16022)) -- Lower coverage requirement ([#16087](https://github.com/MetaMask/metamask-extension/pull/16087)) -- Sign-in With Ethereum Design Update ([#16019](https://github.com/MetaMask/metamask-extension/pull/16019)) -- Renamed setApproveForAllArg variable to be isApprovalOrRejection ([#16012](https://github.com/MetaMask/metamask-extension/pull/16012)) -- forwarding refs to Box and Text component ([#16062](https://github.com/MetaMask/metamask-extension/pull/16062)) -- Replace setInterval with chrome alarms for MetaMetrics FinalizeEventFragment ([#16003](https://github.com/MetaMask/metamask-extension/pull/16003)) -- 15087: Add Button Base ([#15998](https://github.com/MetaMask/metamask-extension/pull/15998)) -- Add more unit / integration tests for Swaps ([#16040](https://github.com/MetaMask/metamask-extension/pull/16040)) -- Update Jest config to avoid transpiling dependencies ([#16068](https://github.com/MetaMask/metamask-extension/pull/16068)) -- ensure phishing-detection page preload works in MV3 ([#16029](https://github.com/MetaMask/metamask-extension/pull/16029)) -- Update eth-lattice-keyring to v0.12.3 ([#15997](https://github.com/MetaMask/metamask-extension/pull/15997)) -- Add Aurora to the popular custom network list ([#16039](https://github.com/MetaMask/metamask-extension/pull/16039)) -- Fixes display of avatr in flex display with elements of different heights ([#16047](https://github.com/MetaMask/metamask-extension/pull/16047)) -- Some icon fixes ([#16044](https://github.com/MetaMask/metamask-extension/pull/16044)) +- [FLASK] Fix crash after restoring MetaMask if you had snaps installed ([#16228](https://github.com/MetaMask/metamask-extension/pull/16228)) +- [FLASK] Fix a problem with displaying snaps transaction insight data ([#16023](https://github.com/MetaMask/metamask-extension/pull/16023)) + ## [10.21.2] ### Fixed - Fix undefined txParams when calling approveTransaction, by adding the id on the txMeta argument ([#16382](https://github.com/MetaMask/metamask-extension/pull/16382)) -### Fixed - Fix issue where domain names were not always beign rendered correctly in the connected sites list ([#16074](https://github.com/MetaMask/metamask-extension/pull/16074)) ## [10.21.1] From 1db38adf4c61107cf65b8de61ba2964d6f127080 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Thu, 10 Nov 2022 09:58:27 -0330 Subject: [PATCH 08/12] Call onbootcleanup at the end of the tx controller constructor (#16449) * Call onbootcleanup at the end of the tx controller constructor * Update app/scripts/controllers/transactions/index.js Co-authored-by: Frederik Bolding Co-authored-by: Frederik Bolding --- app/scripts/controllers/transactions/index.js | 2 +- test/e2e/fixture-builder.js | 111 ++++++++++++++++++ .../tests/stuck-approved-transaction.spec.js | 47 ++++++++ 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 test/e2e/tests/stuck-approved-transaction.spec.js diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index cd4c8c1a0..5becce48b 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -161,7 +161,6 @@ export default class TransactionController extends EventEmitter { getNetwork: this.getNetwork.bind(this), getCurrentChainId: opts.getCurrentChainId, }); - this._onBootCleanUp(); this.store = this.txStateManager.store; this.nonceTracker = new NonceTracker({ @@ -208,6 +207,7 @@ export default class TransactionController extends EventEmitter { // request state update to finalize initialization this._updatePendingTxsAfterFirstBlock(); + this._onBootCleanUp(); } /** diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 117962866..0eca41d41 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -981,6 +981,117 @@ class FixtureBuilder { }); } + withTransactionControllerApprovedTransaction() { + return this.withTransactionController({ + transactions: { + 4046084157914634: { + chainId: '0x539', + history: [ + { + chainId: '0x539', + id: 4046084157914634, + loadingDefaults: true, + metamaskNetworkId: '1337', + origin: 'metamask', + status: 'unapproved', + time: 1617228030067, + txParams: { + from: '0x5cfe73b6021e818b776b421b1c4db2474086a7e1', + gas: '0x61a8', + maxFeePerGas: '0x59682f0c', + maxPriorityFeePerGas: '0x59682f00', + to: '0x2f318C334780961FB129D2a6c30D0763d9a5C970', + type: '0x2', + value: '0xde0b6b3a7640000', + }, + type: 'simpleSend', + }, + [ + { + note: 'Added new unapproved transaction.', + op: 'replace', + path: '/loadingDefaults', + timestamp: 1617228030069, + value: false, + }, + ], + [ + { + op: 'add', + path: '/txParams/nonce', + value: '0x0', + note: 'transactions#approveTransaction', + timestamp: 1617228031069, + }, + { + op: 'add', + path: '/nonceDetails', + value: { + params: { + highestLocallyConfirmed: 0, + highestSuggested: 0, + nextNetworkNonce: 0, + }, + local: { + name: 'local', + nonce: 0, + details: { + startPoint: 0, + highest: 0, + }, + }, + network: { + name: 'network', + nonce: 0, + details: { + blockNumber: '0x0', + baseCount: 0, + }, + }, + }, + }, + ], + ], + id: 4046084157914634, + loadingDefaults: false, + metamaskNetworkId: '1337', + origin: 'metamask', + primaryTransaction: { + chainId: '0x539', + id: 4046084157914634, + loadingDefaults: true, + metamaskNetworkId: '1337', + origin: 'metamask', + status: 'approved', + time: 1617228030067, + txParams: { + from: '0x5cfe73b6021e818b776b421b1c4db2474086a7e1', + gas: '0x61a8', + maxFeePerGas: '0x59682f0c', + maxPriorityFeePerGas: '0x59682f00', + to: '0x2f318C334780961FB129D2a6c30D0763d9a5C970', + type: '0x2', + value: '0xde0b6b3a7640000', + }, + type: 'sentEther', + }, + status: 'approved', + time: 1617228030067, + txParams: { + from: '0x5cfe73b6021e818b776b421b1c4db2474086a7e1', + gas: '0x61a8', + maxFeePerGas: '0x59682f0c', + maxPriorityFeePerGas: '0x59682f00', + to: '0x2f318C334780961FB129D2a6c30D0763d9a5C970', + type: '0x2', + value: '0xde0b6b3a7640000', + }, + type: 'simpleSend', + }, + }, + }); + } + build() { this.fixture.meta = { version: 74, diff --git a/test/e2e/tests/stuck-approved-transaction.spec.js b/test/e2e/tests/stuck-approved-transaction.spec.js new file mode 100644 index 000000000..daf73265d --- /dev/null +++ b/test/e2e/tests/stuck-approved-transaction.spec.js @@ -0,0 +1,47 @@ +const { strict: assert } = require('assert'); +const { convertToHexValue, withFixtures } = require('../helpers'); +const FixtureBuilder = require('../fixture-builder'); + +describe('Editing Confirm Transaction', function () { + it('approves a transaction stuck in approved state on boot', async function () { + const ganacheOptions = { + hardfork: 'london', + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + await withFixtures( + { + fixtures: new FixtureBuilder() + .withTransactionControllerApprovedTransaction() + .build(), + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.clickElement('[data-testid="home__activity-tab"]'); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .transaction-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); + + const txValues = await driver.findElements( + '.transaction-list-item__primary-currency', + ); + assert.equal(txValues.length, 1); + assert.ok(/-1\s*ETH/u.test(await txValues[0].getText())); + }, + ); + }); +}); From 568683d1c5d09db02d9d97ccf50c4057a4d4e88e Mon Sep 17 00:00:00 2001 From: Adnan Sahovic <63151811+adnansahovic@users.noreply.github.com> Date: Wed, 9 Nov 2022 16:36:21 +0100 Subject: [PATCH 09/12] Warning on a Send transaction request (#16220) --- ...onfirm-page-container-content.component.js | 34 +++++++----- .../confirm-page-container.component.js | 16 ++++-- .../confirm-page-container.container.js | 12 +---- .../confirm-transaction-base.component.js | 3 -- .../confirm-transaction-base.container.js | 1 - .../transaction-alerts/transaction-alerts.js | 54 +------------------ .../transaction-alerts.test.js | 24 --------- 7 files changed, 35 insertions(+), 109 deletions(-) diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js index b7cd74218..98b0f91ab 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js @@ -9,7 +9,7 @@ import ErrorMessage from '../../../ui/error-message'; import { INSUFFICIENT_FUNDS_ERROR_KEY } from '../../../../helpers/constants/error-keys'; import Typography from '../../../ui/typography'; import { TYPOGRAPHY } from '../../../../helpers/constants/design-system'; -import { TRANSACTION_TYPES } from '../../../../../shared/constants/transaction'; +import DepositPopover from '../../deposit-popover/deposit-popover'; import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'; @@ -50,15 +50,17 @@ export default class ConfirmPageContainerContent extends Component { hideTitle: PropTypes.bool, supportsEIP1559V2: PropTypes.bool, hasTopBorder: PropTypes.bool, - currentTransaction: PropTypes.object, nativeCurrency: PropTypes.string, networkName: PropTypes.string, - showBuyModal: PropTypes.func, toAddress: PropTypes.string, transactionType: PropTypes.string, isBuyableChain: PropTypes.bool, }; + state = { + setShowDepositPopover: false, + }; + renderContent() { const { detailsComponent, dataComponent } = this.props; @@ -153,10 +155,8 @@ export default class ConfirmPageContainerContent extends Component { hideTitle, supportsEIP1559V2, hasTopBorder, - currentTransaction, nativeCurrency, networkName, - showBuyModal, toAddress, transactionType, isBuyableChain, @@ -169,6 +169,8 @@ export default class ConfirmPageContainerContent extends Component { (errorKey || errorMessage) && errorKey === INSUFFICIENT_FUNDS_ERROR_KEY; + const { setShowDepositPopover } = this.state; + return (
{this.renderContent()} - {!supportsEIP1559V2 && - (errorKey || errorMessage) && - currentTransaction.type !== TRANSACTION_TYPES.SIMPLE_SEND && ( -
- -
- )} + {!supportsEIP1559V2 && (errorKey || errorMessage) && ( +
+ +
+ )} {showInsuffienctFundsError && (
+ this.setState({ setShowDepositPopover: true }) + } key={`${nativeCurrency}-buy-button`} > {t('buyAsset', [nativeCurrency])} @@ -241,7 +243,11 @@ export default class ConfirmPageContainerContent extends Component { />
)} - + {setShowDepositPopover && ( + this.setState({ setShowDepositPopover: false })} + /> + )} + this.setState({ setShowDepositPopover: true }) + } key={`${nativeCurrency}-buy-button`} > {t('buyAsset', [nativeCurrency])} @@ -335,6 +338,11 @@ export default class ConfirmPageContainer extends Component { />
)} + {setShowDepositPopover && ( + this.setState({ setShowDepositPopover: false })} + /> + )} {shouldDisplayWarning && errorKey !== INSUFFICIENT_FUNDS_ERROR_KEY && (
diff --git a/ui/components/app/confirm-page-container/confirm-page-container.container.js b/ui/components/app/confirm-page-container/confirm-page-container.container.js index 567192cb1..265ca7ea3 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container.container.js +++ b/ui/components/app/confirm-page-container/confirm-page-container.container.js @@ -6,7 +6,6 @@ import { getNetworkIdentifier, getSwapsDefaultToken, } from '../../../selectors'; -import { showModal } from '../../../store/actions'; import ConfirmPageContainer from './confirm-page-container.component'; function mapStateToProps(state, ownProps) { @@ -30,13 +29,4 @@ function mapStateToProps(state, ownProps) { }; } -const mapDispatchToProps = (dispatch) => { - return { - showBuyModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER' })), - }; -}; - -export default connect( - mapStateToProps, - mapDispatchToProps, -)(ConfirmPageContainer); +export default connect(mapStateToProps)(ConfirmPageContainer); diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js index 9672fce6d..01b6070ec 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -159,7 +159,6 @@ export default class ConfirmTransactionBase extends Component { hardwareWalletRequiresConnection: PropTypes.bool, isMultiLayerFeeNetwork: PropTypes.bool, eip1559V2Enabled: PropTypes.bool, - showBuyModal: PropTypes.func, isBuyableChain: PropTypes.bool, isApprovalOrRejection: PropTypes.bool, ///: BEGIN:ONLY_INCLUDE_IN(flask) @@ -353,7 +352,6 @@ export default class ConfirmTransactionBase extends Component { supportsEIP1559, isMultiLayerFeeNetwork, nativeCurrency, - showBuyModal, isBuyableChain, } = this.props; const { t } = this.context; @@ -614,7 +612,6 @@ export default class ConfirmTransactionBase extends Component { userAcknowledgedGasMissing={userAcknowledgedGasMissing} nativeCurrency={nativeCurrency} networkName={networkName} - showBuyModal={showBuyModal} type={txData.type} isBuyableChain={isBuyableChain} /> diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js index cecc4af26..fc5ad7ce1 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -281,7 +281,6 @@ export const mapDispatchToProps = (dispatch) => { updateTransactionGasFees: (gasFees) => { dispatch(updateGasFees({ ...gasFees, expectHexWei: true })); }, - showBuyModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER' })), }; }; diff --git a/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js b/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js index abd1868be..def97fca4 100644 --- a/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js +++ b/ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js @@ -7,28 +7,16 @@ import { submittedPendingTransactionsSelector } from '../../../selectors/transac import { useGasFeeContext } from '../../../contexts/gasFee'; import { useI18nContext } from '../../../hooks/useI18nContext'; import ActionableMessage from '../../../components/ui/actionable-message/actionable-message'; -import Button from '../../../components/ui/button'; import Typography from '../../../components/ui/typography'; import { TYPOGRAPHY } from '../../../helpers/constants/design-system'; -import { TRANSACTION_TYPES } from '../../../../shared/constants/transaction'; import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; const TransactionAlerts = ({ userAcknowledgedGasMissing, setUserAcknowledgedGasMissing, - isBuyableChain, - nativeCurrency, - networkName, - showBuyModal, - type, }) => { - const { - balanceError, - estimateUsed, - hasSimulationError, - supportsEIP1559V2, - isNetworkBusy, - } = useGasFeeContext(); + const { estimateUsed, hasSimulationError, supportsEIP1559V2, isNetworkBusy } = + useGasFeeContext(); const pendingTransactions = useSelector(submittedPendingTransactionsSelector); const t = useI18nContext(); @@ -89,39 +77,6 @@ const TransactionAlerts = ({ type="warning" /> )} - {balanceError && type === TRANSACTION_TYPES.DEPLOY_CONTRACT ? ( - - {t('insufficientCurrencyBuyOrDeposit', [ - nativeCurrency, - networkName, - , - ])} - - ) : ( - - {t('insufficientCurrencyDeposit', [ - nativeCurrency, - networkName, - ])} - - ) - } - useIcon - iconFillColor="var(--color-error-default)" - type="danger" - /> - ) : null} {estimateUsed === PRIORITY_LEVELS.LOW && ( { }); }); - describe('if balanceError from useGasFeeContext is true', () => { - it('informs the user that they have insufficient funds', () => { - const { getByText } = render({ - useGasFeeContextValue: { - supportsEIP1559V2: true, - balanceError: true, - }, - componentProps: { - nativeCurrency: 'ETH', - networkName: 'Goerli', - showBuyModal: jest.fn(), - chainId: '0x5', - type: TRANSACTION_TYPES.DEPLOY_CONTRACT, - }, - }); - expect( - getByText( - /You do not have enough ETH in your account to pay for transaction fees on Goerli network./u, - ), - ).toBeInTheDocument(); - }); - }); - describe('if balanceError from useGasFeeContext is falsy', () => { it('does not inform the user that they have insufficient funds', () => { const { queryByText } = render({ From de0f1ec51b10596dfcd9fb3828748518b3f80af4 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 9 Nov 2022 16:15:44 -0600 Subject: [PATCH 10/12] BETA - Update verbiage for success messages after onboarding (#16343) --- app/_locales/en/messages.json | 9 +++++++++ ui/helpers/constants/settings.js | 7 +++++++ ui/helpers/utils/settings-search.test.js | 2 +- .../creation-successful/creation-successful.js | 9 +++++++-- ui/pages/settings/info-tab/index.scss | 4 ++++ ui/pages/settings/info-tab/info-tab.component.js | 16 ++++++++++++++++ 6 files changed, 44 insertions(+), 3 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index e785cd4fd..71eaf9cd9 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -453,6 +453,15 @@ "betaPortfolioSite": { "message": "beta portfolio site" }, + "betaTerms": { + "message": "BETA Terms of use" + }, + "betaWalletCreationSuccessReminder1": { + "message": "MetaMask BETA can’t recover your Secret Recovery Phrase." + }, + "betaWalletCreationSuccessReminder2": { + "message": "MetaMask BETA will never ask you for your Secret Recovery Phrase." + }, "betaWelcome": { "message": "Welcome to MetaMask Beta" }, diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index e52ae39b5..dc674e29c 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -285,6 +285,13 @@ export const SETTINGS_CONSTANTS = [ route: `${ABOUT_US_ROUTE}#contactus`, icon: 'fa fa-info-circle', }, + { + tabMessage: (t) => t('about'), + sectionMessage: (t) => t('betaTerms'), + descriptionMessage: (t) => t('betaTerms'), + route: `${ABOUT_US_ROUTE}#beta-terms`, + icon: 'fa fa-info-circle', + }, { tabMessage: (t) => t('experimental'), sectionMessage: (t) => t('enableEIP1559V2'), diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index 714f21218..f545afe28 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -187,7 +187,7 @@ describe('Settings Search Utils', () => { }); it('should get good about section number', () => { - expect(getNumberOfSettingsInSection(t, t('about'))).toStrictEqual(8); + expect(getNumberOfSettingsInSection(t, t('about'))).toStrictEqual(9); }); }); diff --git a/ui/pages/onboarding-flow/creation-successful/creation-successful.js b/ui/pages/onboarding-flow/creation-successful/creation-successful.js index fbf5e4c97..356fd89b5 100644 --- a/ui/pages/onboarding-flow/creation-successful/creation-successful.js +++ b/ui/pages/onboarding-flow/creation-successful/creation-successful.js @@ -17,6 +17,7 @@ import { ONBOARDING_PRIVACY_SETTINGS_ROUTE, } from '../../../helpers/constants/routes'; import { setCompletedOnboarding } from '../../../store/actions'; +import { isBeta } from '../../../helpers/utils/build-types'; export default function CreationSuccessful() { const history = useHistory(); @@ -52,12 +53,16 @@ export default function CreationSuccessful() {
  • - {t('walletCreationSuccessReminder1')} + {isBeta() + ? t('betaWalletCreationSuccessReminder1') + : t('walletCreationSuccessReminder1')}
  • - {t('walletCreationSuccessReminder2')} + {isBeta() + ? t('betaWalletCreationSuccessReminder2') + : t('walletCreationSuccessReminder2')}
  • diff --git a/ui/pages/settings/info-tab/index.scss b/ui/pages/settings/info-tab/index.scss index c2a08c1b8..066682cd1 100644 --- a/ui/pages/settings/info-tab/index.scss +++ b/ui/pages/settings/info-tab/index.scss @@ -53,4 +53,8 @@ color: var(--color-text-muted); margin-bottom: 15px; } + + &__tag { + margin-inline-start: 8px; + } } diff --git a/ui/pages/settings/info-tab/info-tab.component.js b/ui/pages/settings/info-tab/info-tab.component.js index 514030da8..5435576d5 100644 --- a/ui/pages/settings/info-tab/info-tab.component.js +++ b/ui/pages/settings/info-tab/info-tab.component.js @@ -2,6 +2,8 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import Button from '../../../components/ui/button'; +import { Tag } from '../../../components/component-library/tag'; + import { SUPPORT_REQUEST_LINK } from '../../../helpers/constants/common'; import { isBeta } from '../../../helpers/utils/build-types'; import { @@ -73,6 +75,20 @@ export default class InfoTab extends PureComponent { {t('terms')}
+ {isBeta() ? ( +
+ +
+ ) : null}