From 0e5700f76a56588dfb998fcdd82c1bda1b5c6d19 Mon Sep 17 00:00:00 2001 From: "runway-github[bot]" <73448015+runway-github[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:56:53 +0000 Subject: [PATCH] temp+fix: non deterministic date in test (#11787) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Fixes date that was generating an ever changing duration in the snapshot. - replace it with a relative date to the moment the test is running to make the duration always one day: the notification renders as if it was sent yesterday, always. - fix duration to one day (yesterday) as we have to fix one and it's not a worse value than any other. - rename test case to match guideline while I was on it... ## **Related issues** Fixes #11785 ## **Manual testing steps** N/A ## **Screenshots/Recordings** N/A ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com> --- .depcheckrc.yml | 2 +- .detoxrc.js | 28 +- .git-blame-ignore-revs | 2 - .github/CODEOWNERS | 31 +- .github/workflows/add-release-label.yml | 2 +- .github/workflows/ci.yml | 16 +- .iyarc | 4 + .storybook/storybook.requires.js | 5 +- CHANGELOG.md | 111 +- android/app/build.gradle | 6 +- app/actions/notification/constants/index.ts | 1 - app/actions/notification/helpers/index.ts | 17 - app/actions/security/index.ts | 16 +- .../CellSelectWithMenu/CellSelectWithMenu.tsx | 16 +- .../CellSelectWithMenu.test.tsx.snap | 12 +- .../KeyValueLabel/KeyValueLabel.tsx | 34 +- .../KeyValueRow/KeyValueRow.stories.tsx | 67 +- .../KeyValueRow/KeyValueRow.test.tsx | 24 +- .../KeyValueRow/KeyValueRow.tsx | 17 +- .../KeyValueRow/KeyValueRow.types.ts | 39 +- .../KeyValueRow/KeyValueRow.utils.ts | 15 +- .../__snapshots__/KeyValueRow.test.tsx.snap | 16 +- .../ListItemMultiSelectButton.constants.ts | 1 - .../ListItemMultiSelectButton.styles.ts | 7 +- .../ListItemMultiSelectButton.test.tsx | 8 +- .../ListItemMultiSelectButton.tsx | 40 +- .../ListItemMultiSelectButton.types.ts | 24 +- .../ListItemMultiSelectButton.test.tsx.snap | 12 +- .../PermissionApproval.test.tsx | 1 - .../SignatureApproval/SignatureApproval.tsx | 11 +- .../{index.tsx => index.js} | 160 +- app/components/Base/Title/Title.tsx | 3 +- app/components/Nav/App/index.js | 27 +- app/components/Nav/Main/index.js | 43 +- .../UI/AccountInfoCard/index.test.tsx | 23 +- .../UI/ApprovalTagUrl/ApprovalTagUrl.test.tsx | 34 - .../UI/ApprovalTagUrl/ApprovalTagUrl.tsx | 6 +- .../ApprovalTagUrl.test.tsx.snap | 69 - app/components/UI/AssetElement/index.test.tsx | 2 +- app/components/UI/AssetElement/index.tsx | 2 +- app/components/UI/AssetIcon/index.test.tsx | 1 - .../UI/AssetOverview/AssetOverview.test.tsx | 2 +- .../UI/AssetOverview/AssetOverview.tsx | 2 +- .../UI/AssetOverview/AssetOverview.types.ts | 2 +- .../UI/AssetOverview/Balance/index.test.tsx | 2 +- .../TokenDetails/TokenDetails.test.tsx | 2 +- .../UI/BottomModal/BottomModal.test.tsx | 2 +- .../UI/BottomModal/BottomModal.tsx | 8 +- .../__snapshots__/BottomModal.test.tsx.snap | 0 .../components => }/UI/BottomModal/index.tsx | 0 app/components/UI/Fox/{index.tsx => index.js} | 29 +- .../UI/InfoRow/InfoRow.stories.tsx | 12 +- .../UI/InfoRow/InfoRow.test.tsx | 0 app/components/UI/InfoRow/InfoRow.tsx | 30 + .../InfoRow/InfoSection/InfoSection.test.tsx | 0 .../UI/InfoRow/InfoSection/InfoSection.tsx | 18 + .../__snapshots__/InfoSection.test.tsx.snap | 1 - .../UI/InfoRow/InfoSection/index.ts | 0 .../UI/InfoRow/InfoSection/style.ts | 4 +- .../__snapshots__/InfoRow.test.tsx.snap | 24 +- .../components => }/UI/InfoRow/index.ts | 0 app/components/UI/InfoRow/style.ts | 31 + .../LoginOptionsSwitch/LoginOptionsSwitch.tsx | 7 +- .../__snapshots__/ManageNetworks.test.js.snap | 2 +- app/components/UI/Name/Name.tsx | 14 +- app/components/UI/Name/Name.types.ts | 3 - app/components/UI/Navbar/index.js | 56 +- .../UI/NetworkCell/NetworkCell.styles.ts | 11 - .../UI/NetworkCell/NetworkCell.test.tsx | 68 - app/components/UI/NetworkCell/NetworkCell.tsx | 72 - .../__snapshots__/NetworkCell.test.tsx.snap | 146 - .../UI/NetworkModal/NetworkAdded/index.tsx | 5 +- app/components/UI/NetworkModal/index.tsx | 220 +- .../__snapshots__/Content.test.tsx.snap | 2 +- .../ResetNotificationsModal.test.tsx.snap | 2 +- .../ResetNotificationsModal/index.tsx | 31 +- app/components/UI/OptinMetrics/index.test.tsx | 2 + .../UI/Ramp/Views/BuildQuote/BuildQuote.tsx | 71 +- .../__snapshots__/BuildQuote.test.tsx.snap | 3954 +++-- .../__snapshots__/GetStarted.test.tsx.snap | 63 +- .../LoadingNetworksSkeleton.tsx | 32 +- .../NetworkSwitcher/NetworkSwitcher.test.tsx | 2 +- .../Views/NetworkSwitcher/NetworkSwitcher.tsx | 18 +- .../NetworkSwitcher.test.tsx.snap | 2447 ++- .../__snapshots__/OrderDetails.test.tsx.snap | 13488 ++++++++++------ .../__snapshots__/OrdersList.test.tsx.snap | 3524 ++-- .../PaymentMethods.test.tsx.snap | 9728 +++++++---- .../Quotes/__snapshots__/Quotes.test.tsx.snap | 2429 +-- .../UI/Ramp/Views/Regions/Regions.tsx | 31 +- .../__snapshots__/Regions.test.tsx.snap | 1132 +- .../Views/SendTransaction/SendTransaction.tsx | 63 +- .../SendTransaction.test.tsx.snap | 3 - .../UI/Ramp/Views/Settings/Settings.tsx | 32 +- .../__snapshots__/Settings.test.tsx.snap | 318 +- .../UI/Ramp/components/AmountInput.tsx | 38 +- .../Ramp/components/AssetSelectorButton.tsx | 56 +- app/components/UI/Ramp/components/Box.tsx | 14 +- .../UI/Ramp/components/ListItemColumnEnd.tsx | 25 - .../UI/Ramp/components/OrderDetails.tsx | 288 +- .../OrderListItem/OrderListItem.tsx | 98 +- .../__snapshots__/OrderListItem.test.tsx.snap | 2200 ++- .../UI/Ramp/components/PaymentMethod.tsx | 98 +- .../Ramp/components/PaymentMethodSelector.tsx | 39 +- .../UI/Ramp/components/Quote/Quote.tsx | 240 +- .../UI/Ramp/components/RegionModal.tsx | 65 +- .../SkeletonPaymentMethod.tsx | 47 +- .../SkeletonQuote/SkeletonQuote.tsx | 45 +- .../UI/Ramp/components/TokenSelectModal.tsx | 70 +- .../components/modals/FiatSelectModal.tsx | 33 +- .../UI/ReceiveRequest/index.test.tsx | 20 +- .../SimulationDetails/AssetPill/AssetPill.tsx | 3 +- .../UI/SimulationDetails/useBalanceChanges.ts | 5 +- .../StakeInputView.styles.ts | 17 + .../StakeInputView.test.tsx | 2 +- .../Stake/Views/InputView/StakeInputView.tsx | 264 + .../StakeInputView.test.tsx.snap | 1 + .../Views/StakeInputView/StakeInputView.tsx | 122 - .../Views/UnstakeInputView/UnstakeBanner.tsx | 25 - .../UnstakeInputView.styles.ts | 31 - .../UnstakeInputView.test.tsx | 109 - .../UnstakeInputView/UnstakeInputView.tsx | 108 - .../UnstakeInputView.test.tsx.snap | 1651 -- .../UI/Stake/components/InputDisplay.tsx | 93 - .../StakingBalance/StakingBalance.test.tsx | 20 +- .../StakingButtons/StakingButtons.tsx | 12 +- app/components/UI/Stake/hooks/useBalance.ts | 14 +- .../UI/Stake/hooks/useStakingInput.ts | 159 - app/components/UI/Stake/routes/index.tsx | 4 +- ...dButtonStyles.ts => styledButtonStyles.js} | 5 +- .../{InfoModal.tsx => InfoModal.js} | 114 +- .../TokenList/PortfolioBalance/index.tsx | 140 - .../TokenList/ScamWarningIcon/index.tsx | 48 - .../TokenList/ScamWarningModal/index.tsx | 81 - .../UI/Tokens/TokenList/StakeButton/index.tsx | 95 - .../TokenList/TokenListFooter/index.tsx | 121 - .../Tokens/TokenList/TokenListItem/index.tsx | 225 - app/components/UI/Tokens/TokenList/index.tsx | 113 - .../Tokens/__snapshots__/index.test.tsx.snap | 218 +- app/components/UI/Tokens/index.tsx | 688 +- app/components/UI/Tokens/styles.ts | 3 +- app/components/UI/Tokens/types.ts | 2 +- ...eriveBalanceFromAssetMarketDetails.test.ts | 157 - .../deriveBalanceFromAssetMarketDetails.ts | 71 - app/components/UI/Tokens/util/index.ts | 2 - .../UI/Tokens/util/sortAssets.test.ts | 263 - app/components/UI/Tokens/util/sortAssets.ts | 81 - .../Views/AccountConnect/AccountConnect.tsx | 21 +- .../{index.tsx => index.js} | 27 +- app/components/Views/AssetDetails/index.tsx | 4 +- .../Views/ImportPrivateKey/index.tsx | 10 +- app/components/Views/Login/index.js | 5 +- .../MultiRpcModal/MultiRpcModal.constants.ts | 30 - .../MultiRpcModal/MultiRpcModal.styles.ts | 40 - .../MultiRpcModal/MultiRpcModal.test.tsx | 61 - .../Views/MultiRpcModal/MultiRpcModal.tsx | 146 - .../__snapshots__/MultiRpcModal.test.tsx.snap | 595 - app/components/Views/MultiRpcModal/index.ts | 1 - .../NetworkSelector/NetworkSelector.styles.ts | 2 +- .../NetworkSelector/NetworkSelector.test.tsx | 254 +- .../Views/NetworkSelector/NetworkSelector.tsx | 371 +- .../Details/Footers/BlockExplorerFooter.tsx | 2 +- .../__snapshots__/index.test.js.snap} | 36 +- .../__snapshots__/index.test.tsx.snap | 330 - .../DefaultSettings/index.styles.ts | 43 +- .../index.test.js} | 16 +- .../DefaultSettings/index.test.tsx | 76 - .../DefaultSettings/index.tsx | 110 +- .../__snapshots__/index.test.tsx.snap | 1682 -- .../OnboardingAssetsSettings/index.styles.ts | 16 - .../OnboardingAssetsSettings/index.test.tsx | 55 - .../OnboardingAssetsSettings/index.tsx | 33 - .../OnboardingGeneralSettings/index.tsx | 73 - .../__snapshots__/index.test.tsx.snap | 120 - .../OnboardingSecuritySettings/index.test.tsx | 42 - .../OnboardingSecuritySettings/index.tsx | 19 - .../__snapshots__/index.test.tsx.snap | 90 - .../index.constants.ts | 3 - .../index.styles.ts | 26 - .../index.test.tsx | 120 - .../BatchAccountBalanceSettings/index.tsx | 74 - .../__snapshots__/index.test.tsx.snap | 89 - .../index.constants.ts | 1 - .../DisplayNFTMediaSettings/index.styles.ts | 26 - .../DisplayNFTMediaSettings/index.test.tsx | 74 - .../DisplayNFTMediaSettings/index.tsx | 61 - .../__snapshots__/index.test.tsx.snap | 129 - .../IPFSGatewaySettings/index.constants.ts | 4 - .../IPFSGatewaySettings/index.styles.ts | 42 - .../IPFSGatewaySettings/index.test.tsx | 120 - .../Settings/IPFSGatewaySettings/index.tsx | 138 - .../IPFSGatewaySettings/index.types.ts | 12 - .../__snapshots__/index.test.tsx.snap | 1196 -- .../index.constants.ts | 5 - .../index.styles.ts | 18 - .../index.test.tsx | 131 - .../IncomingTransactionsSettings/index.tsx | 154 - .../index.types.ts | 13 - .../__snapshots__/index.test.tsx.snap | 108 - .../index.constants.ts | 3 - .../index.styles.ts | 26 - .../index.test.tsx | 90 - .../NetworkDetailsCheckSettings/index.tsx | 63 - .../NetworksSettings/NetworkSettings/index.js | 1072 +- .../NetworkSettings/index.test.tsx | 167 +- .../__snapshots__/index.test.tsx.snap | 22 +- .../Views/Settings/NetworksSettings/index.js | 53 +- .../NotificationsSettings.styles.ts | 1 - .../__snapshots__/index.test.tsx.snap | 2 +- .../NotificationsSettings/index.test.tsx | 150 +- .../Settings/NotificationsSettings/index.tsx | 47 +- .../useToggleNotifications.test.tsx | 125 - .../useToggleNotifications.ts | 70 - ...taMetricsAndDataCollectionSection.test.tsx | 4 + .../SecuritySettings.constants.ts | 10 + .../SecuritySettings.styles.ts | 5 + .../SecuritySettings.test.tsx | 11 + .../SecuritySettings/SecuritySettings.tsx | 499 +- .../SecuritySettings.types.ts | 19 + .../SecuritySettings.test.tsx.snap | 865 +- .../Views/TooltipModal/ToolTipModal.styles.ts | 5 +- .../Views/TooltipModal/ToolTipModal.types.ts | 4 +- app/components/Views/TooltipModal/index.tsx | 10 +- app/components/Views/Wallet/index.tsx | 35 +- .../confirmations/Confirm/Confirm.styles.ts | 23 - .../Views/confirmations/Confirm/Confirm.tsx | 18 +- .../__snapshots__/Confirm.test.tsx.snap | 561 +- .../Views/confirmations/Confirm/style.ts | 19 + .../Send/__snapshots__/index.test.tsx.snap | 4 +- .../SendFlow/Amount/index.test.tsx | 31 +- .../Confirm/__snapshots__/index.test.tsx.snap | 2 +- .../confirmations/SendFlow/Confirm/index.js | 58 +- .../SendFlow/Confirm/index.test.tsx | 80 +- .../SendFlow/Confirm/validation.test.ts | 48 +- .../SendFlow/Confirm/validation.ts | 30 +- .../ApproveTransactionHeader.tsx | 9 +- .../ApproveTransactionHeader.test.tsx.snap | 8 +- .../AddNickname/types.ts | 2 +- .../ShowBlockExplorer/index.tsx | 6 +- .../VerifyContractDetails.types.ts | 2 +- .../__snapshots__/index.test.tsx.snap | 2 +- .../ApproveTransactionReview/index.js | 16 +- .../ApproveTransactionReview/index.test.tsx | 142 - .../AccountNetworkInfo.test.tsx | 14 - .../AccountNetworkInfo/AccountNetworkInfo.tsx | 25 - .../AccountNetworkInfoCollapsed.styles.ts | 33 - .../AccountNetworkInfoCollapsed.test.tsx | 14 - .../AccountNetworkInfoCollapsed.tsx | 64 - .../AccountNetworkInfoCollapsed.test.tsx.snap | 161 - .../AccountNetworkInfoCollapsed/index.ts | 1 - .../AccountNetworkInfoExpanded.test.tsx | 14 - .../AccountNetworkInfoExpanded.tsx | 47 - .../AccountNetworkInfoExpanded.test.tsx.snap | 301 - .../AccountNetworkInfoExpanded/index.ts | 1 - .../AccountNetworkInfo.test.tsx.snap | 198 - .../Confirm/AccountNetworkInfo/index.ts | 1 - .../Confirm/Footer/Footer.styles.ts | 30 - .../components/Confirm/Footer/Footer.tsx | 8 +- .../components/Confirm/Footer/style.ts | 27 + .../components/Confirm/Info/Info.test.tsx | 14 - .../components/Confirm/Info/Info.tsx | 26 - .../PersonalSign/Message/Message.styles.ts | 46 - .../PersonalSign/Message/Message.test.tsx | 30 - .../Info/PersonalSign/Message/Message.tsx | 45 - .../__snapshots__/Message.test.tsx.snap | 75 - .../Info/PersonalSign/Message/index.ts | 1 - .../Info/PersonalSign/PersonalSign.test.tsx | 14 - .../Info/PersonalSign/PersonalSign.tsx | 34 - .../Simulation/Simulation.test.tsx | 32 - .../PersonalSign/Simulation/Simulation.tsx | 30 - .../__snapshots__/Simulation.test.tsx.snap | 131 - .../Info/PersonalSign/Simulation/index.ts | 1 - .../__snapshots__/PersonalSign.test.tsx.snap | 337 - .../Confirm/Info/PersonalSign/index.ts | 1 - .../Info/__snapshots__/Info.test.tsx.snap | 337 - .../components/Confirm/Info/index.ts | 1 - .../components/Confirm/Title/Title.styles.ts | 23 - .../components/Confirm/Title/Title.test.tsx | 2 +- .../components/Confirm/Title/Title.tsx | 7 +- .../Title/__snapshots__/Title.test.tsx.snap | 3 +- .../components/Confirm/Title/style.ts | 19 + .../components/PersonalSign/index.test.tsx | 4 +- .../components/SignatureRequest/Root/Root.tsx | 2 +- .../components/TransactionReview/index.js | 2 +- .../components/TypedSign/index.test.tsx | 4 +- .../UI/CopyButton/CopyButton.stories.tsx | 8 - .../UI/CopyButton/CopyButton.test.tsx | 20 - .../components/UI/CopyButton/CopyButton.tsx | 36 - .../__snapshots__/CopyButton.test.tsx.snap | 36 - .../components/UI/CopyButton/index.tsx | 1 - .../ExpandableSection.stories.tsx | 25 - .../ExpandableSection.styles.ts | 47 - .../ExpandableSection.test.tsx | 70 - .../ExpandableSection/ExpandableSection.tsx | 73 - .../ExpandableSection.test.tsx.snap | 46 - .../components/UI/ExpandableSection/index.ts | 1 - .../components/UI/InfoRow/InfoRow.styles.ts | 39 - .../components/UI/InfoRow/InfoRow.tsx | 32 - .../InfoRow/InfoSection/InfoSection.styles.ts | 20 - .../UI/InfoRow/InfoSection/InfoSection.tsx | 17 - .../InfoValue/InfoURL/InfoURL.styles.ts | 39 - .../InfoValue/InfoURL/InfoURL.test.tsx | 16 - .../UI/InfoRow/InfoValue/InfoURL/InfoURL.tsx | 50 - .../__snapshots__/InfoURL.test.tsx.snap | 27 - .../UI/InfoRow/InfoValue/InfoURL/index.ts | 1 - .../UI/InfoRow/InfoValue/InfoURL/style.ts | 36 - .../components/UI/Tooltip/Tooltip.stories.tsx | 18 - .../components/UI/Tooltip/Tooltip.styles.ts | 45 - .../components/UI/Tooltip/Tooltip.test.tsx | 37 - .../components/UI/Tooltip/Tooltip.tsx | 64 - .../__snapshots__/Tooltip.test.tsx.snap | 67 - .../components/UI/Tooltip/index.ts | 1 - .../hooks/useAccountInfo.test.ts | 51 - .../confirmations/hooks/useAccountInfo.ts | 26 - .../useMinimumVersions.test.ts | 68 - .../MinimumVersions/useMinimumVersions.tsx | 29 +- .../useAddressBalance/useAddressBalance.ts | 2 +- app/components/hooks/useBlockExplorer.test.ts | 30 +- app/components/hooks/useBlockExplorer.ts | 3 +- .../hooks/useMetrics/useMetrics.test.tsx | 16 +- app/components/hooks/useMetrics/useMetrics.ts | 128 +- .../hooks/useMetrics/useMetrics.types.ts | 17 - app/components/hooks/useOnboardingHeader.tsx | 44 - app/components/hooks/useTooltipModal.tsx | 3 +- app/constants/navigation/Routes.ts | 4 - app/core/Analytics/MetaMetrics.events.ts | 6 - app/core/Analytics/MetaMetrics.ts | 112 +- app/core/Analytics/MetaMetrics.types.ts | 84 +- .../Analytics/MetricsEventBuilder.test.ts | 158 - app/core/Analytics/MetricsEventBuilder.ts | 168 - app/core/AppConstants.ts | 2 +- app/core/AppStateEventListener.test.ts | 58 +- app/core/AppStateEventListener.ts | 17 +- app/core/BackgroundBridge/BackgroundBridge.js | 4 - .../ParseManager/extractURLParams.test.ts | 4 - .../ParseManager/extractURLParams.ts | 2 - app/core/Engine.test.js | 11 +- app/core/Engine.ts | 173 +- app/core/EngineService/EngineService.ts | 8 +- app/core/NotificationManager.js | 7 +- .../RPCMethods/RPCMethodMiddleware.test.ts | 211 +- app/core/RPCMethods/RPCMethodMiddleware.ts | 34 +- .../RPCMethods/wallet_addEthereumChain.js | 121 +- .../wallet_addEthereumChain.test.js | 22 +- .../RPCMethods/wallet_switchEthereumChain.js | 15 +- app/core/RPCMethods/wallet_watchAsset.test.ts | 24 +- .../handlers/handleConnectionMessage.test.ts | 10 +- .../createTracingMiddleware/index.test.ts | 39 - app/core/createTracingMiddleware/index.ts | 45 - app/core/processAttribution.test.tsx | 77 +- app/core/processAttribution.tsx | 50 +- app/images/networks1.png | Bin 5923 -> 0 bytes app/lib/ppom/ppom-util.test.ts | 52 +- app/lib/snaps/SnapsExecutionWebView.tsx | 10 +- app/reducers/fiatOrders/index.test.ts | 243 +- app/reducers/index.ts | 4 +- app/reducers/security/index.ts | 9 - app/reducers/swaps/index.js | 2 +- .../accountTrackerController.test.ts | 18 +- ...accountTrackerControllerReRenders.test.tsx | 141 +- app/selectors/currencyRateController.ts | 18 +- app/selectors/networkController.ts | 140 +- app/selectors/nftController.ts | 7 +- app/selectors/preferencesController.ts | 6 - app/selectors/selectedNetworkController.ts | 38 +- app/selectors/tokensController.ts | 11 +- app/selectors/types.ts | 8 +- app/store/migrations/023.test.js | 22 - app/store/migrations/029.ts | 26 +- app/store/migrations/031.ts | 4 +- app/store/migrations/035.test.ts | 6 +- app/store/migrations/043.test.ts | 5 +- app/store/migrations/051.test.ts | 1 - app/store/migrations/054.test.ts | 521 - app/store/migrations/054.ts | 39 - app/store/migrations/055.test.ts | 584 - app/store/migrations/055.ts | 403 - app/store/migrations/index.ts | 4 - app/store/storage-wrapper.js | 69 + app/store/storage-wrapper.test.ts | 95 - app/store/storage-wrapper.ts | 158 - app/util/address/index.test.ts | 50 +- app/util/address/index.ts | 2 +- app/util/dappTransactions/index.test.ts | 2 +- app/util/hideKeyFromUrl.test.ts | 70 +- app/util/hideKeyFromUrl.ts | 8 - .../TrackError/trackErrorAsAnalytics.ts | 2 +- app/util/networks/handleNetworkSwitch.test.ts | 92 +- app/util/networks/handleNetworkSwitch.ts | 28 +- app/util/networks/index.js | 32 +- app/util/networks/index.test.ts | 139 +- .../networks/isNetworkUiRedesignEnabled.ts | 3 +- .../notifications/androidChannels.test.ts | 10 +- app/util/notifications/hooks/index.test.ts | 198 +- app/util/notifications/hooks/index.ts | 4 +- app/util/notifications/hooks/types.ts | 4 +- .../hooks/useNotifications.test.tsx | 37 - .../notifications/hooks/useNotifications.ts | 16 +- .../sentry/__snapshots__/utils.test.ts.snap | 2 +- app/util/sentry/utils.test.ts | 2 +- app/util/test/initial-background-state.json | 95 +- app/util/test/network-store.js | 5 - app/util/test/network.ts | 76 +- app/util/trace.ts | 3 - ...pers.ts => transaction-reducer-helpers.js} | 29 +- babel.config.js | 4 - bitrise.yml | 61 +- docs/readme/testing.md | 2 +- e2e/fixtures/fixture-builder.js | 220 +- e2e/pages/CommonView.js | 13 +- e2e/pages/ImportAccountView.js | 53 + e2e/pages/LoginView.js | 37 +- e2e/pages/Ramps/BuildQuoteView.js | 13 - e2e/pages/Ramps/BuyGetStartedView.js | 15 - e2e/pages/Ramps/SelectPaymentMethodView.js | 21 - e2e/pages/Ramps/SelectRegionView.js | 28 - e2e/pages/Settings/NetworksView.js | 35 - .../RevealSecretRecoveryPhrase.js | 18 + e2e/pages/importAccount/ImportAccountView.js | 32 - .../importAccount/SuccessImportAccountView.js | 19 - e2e/pages/modals/NetworkApprovalModal.js | 3 +- e2e/pages/modals/NetworkListModal.js | 56 +- e2e/pages/modals/WalletActionsModal.js | 8 - e2e/pages/wallet/WalletView.js | 8 + .../ImportAccountFromPrivateKey.selectors.js | 6 - .../SuccessImportAccount.selectors.js | 4 - .../ImportAccountFromPrivateKey.selectors.js | 6 + e2e/selectors/LoginView.selectors.js | 4 +- .../Modals/NetworkListModal.selectors.js | 3 - e2e/selectors/Ramps/BuildQuote.selectors.js | 6 - e2e/selectors/Ramps/GetStarted.selectors.js | 5 - .../Ramps/SelectPaymentMethod.selectors.js | 5 - e2e/selectors/Ramps/SelectRegion.selectors.js | 6 - .../Settings/AdvancedView.selectors.js | 1 - .../Settings/NetworksView.selectors.js | 4 - .../RevealSeedView.selectors.js | 1 + .../SecurityPrivacyView.selectors.js | 1 + e2e/specs/accounts/auto-lock.spec.js | 2 +- .../accounts/change-account-name.spec.js | 2 +- .../accounts/import-wallet-account.spec.js | 12 +- ...imported-account-remove-and-import.spec.js | 9 +- e2e/specs/assets/nft-detection-modal.spec.js | 17 +- e2e/specs/networks/add-custom-rpc.spec.js | 92 +- .../networks/add-popular-networks.spec.js | 17 +- .../networks/connect-test-network.spec.js | 4 - e2e/specs/networks/networks-search.spec.js | 42 +- .../onboarding-wizard-opt-in.spec.js | 3 +- .../permission-system-delete-wallet.spec.js | 7 +- e2e/specs/quarantine/deeplinks.failing.js | 10 +- ...ystem-removing-imported-account.failing.js | 13 +- e2e/specs/ramps/onramp.spec.js | 59 - e2e/specs/settings/delete-wallet.spec.js | 2 +- e2e/specs/wallet/send-ERC-token.spec.js | 2 - e2e/specs/wallet/suggestedGasApi.mock.spec.js | 9 +- e2e/utils/Gestures.js | 2 +- e2e/viewHelper.js | 14 +- index.js | 1 + ios/MetaMask.xcodeproj/project.pbxproj | 24 +- ios/Podfile | 2 +- ios/Podfile.lock | 13 +- locales/languages/en.json | 44 +- package.json | 32 +- ...tamask+preferences-controller+13.0.3.patch | 13 - .../@metamask+assets-controllers+30.0.0.patch | 1160 ++ .../@metamask+assets-controllers+32.0.0.patch | 1022 -- patches/@metamask+nonce-tracker+5.0.0.patch | 30 + ...tamask+preferences-controller+11.0.0.patch | 58 +- ...tamask+transaction-controller+35.0.0.patch | 2588 +++ ...ative-community+datetimepicker+7.7.0.patch | 13 + scripts/build.sh | 27 +- .../get-next-semver-version.sh | 0 wdio/screen-objects/ImportAccountScreen.js | 15 +- wdio/screen-objects/ImportSuccessScreen.js | 9 +- wdio/screen-objects/LoginScreen.js | 25 +- .../Screens/ImportAccountScreen.testIds.js | 5 + .../Screens/ImportSuccessScreen.testIds.js | 2 + .../testIDs/Screens/LoginScreen.testIds.js | 11 + .../RevelSecretRecoveryPhrase.testIds.js | 16 + .../Screens/SecurityPrivacy.testIds.js | 3 + yarn.lock | 732 +- 479 files changed, 34606 insertions(+), 39539 deletions(-) rename app/components/Base/HorizontalSelector/{index.tsx => index.js} (73%) delete mode 100644 app/components/UI/ApprovalTagUrl/ApprovalTagUrl.test.tsx delete mode 100644 app/components/UI/ApprovalTagUrl/__snapshots__/ApprovalTagUrl.test.tsx.snap rename app/components/{Views/confirmations/components => }/UI/BottomModal/BottomModal.test.tsx (83%) rename app/components/{Views/confirmations/components => }/UI/BottomModal/BottomModal.tsx (73%) rename app/components/{Views/confirmations/components => }/UI/BottomModal/__snapshots__/BottomModal.test.tsx.snap (100%) rename app/components/{Views/confirmations/components => }/UI/BottomModal/index.tsx (100%) rename app/components/UI/Fox/{index.tsx => index.js} (98%) rename app/components/{Views/confirmations/components => }/UI/InfoRow/InfoRow.stories.tsx (71%) rename app/components/{Views/confirmations/components => }/UI/InfoRow/InfoRow.test.tsx (100%) create mode 100644 app/components/UI/InfoRow/InfoRow.tsx rename app/components/{Views/confirmations/components => }/UI/InfoRow/InfoSection/InfoSection.test.tsx (100%) create mode 100644 app/components/UI/InfoRow/InfoSection/InfoSection.tsx rename app/components/{Views/confirmations/components => }/UI/InfoRow/InfoSection/__snapshots__/InfoSection.test.tsx.snap (93%) rename app/components/{Views/confirmations/components => }/UI/InfoRow/InfoSection/index.ts (100%) rename app/components/{Views/confirmations/components => }/UI/InfoRow/InfoSection/style.ts (73%) rename app/components/{Views/confirmations/components => }/UI/InfoRow/__snapshots__/InfoRow.test.tsx.snap (65%) rename app/components/{Views/confirmations/components => }/UI/InfoRow/index.ts (100%) create mode 100644 app/components/UI/InfoRow/style.ts delete mode 100644 app/components/UI/NetworkCell/NetworkCell.styles.ts delete mode 100644 app/components/UI/NetworkCell/NetworkCell.test.tsx delete mode 100644 app/components/UI/NetworkCell/NetworkCell.tsx delete mode 100644 app/components/UI/NetworkCell/__snapshots__/NetworkCell.test.tsx.snap delete mode 100644 app/components/UI/Ramp/components/ListItemColumnEnd.tsx rename app/components/UI/Stake/Views/{StakeInputView => InputView}/StakeInputView.styles.ts (65%) rename app/components/UI/Stake/Views/{StakeInputView => InputView}/StakeInputView.test.tsx (99%) create mode 100644 app/components/UI/Stake/Views/InputView/StakeInputView.tsx rename app/components/UI/Stake/Views/{StakeInputView => InputView}/__snapshots__/StakeInputView.test.tsx.snap (99%) delete mode 100644 app/components/UI/Stake/Views/StakeInputView/StakeInputView.tsx delete mode 100644 app/components/UI/Stake/Views/UnstakeInputView/UnstakeBanner.tsx delete mode 100644 app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.styles.ts delete mode 100644 app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.test.tsx delete mode 100644 app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx delete mode 100644 app/components/UI/Stake/Views/UnstakeInputView/__snapshots__/UnstakeInputView.test.tsx.snap delete mode 100644 app/components/UI/Stake/components/InputDisplay.tsx delete mode 100644 app/components/UI/Stake/hooks/useStakingInput.ts rename app/components/UI/StyledButton/{styledButtonStyles.ts => styledButtonStyles.js} (97%) rename app/components/UI/Swaps/components/{InfoModal.tsx => InfoModal.js} (56%) delete mode 100644 app/components/UI/Tokens/TokenList/PortfolioBalance/index.tsx delete mode 100644 app/components/UI/Tokens/TokenList/ScamWarningIcon/index.tsx delete mode 100644 app/components/UI/Tokens/TokenList/ScamWarningModal/index.tsx delete mode 100644 app/components/UI/Tokens/TokenList/StakeButton/index.tsx delete mode 100644 app/components/UI/Tokens/TokenList/TokenListFooter/index.tsx delete mode 100644 app/components/UI/Tokens/TokenList/TokenListItem/index.tsx delete mode 100644 app/components/UI/Tokens/TokenList/index.tsx delete mode 100644 app/components/UI/Tokens/util/deriveBalanceFromAssetMarketDetails.test.ts delete mode 100644 app/components/UI/Tokens/util/deriveBalanceFromAssetMarketDetails.ts delete mode 100644 app/components/UI/Tokens/util/index.ts delete mode 100644 app/components/UI/Tokens/util/sortAssets.test.ts delete mode 100644 app/components/UI/Tokens/util/sortAssets.ts rename app/components/Views/AndroidBackHandler/{index.tsx => index.js} (67%) delete mode 100644 app/components/Views/MultiRpcModal/MultiRpcModal.constants.ts delete mode 100644 app/components/Views/MultiRpcModal/MultiRpcModal.styles.ts delete mode 100644 app/components/Views/MultiRpcModal/MultiRpcModal.test.tsx delete mode 100644 app/components/Views/MultiRpcModal/MultiRpcModal.tsx delete mode 100644 app/components/Views/MultiRpcModal/__snapshots__/MultiRpcModal.test.tsx.snap delete mode 100644 app/components/Views/MultiRpcModal/index.ts rename app/components/Views/OnboardingSuccess/{OnboardingGeneralSettings/__snapshots__/index.test.tsx.snap => DefaultSettings/__snapshots__/index.test.js.snap} (87%) delete mode 100644 app/components/Views/OnboardingSuccess/DefaultSettings/__snapshots__/index.test.tsx.snap rename app/components/Views/OnboardingSuccess/{OnboardingGeneralSettings/index.test.tsx => DefaultSettings/index.test.js} (73%) delete mode 100644 app/components/Views/OnboardingSuccess/DefaultSettings/index.test.tsx delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingAssetsSettings/__snapshots__/index.test.tsx.snap delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingAssetsSettings/index.styles.ts delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingAssetsSettings/index.test.tsx delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingAssetsSettings/index.tsx delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingGeneralSettings/index.tsx delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingSecuritySettings/__snapshots__/index.test.tsx.snap delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingSecuritySettings/index.test.tsx delete mode 100644 app/components/Views/OnboardingSuccess/OnboardingSecuritySettings/index.tsx delete mode 100644 app/components/Views/Settings/BatchAccountBalanceSettings/__snapshots__/index.test.tsx.snap delete mode 100644 app/components/Views/Settings/BatchAccountBalanceSettings/index.constants.ts delete mode 100644 app/components/Views/Settings/BatchAccountBalanceSettings/index.styles.ts delete mode 100644 app/components/Views/Settings/BatchAccountBalanceSettings/index.test.tsx delete mode 100644 app/components/Views/Settings/BatchAccountBalanceSettings/index.tsx delete mode 100644 app/components/Views/Settings/DisplayNFTMediaSettings/__snapshots__/index.test.tsx.snap delete mode 100644 app/components/Views/Settings/DisplayNFTMediaSettings/index.constants.ts delete mode 100644 app/components/Views/Settings/DisplayNFTMediaSettings/index.styles.ts delete mode 100644 app/components/Views/Settings/DisplayNFTMediaSettings/index.test.tsx delete mode 100644 app/components/Views/Settings/DisplayNFTMediaSettings/index.tsx delete mode 100644 app/components/Views/Settings/IPFSGatewaySettings/__snapshots__/index.test.tsx.snap delete mode 100644 app/components/Views/Settings/IPFSGatewaySettings/index.constants.ts delete mode 100644 app/components/Views/Settings/IPFSGatewaySettings/index.styles.ts delete mode 100644 app/components/Views/Settings/IPFSGatewaySettings/index.test.tsx delete mode 100644 app/components/Views/Settings/IPFSGatewaySettings/index.tsx delete mode 100644 app/components/Views/Settings/IPFSGatewaySettings/index.types.ts delete mode 100644 app/components/Views/Settings/IncomingTransactionsSettings/__snapshots__/index.test.tsx.snap delete mode 100644 app/components/Views/Settings/IncomingTransactionsSettings/index.constants.ts delete mode 100644 app/components/Views/Settings/IncomingTransactionsSettings/index.styles.ts delete mode 100644 app/components/Views/Settings/IncomingTransactionsSettings/index.test.tsx delete mode 100644 app/components/Views/Settings/IncomingTransactionsSettings/index.tsx delete mode 100644 app/components/Views/Settings/IncomingTransactionsSettings/index.types.ts delete mode 100644 app/components/Views/Settings/NetworkDetailsCheckSettings/__snapshots__/index.test.tsx.snap delete mode 100644 app/components/Views/Settings/NetworkDetailsCheckSettings/index.constants.ts delete mode 100644 app/components/Views/Settings/NetworkDetailsCheckSettings/index.styles.ts delete mode 100644 app/components/Views/Settings/NetworkDetailsCheckSettings/index.test.tsx delete mode 100644 app/components/Views/Settings/NetworkDetailsCheckSettings/index.tsx delete mode 100644 app/components/Views/Settings/NotificationsSettings/useToggleNotifications.test.tsx delete mode 100644 app/components/Views/Settings/NotificationsSettings/useToggleNotifications.ts delete mode 100644 app/components/Views/confirmations/Confirm/Confirm.styles.ts create mode 100644 app/components/Views/confirmations/Confirm/style.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfo.test.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfo.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoCollapsed/AccountNetworkInfoCollapsed.styles.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoCollapsed/AccountNetworkInfoCollapsed.test.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoCollapsed/AccountNetworkInfoCollapsed.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoCollapsed/__snapshots__/AccountNetworkInfoCollapsed.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoCollapsed/index.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoExpanded/AccountNetworkInfoExpanded.test.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoExpanded/AccountNetworkInfoExpanded.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoExpanded/__snapshots__/AccountNetworkInfoExpanded.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/AccountNetworkInfoExpanded/index.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/__snapshots__/AccountNetworkInfo.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/Confirm/AccountNetworkInfo/index.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/Footer/Footer.styles.ts create mode 100644 app/components/Views/confirmations/components/Confirm/Footer/style.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/Info.test.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/Info.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Message/Message.styles.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Message/Message.test.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Message/Message.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Message/__snapshots__/Message.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Message/index.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/PersonalSign.test.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/PersonalSign.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Simulation/Simulation.test.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Simulation/Simulation.tsx delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Simulation/__snapshots__/Simulation.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/Simulation/index.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/__snapshots__/PersonalSign.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/PersonalSign/index.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/__snapshots__/Info.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/Confirm/Info/index.ts delete mode 100644 app/components/Views/confirmations/components/Confirm/Title/Title.styles.ts create mode 100644 app/components/Views/confirmations/components/Confirm/Title/style.ts delete mode 100644 app/components/Views/confirmations/components/UI/CopyButton/CopyButton.stories.tsx delete mode 100644 app/components/Views/confirmations/components/UI/CopyButton/CopyButton.test.tsx delete mode 100644 app/components/Views/confirmations/components/UI/CopyButton/CopyButton.tsx delete mode 100644 app/components/Views/confirmations/components/UI/CopyButton/__snapshots__/CopyButton.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/UI/CopyButton/index.tsx delete mode 100644 app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.stories.tsx delete mode 100644 app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.styles.ts delete mode 100644 app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.test.tsx delete mode 100644 app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.tsx delete mode 100644 app/components/Views/confirmations/components/UI/ExpandableSection/__snapshots__/ExpandableSection.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/UI/ExpandableSection/index.ts delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoRow.styles.ts delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoRow.tsx delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoSection/InfoSection.styles.ts delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoSection/InfoSection.tsx delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoValue/InfoURL/InfoURL.styles.ts delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoValue/InfoURL/InfoURL.test.tsx delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoValue/InfoURL/InfoURL.tsx delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoValue/InfoURL/__snapshots__/InfoURL.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoValue/InfoURL/index.ts delete mode 100644 app/components/Views/confirmations/components/UI/InfoRow/InfoValue/InfoURL/style.ts delete mode 100644 app/components/Views/confirmations/components/UI/Tooltip/Tooltip.stories.tsx delete mode 100644 app/components/Views/confirmations/components/UI/Tooltip/Tooltip.styles.ts delete mode 100644 app/components/Views/confirmations/components/UI/Tooltip/Tooltip.test.tsx delete mode 100644 app/components/Views/confirmations/components/UI/Tooltip/Tooltip.tsx delete mode 100644 app/components/Views/confirmations/components/UI/Tooltip/__snapshots__/Tooltip.test.tsx.snap delete mode 100644 app/components/Views/confirmations/components/UI/Tooltip/index.ts delete mode 100644 app/components/Views/confirmations/hooks/useAccountInfo.test.ts delete mode 100644 app/components/Views/confirmations/hooks/useAccountInfo.ts delete mode 100644 app/components/hooks/MinimumVersions/useMinimumVersions.test.ts delete mode 100644 app/components/hooks/useOnboardingHeader.tsx delete mode 100644 app/core/Analytics/MetricsEventBuilder.test.ts delete mode 100644 app/core/Analytics/MetricsEventBuilder.ts delete mode 100644 app/core/createTracingMiddleware/index.test.ts delete mode 100644 app/core/createTracingMiddleware/index.ts delete mode 100644 app/images/networks1.png delete mode 100644 app/store/migrations/054.test.ts delete mode 100644 app/store/migrations/054.ts delete mode 100644 app/store/migrations/055.test.ts delete mode 100644 app/store/migrations/055.ts create mode 100644 app/store/storage-wrapper.js delete mode 100644 app/store/storage-wrapper.test.ts delete mode 100644 app/store/storage-wrapper.ts rename app/util/{transaction-reducer-helpers.ts => transaction-reducer-helpers.js} (64%) create mode 100644 e2e/pages/ImportAccountView.js delete mode 100644 e2e/pages/Ramps/BuildQuoteView.js delete mode 100644 e2e/pages/Ramps/BuyGetStartedView.js delete mode 100644 e2e/pages/Ramps/SelectPaymentMethodView.js delete mode 100644 e2e/pages/Ramps/SelectRegionView.js delete mode 100644 e2e/pages/importAccount/ImportAccountView.js delete mode 100644 e2e/pages/importAccount/SuccessImportAccountView.js delete mode 100644 e2e/selectors/ImportAccount/ImportAccountFromPrivateKey.selectors.js delete mode 100644 e2e/selectors/ImportAccount/SuccessImportAccount.selectors.js create mode 100644 e2e/selectors/ImportAccountFromPrivateKey.selectors.js delete mode 100644 e2e/selectors/Ramps/BuildQuote.selectors.js delete mode 100644 e2e/selectors/Ramps/GetStarted.selectors.js delete mode 100644 e2e/selectors/Ramps/SelectPaymentMethod.selectors.js delete mode 100644 e2e/selectors/Ramps/SelectRegion.selectors.js delete mode 100644 e2e/specs/ramps/onramp.spec.js delete mode 100644 patches/@metamask+assets-controllers++@metamask+preferences-controller+13.0.3.patch create mode 100644 patches/@metamask+assets-controllers+30.0.0.patch delete mode 100644 patches/@metamask+assets-controllers+32.0.0.patch create mode 100644 patches/@metamask+nonce-tracker+5.0.0.patch create mode 100644 patches/@metamask+transaction-controller+35.0.0.patch create mode 100644 patches/@react-native-community+datetimepicker+7.7.0.patch rename {.github/scripts => scripts}/get-next-semver-version.sh (100%) create mode 100644 wdio/screen-objects/testIDs/Screens/ImportAccountScreen.testIds.js create mode 100644 wdio/screen-objects/testIDs/Screens/ImportSuccessScreen.testIds.js create mode 100644 wdio/screen-objects/testIDs/Screens/LoginScreen.testIds.js create mode 100644 wdio/screen-objects/testIDs/Screens/RevelSecretRecoveryPhrase.testIds.js diff --git a/.depcheckrc.yml b/.depcheckrc.yml index f51f487fd9b2..e8fe7a446ec7 100644 --- a/.depcheckrc.yml +++ b/.depcheckrc.yml @@ -2,10 +2,10 @@ ignores: - '@metamask/oss-attribution-generator' - 'webpack-cli' + - '@react-native-community/datetimepicker' - '@react-native-community/slider' - 'patch-package' - '@lavamoat/allow-scripts' - - 'babel-plugin-inline-import' # This is used on the patch for TokenRatesController of Assets controllers, for we to be able to use the last version of it - cockatiel diff --git a/.detoxrc.js b/.detoxrc.js index ad9535112611..d637d3c937c0 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -26,7 +26,7 @@ module.exports = { configurations: { 'ios.sim.apiSpecs': { device: 'ios.simulator', - app: 'ios.qa', + app: 'ios.debug', testRunner: { args: { "$0": "node e2e/api-specs/run-api-spec-tests.js", @@ -41,9 +41,10 @@ module.exports = { device: 'ios.simulator', app: 'ios.release', }, - 'ios.sim.qa': { - device: 'ios.simulator', - app: 'ios.qa', + // because e2e run on debug mode in bitrise + 'android.emu.bitrise.debug': { + device: 'android.bitrise.emulator', + app: 'android.bitrise.debug', }, 'android.emu.debug': { @@ -85,21 +86,32 @@ module.exports = { binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/MetaMask.app', build: 'yarn start:ios:e2e', }, - 'ios.qa': { + 'ios.release': { type: 'ios.app', binaryPath: - 'ios/build/Build/Products/Release-iphonesimulator/MetaMask-QA.app', - build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:ios:qa", + 'ios/build/Build/Products/Release-iphonesimulator/MetaMask.app', + build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:ios:release:e2e", + }, + 'android.bitrise.debug': { + type: 'android.apk', + binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk', + build: 'yarn start:android:e2e', }, 'android.debug': { type: 'android.apk', binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk', build: 'yarn start:android:e2e', }, + 'android.release': { + type: 'android.apk', + binaryPath: + 'android/app/build/outputs/apk/prod/release/app-prod-release.apk', + build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:android:release:e2e", + }, 'android.qa': { type: 'android.apk', binaryPath: 'android/app/build/outputs/apk/qa/release/app-qa-release.apk', - build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa", + build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa:e2e", }, }, }; diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 594f7f4bf175..9de39ff6af2a 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,5 +2,3 @@ 57afe4ca921d85a51a923470239ca977fccbd1ae # Standardize prettier configuration https://github.com/MetaMask/metamask-mobile/pull/4182 bdb7f37c90e4fc923881a07fca38d4e77c73a579 -# Fix mixed tabs and spaces https://github.com/MetaMask/metamask-mobile/pull/1379 -9f9a1121c6899e06d4aeef29017bb479df142adb diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a483a7157ca7..727f5b7c4d0f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,7 +4,7 @@ * @MetaMask/mobile-devs # Design System Team -app/component-library/ @MetaMask/design-system-engineers +app/component-library/ @MetaMask/design-system-engineers @MetaMask/mobile-platform # Platform Team patches/ @MetaMask/mobile-platform @@ -94,25 +94,10 @@ app/components/Views/NftDetails @MetaMask/metamask-assets app/reducers/collectibles @MetaMask/metamask-assets # UX Team -app/components/Views/AccountActions @MetaMask/wallet-ux -app/components/Views/AccountSelector @MetaMask/wallet-ux -app/components/Views/AddressQRCode @MetaMask/wallet-ux -app/components/Views/EditAccountName @MetaMask/wallet-ux -app/components/Views/LockScreen @MetaMask/wallet-ux -app/components/Views/Login @MetaMask/wallet-ux -app/components/Views/NetworkConnect @MetaMask/wallet-ux -app/components/Views/NetworkSelector @MetaMask/wallet-ux -app/components/Views/Onboarding @MetaMask/wallet-ux -app/components/Views/OnboardingCarousel @MetaMask/wallet-ux -app/components/Views/OnboardingSuccess @MetaMask/wallet-ux -app/components/Views/QRAccountDisplay @MetaMask/wallet-ux -app/components/Views/QRScanner @MetaMask/wallet-ux -app/components/Views/Settings @MetaMask/wallet-ux -app/components/Views/TermsAndConditions @MetaMask/wallet-ux - -app/reducers/experimentalSettings @MetaMask/wallet-ux -app/reducers/modals @MetaMask/wallet-ux -app/reducers/navigation @MetaMask/wallet-ux -app/reducers/onboarding @MetaMask/wallet-ux -app/reducers/privacy @MetaMask/wallet-ux -app/reducers/settings @MetaMask/wallet-ux +app/components @MetaMask/wallet-ux +app/reducers/experimentalSettings @MetaMask/wallet-ux +app/reducers/modals @MetaMask/wallet-ux +app/reducers/navigation @MetaMask/wallet-ux +app/reducers/onboarding @MetaMask/wallet-ux +app/reducers/privacy @MetaMask/wallet-ux +app/reducers/settings @MetaMask/wallet-ux diff --git a/.github/workflows/add-release-label.yml b/.github/workflows/add-release-label.yml index 80941c645364..a5a4daa71037 100644 --- a/.github/workflows/add-release-label.yml +++ b/.github/workflows/add-release-label.yml @@ -30,7 +30,7 @@ jobs: id: get-next-semver-version env: FORCE_NEXT_SEMVER_VERSION: ${{ vars.FORCE_NEXT_SEMVER_VERSION }} - run: ./get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION" + run: ./scripts/get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION" working-directory: '.github/scripts' - name: Add release label to PR and linked issues diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 584e983f57cd..e1b92a4d58d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,18 @@ jobs: bundler-cache: true env: BUNDLE_GEMFILE: ios/Gemfile + - name: Determine whether the current PR is a draft + id: set-is-draft + if: github.event_name == 'pull_request' && github.event.pull_request.number + run: echo "IS_DRAFT=$(gh pr view --json isDraft --jq '.isDraft' "${PR_NUMBER}")" >> "$GITHUB_OUTPUT" + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Setup registry config for using package previews on draft PRs + if: github.event_name == 'pull_request' && steps.set-is-draft.outputs.IS_DRAFT == 'true' + run: printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${PACKAGE_READ_TOKEN}" > .npmrc + env: + PACKAGE_READ_TOKEN: ${{ secrets.PACKAGE_READ_TOKEN }} - run: yarn setup - name: Require clean working directory shell: bash @@ -167,14 +179,14 @@ jobs: with: name: ios-bundle path: ios/main.jsbundle - + ship-js-bundle-size-check: runs-on: ubuntu-latest needs: [js-bundle-size-check] if: ${{ github.ref == 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - + - name: Download iOS bundle uses: actions/download-artifact@v4 with: diff --git a/.iyarc b/.iyarc index abbf0e189d26..7fb6e40287c9 100644 --- a/.iyarc +++ b/.iyarc @@ -1,3 +1,7 @@ # ReDoS vulnerability, no impact to this application, and fix not backported yet to the versions we use GHSA-c2qf-rxjj-qqgw + +# Sentry SDK Prototype Pollution gadget in JavaScript SDKs + +GHSA-593m-55hh-j8gv diff --git a/.storybook/storybook.requires.js b/.storybook/storybook.requires.js index a1ca7774ac88..31f1669fd928 100644 --- a/.storybook/storybook.requires.js +++ b/.storybook/storybook.requires.js @@ -123,10 +123,7 @@ const getStories = () => { "./app/component-library/base-components/TagBase/TagBase.stories.tsx": require("../app/component-library/base-components/TagBase/TagBase.stories.tsx"), "./app/component-library/components-temp/TagColored/TagColored.stories.tsx": require("../app/component-library/components-temp/TagColored/TagColored.stories.tsx"), "./app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx": require("../app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx"), - "./app/components/Views/confirmations/components/UI/InfoRow/InfoRow.stories.tsx": require("../app/components/Views/confirmations/components/UI/InfoRow/InfoRow.stories.tsx"), - "./app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.stories.tsx": require("../app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.stories.tsx"), - "./app/components/Views/confirmations/components/UI/Tooltip/Tooltip.stories.tsx": require("../app/components/Views/confirmations/components/UI/Tooltip/Tooltip.stories.tsx"), - "./app/components/Views/confirmations/components/UI/CopyButton/CopyButton.stories.tsx": require("../app/components/Views/confirmations/components/UI/CopyButton/CopyButton.stories.tsx"), + "./app/components/UI/InfoRow/InfoRow.stories.tsx": require("../app/components/UI/InfoRow/InfoRow.stories.tsx"), }; }; diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e992dae2817..1afbe7ca3335 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,114 @@ ## Current Main Branch -## 7.32.0 - Oct 7, 2024 +## 7.33.0 - Oct 3, 2024 +### Added +- [#11507](https://github.com/MetaMask/metamask-mobile/pull/11507): feat: 10550 Re-introduce test for measuring cold app start + JS bundle load time (#11507) +- [#11347](https://github.com/MetaMask/metamask-mobile/pull/11347): "chore: revert ""feat: react native fast crypto for notifications"" (#11347)" +- [#11318](https://github.com/MetaMask/metamask-mobile/pull/11318): feat: app event manager and attribution id parameters (#11318) +- [#11445](https://github.com/MetaMask/metamask-mobile/pull/11445): feat: add the abilty to hide the disconnect all button as well as showing and hiding the accounts row when necessary (#11445) +- [#11386](https://github.com/MetaMask/metamask-mobile/pull/11386): feat(3299): add tracking to network switching and confirmation (#11386) +- [#11379](https://github.com/MetaMask/metamask-mobile/pull/11379): refactor: rename the feature flag since it had a typo (#11379) +- [#11239](https://github.com/MetaMask/metamask-mobile/pull/11239): feat(2739): permission summary view gets the ability to disconnect all (#11239) +- [#11382](https://github.com/MetaMask/metamask-mobile/pull/11382): chore(runway): cherry-pick feat: app event manager and attribution id parameters (#11382) +- [#11497](https://github.com/MetaMask/metamask-mobile/pull/11497): feat: simple key-> value component for text value type (#11497) +- [#11478](https://github.com/MetaMask/metamask-mobile/pull/11478): feat: adding title to confirmation page (#11478) +- [#11477](https://github.com/MetaMask/metamask-mobile/pull/11477): feat: adding footer section to confirmation page (#11477) +- [#11454](https://github.com/MetaMask/metamask-mobile/pull/11454): feat: adding very basic confirmation page hidden behind env var (#11454) +- [#11083](https://github.com/MetaMask/metamask-mobile/pull/11083): feat: bundle size check (#11083) +- [#11452](https://github.com/MetaMask/metamask-mobile/pull/11452): feat(ds): add ListItem top and bottom accessories (#11452) +- [#11387](https://github.com/MetaMask/metamask-mobile/pull/11387): feat: 10550 Re-introduce test for measuring cold app start + JS bundle load time (#11387) +- [#11464](https://github.com/MetaMask/metamask-mobile/pull/11464): feat: STAKE-804: build pooled staking empty state component (#11464) +- [#11399](https://github.com/MetaMask/metamask-mobile/pull/11399): feat: add learn more modal component for staking (#11399) +- [#11261](https://github.com/MetaMask/metamask-mobile/pull/11261): feat: STAKE-822 build your balance component (#11261) +- [#11294](https://github.com/MetaMask/metamask-mobile/pull/11294): feat: added KeyValueRow to component-library/components-temp (#11294) +- [#11185](https://github.com/MetaMask/metamask-mobile/pull/11185): "feat: display ""Snaps (Beta)"" decorator tag in accounts list (#11185)" +- [#10829](https://github.com/MetaMask/metamask-mobile/pull/10829): feat: Eth snap keyring (#10829) +- [#11455](https://github.com/MetaMask/metamask-mobile/pull/11455): feat: bootstrap a reset notifications feat (#11455) +- [#11466](https://github.com/MetaMask/metamask-mobile/pull/11466): feat: add support for external links (#11466) +- [#11429](https://github.com/MetaMask/metamask-mobile/pull/11429): feat: add timeout handler (#11429) +- [#11427](https://github.com/MetaMask/metamask-mobile/pull/11427): feat: add feature announcements channel for android (#11427) +- [#11250](https://github.com/MetaMask/metamask-mobile/pull/11250): fix: push notifications (#11250) +- [#11069](https://github.com/MetaMask/metamask-mobile/pull/11069): feat: react native fast crypto for notifications (#11069) + +### Changed +- [#11615](https://github.com/MetaMask/metamask-mobile/pull/11615): chore: exclude temporarily sentry SDK advisory (#11615) +- [#11577](https://github.com/MetaMask/metamask-mobile/pull/11577): ci: disable swaps e2e workflow (#11577) +- [#11350](https://github.com/MetaMask/metamask-mobile/pull/11350): chore: replace Segment patch by plugin (#11350) +- [#11287](https://github.com/MetaMask/metamask-mobile/pull/11287): chore: remove unused events (#11287) +- [#11512](https://github.com/MetaMask/metamask-mobile/pull/11512): fix: android firebase docs template (#11512) +- [#11517](https://github.com/MetaMask/metamask-mobile/pull/11517): chore: delete swaps token charts test (#11517) +- [#11515](https://github.com/MetaMask/metamask-mobile/pull/11515): test: disable swaps token charts regression tests (#11515) +- [#11504](https://github.com/MetaMask/metamask-mobile/pull/11504): chore: revert measuring with react native performance (#11504) +- [#11458](https://github.com/MetaMask/metamask-mobile/pull/11458): test: Merge Import Token flow methods and ids in just one folder and files (#11458) +- [#11492](https://github.com/MetaMask/metamask-mobile/pull/11492): chore(revert): Prevent redundant Sentry sourcemap uploads (#11492) +- [#11469](https://github.com/MetaMask/metamask-mobile/pull/11469): test: Remove E2E Tests for Features No Longer Present in the App (#11469) +- [#11425](https://github.com/MetaMask/metamask-mobile/pull/11425): chore: Add skip label to bypass sonarcloud (#11425) +- [#11275](https://github.com/MetaMask/metamask-mobile/pull/11275): chore(js-ts): Convert app/util/bytes.js to TypeScript (#11275) +- [#11418](https://github.com/MetaMask/metamask-mobile/pull/11418): chore: revert chore(js-ts): Migrate 37 0-error js files (#11418) +- [#10880](https://github.com/MetaMask/metamask-mobile/pull/10880): chore: Enable linting Pods and re-organize setup.mjs file (#10880) +- [#11311](https://github.com/MetaMask/metamask-mobile/pull/11311): chore(js-ts): Convert app/components/UI/Swaps/components/Ratio.js to TypeScript (#11311) +- [#11357](https://github.com/MetaMask/metamask-mobile/pull/11357): chore(js-ts): Convert app/components/Views/PickComponent/index.js to TypeScript (#11357) +- [#11446](https://github.com/MetaMask/metamask-mobile/pull/11446): chore(js-ts): Convert app/components/Views/MediaPlayer/Loader.js to TypeScript (#11446) +- [#11473](https://github.com/MetaMask/metamask-mobile/pull/11473): chore(js-ts): Convert app/components/Base/ModalHandler.js to TypeScript (#11473) +- [#11601](https://github.com/MetaMask/metamask-mobile/pull/11601): chore(js-ts): Convert app/components/Base/ListItem.js to TypeScript (#11601) +- [#11407](https://github.com/MetaMask/metamask-mobile/pull/11407): chore(js-ts): Convert app/util/jsonRpcRequest.js to TypeScript (#11407) +- [#11594](https://github.com/MetaMask/metamask-mobile/pull/11594): chore(js-ts): Convert app/component-library/components/Icons/Icon/scripts/generate-assets.js to TypeScript (#11594) +- [#11523](https://github.com/MetaMask/metamask-mobile/pull/11523): chore(js-ts): Convert app/components/UI/GenericButton/index.ios.js to TypeScript (#11523) +- [#11472](https://github.com/MetaMask/metamask-mobile/pull/11472): chore(js-ts): Convert app/components/UI/FadeView/index.js to TypeScript (#11472) +- [#11476](https://github.com/MetaMask/metamask-mobile/pull/11476): chore(js-ts): Convert app/components/UI/OnboardingProgress/index.js to TypeScript (#11476) +- [#11405](https://github.com/MetaMask/metamask-mobile/pull/11405): chore(js-ts): Convert app/util/browserScripts.js to TypeScript (#11405) +- [#11214](https://github.com/MetaMask/metamask-mobile/pull/11214): chore(js-ts): Migrate 37 0-error js files (#11214) +- [#11271](https://github.com/MetaMask/metamask-mobile/pull/11271): chore(js-ts): Convert app/components/UI/ComponentErrorBoundary/index.js to TypeScript (#11271) +- [#11299](https://github.com/MetaMask/metamask-mobile/pull/11299): chore(js-ts): Convert app/util/validators/index.js to TypeScript (#11299) +- [#11303](https://github.com/MetaMask/metamask-mobile/pull/11303): chore(js-ts): Convert app/components/Base/SelectorButton.js to TypeScript (#11303) +- [#11280](https://github.com/MetaMask/metamask-mobile/pull/11280): chore(js-ts): Convert app/components/UI/GenericButton/index.android.js to TypeScript (#11280) +- [#11273](https://github.com/MetaMask/metamask-mobile/pull/11273): chore(js-ts): Convert app/components/UI/OnboardingScreenWithBg/index.js to TypeScript (#11273) +- [#11272](https://github.com/MetaMask/metamask-mobile/pull/11272): chore(js-ts): Convert app/components/Base/ModalDragger.js to TypeScript (#11272) +- [#11308](https://github.com/MetaMask/metamask-mobile/pull/11308): chore(js-ts): Convert app/components/UI/BlockingActionModal/index.js to TypeScript (#11308) +- [#11305](https://github.com/MetaMask/metamask-mobile/pull/11305): chore(js-ts): Convert app/components/Base/Summary.js to TypeScript (#11305) +- [#11274](https://github.com/MetaMask/metamask-mobile/pull/11274): chore(js-ts): Convert app/components/UI/ConnectHeader/index.js to TypeScript (#11274) +- [#11334](https://github.com/MetaMask/metamask-mobile/pull/11334): chore: chore/7.32.0-Changelog (#11334) +- [#11483](https://github.com/MetaMask/metamask-mobile/pull/11483): chore: refactor e2e (#11483) +- [#11491](https://github.com/MetaMask/metamask-mobile/pull/11491): chore: Add UX CodeOwners responsibilities (#11491) +- [#11364](https://github.com/MetaMask/metamask-mobile/pull/11364): refactor(1702-2): auto detect nft component (#11364) +- [#11363](https://github.com/MetaMask/metamask-mobile/pull/11363): refactor(1702-1): auto detect tokens component (#11363) +- [#11329](https://github.com/MetaMask/metamask-mobile/pull/11329): chore: Add `@MetaMask/metamask-assets` to `CODEOWNERS` (#11329) +- [#10449](https://github.com/MetaMask/metamask-mobile/pull/10449): chore: remove installation of redundant detox-cli in bitrise (#10449) +- [#11111](https://github.com/MetaMask/metamask-mobile/pull/11111): chore(deps): Bump `@metamask/phishing-controller` from `^9.0.0` to `^12.0.1` (#11111) +- [#11375](https://github.com/MetaMask/metamask-mobile/pull/11375): chore(deps): Bump `@metamask/controller-utils` from `^10.0.0` to `^11.3.0` (#11375) +- [#11140](https://github.com/MetaMask/metamask-mobile/pull/11140): chore(deps): Bump `@metamask/smart-transactions-controller` from `11.0.0` to `^13.0.0` (#11140) +- [#11351](https://github.com/MetaMask/metamask-mobile/pull/11351): chore(deps): Bump `@metamask/keyring-controller` from `^16.1.0` to `^17.2.1` (#11351) +- [#11104](https://github.com/MetaMask/metamask-mobile/pull/11104): chore(deps): Bump `@metamask/address-book-controller` from `^4.0.1` to `^6.0.1` (#11104) +- [#10917](https://github.com/MetaMask/metamask-mobile/pull/10917): chore(ci): split out ci scripts and devDeps into separate project (#10917) +- [#11081](https://github.com/MetaMask/metamask-mobile/pull/11081): chore: Prevent redundant Sentry sourcemap uploads (#11081) +- [#11430](https://github.com/MetaMask/metamask-mobile/pull/11430): fix: refactor Logger usage (#11430) +- [#11470](https://github.com/MetaMask/metamask-mobile/pull/11470): chore: [Design quality] Update token details (#11470) +- [#11439](https://github.com/MetaMask/metamask-mobile/pull/11439): "chore: cherry-pick fix: ""chore(deps): Bump @metamask/base-controller from ^6.0.0 to ^7.0.0 (#11207)"" (#11439)" +- [#11169](https://github.com/MetaMask/metamask-mobile/pull/11169): "chore(deps): Bump `@metamask/signature-controller` from `^17.0.0` to `^19.1.0` +- [#11352](https://github.com/MetaMask/metamask-mobile/pull/11352): "chore(deps): Bump `@metamask/accounts-controller` to `^18.2.1` +### Fixed +- [#11581](https://github.com/MetaMask/metamask-mobile/pull/11581): fix: Fix invalid browser url crash (#11581) +- [#11467](https://github.com/MetaMask/metamask-mobile/pull/11467): fix: Reorder prep_environment (#11467) +- [#11367](https://github.com/MetaMask/metamask-mobile/pull/11367): fix: Update steps of the methods that are no longer valid (#11367) +- [#11400](https://github.com/MetaMask/metamask-mobile/pull/11400): fix: Stop crowdin action from creating branches (#11400) +- [#11348](https://github.com/MetaMask/metamask-mobile/pull/11348): fix: splash screen image on android (#11348) +- [#11346](https://github.com/MetaMask/metamask-mobile/pull/11346): fix: splash screen image on android (#11346) +- [#11554](https://github.com/MetaMask/metamask-mobile/pull/11554): fix: Fix/use portfolio home page (#11554) +- [#11443](https://github.com/MetaMask/metamask-mobile/pull/11443): fix: react native quick crypto ios build bug (#11443) +- [#11325](https://github.com/MetaMask/metamask-mobile/pull/11325): fix: loader can display on top of login screen (#11325) +- [#11372](https://github.com/MetaMask/metamask-mobile/pull/11372): fix: origin spoofing vulnerability in signature prompts on iOS (#11372) +- [#11076](https://github.com/MetaMask/metamask-mobile/pull/11076): fix(2453): adjust UI details for account cell on wallet screen (#11076) +- [#11524](https://github.com/MetaMask/metamask-mobile/pull/11524): fix: fix duplicated network select (#11524) +- [#11411](https://github.com/MetaMask/metamask-mobile/pull/11411): fix: fix fixture builder network state (#11411) +- [#11380](https://github.com/MetaMask/metamask-mobile/pull/11380): fix: Unreadable Asset options (#11380) +- [#11321](https://github.com/MetaMask/metamask-mobile/pull/11321): fix: fix detect tokens performance (#11321) +- [#11401](https://github.com/MetaMask/metamask-mobile/pull/11401): fix: replace decomissioned cloudflare-ipfs.com with gateway.pinata.cloud (#11401) +- [#11552](https://github.com/MetaMask/metamask-mobile/pull/11552): fix(11481): android system alert respects dark mode themes (#11552) +- [#11518](https://github.com/MetaMask/metamask-mobile/pull/11518): fix(11482): incorrect QR code error (#11518) + +## 7.32.0 - Oct 7, 2024 ### Added - [#10294](https://github.com/MetaMask/metamask-mobile/pull/10294): feat: create redux slice for featureFlags (#10294) @@ -364,7 +470,10 @@ - [#10383](https://github.com/MetaMask/metamask-mobile/pull/10383): fix: race condition issues when doing batch-rpc calls in the DeeplinkProtocolService (#10383) - [#10365](https://github.com/MetaMask/metamask-mobile/pull/10365): fix: attribution link (#10365) - [#10303](https://github.com/MetaMask/metamask-mobile/pull/10303): fix: page navigation during QR accounts selection (#10303) +<<<<<<< HEAD +======= +>>>>>>> main ## 7.28.1 - Aug 15, 2024 ### Fixed - [#10637](https://github.com/MetaMask/metamask-mobile/pull/10637): fix: swap button blocked by SwapsController polling issue (#10637) diff --git a/android/app/build.gradle b/android/app/build.gradle index 80ffad8fa282..6a40a9f84ba1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -173,8 +173,8 @@ android { applicationId "io.metamask" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1450 - versionName "7.32.0" + versionName "7.33.0" + versionCode 1456 testBuildType System.getProperty('testBuildType', 'debug') missingDimensionStrategy 'react-native-camera', 'general' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -229,7 +229,7 @@ android { release { manifestPlaceholders.isDebug = false minifyEnabled enableProguardInReleaseBuilds - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules.pro" + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } diff --git a/app/actions/notification/constants/index.ts b/app/actions/notification/constants/index.ts index ee8c63fdffa7..c75c9eb00820 100644 --- a/app/actions/notification/constants/index.ts +++ b/app/actions/notification/constants/index.ts @@ -19,7 +19,6 @@ export enum notificationsErrors { UPDATE_TRIGGER_PUSH_NOTIFICATIONS = 'Error while trying to update trigger push notifications', ENABLE_NOTIFICATIONS_SERVICES = 'Error while trying to enable notifications services', DISABLE_NOTIFICATIONS_SERVICES = 'Error while trying to disable notifications services', - DELETE_STORAGE_KEY = 'Error while trying to delete storage key', } export default notificationsErrors; diff --git a/app/actions/notification/helpers/index.ts b/app/actions/notification/helpers/index.ts index 9f47da07f88e..0cd827ad3ef5 100644 --- a/app/actions/notification/helpers/index.ts +++ b/app/actions/notification/helpers/index.ts @@ -171,20 +171,3 @@ export const markMetamaskNotificationsAsRead = async ( return getErrorMessage(error); } }; -/** - * Perform the deletion of the notifications storage key and the creation of on chain triggers to reset the notifications. - * - * @returns {Promise} A promise that resolves to a string error message or undefined if successful. - */ -export const performDeleteStorage = async (): Promise => { - try { - await Engine.context.UserStorageController.performDeleteStorage('notifications.notification_settings'); - await Engine.context.NotificationServicesController.createOnChainTriggers( - { - resetNotifications: true, - }, - ); - } catch (error) { - return getErrorMessage(error); - } -}; diff --git a/app/actions/security/index.ts b/app/actions/security/index.ts index 661c1d1119d0..e0e87a0ef550 100644 --- a/app/actions/security/index.ts +++ b/app/actions/security/index.ts @@ -8,7 +8,6 @@ export enum ActionType { SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN = 'SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN', SET_DATA_COLLECTION_FOR_MARKETING = 'SET_DATA_COLLECTION_FOR_MARKETING', SET_NFT_AUTO_DETECTION_MODAL_OPEN = 'SET_NFT_AUTO_DETECTION_MODAL_OPEN', - SET_MULTI_RPC_MIGRATION_MODAL_OPEN = 'SET_MULTI_RPC_MIGRATION_MODAL_OPEN', } export interface AllowLoginWithRememberMeUpdated @@ -36,11 +35,6 @@ export interface SetNftAutoDetectionModalOpen open: boolean; } -export interface SetMultiRpcMigrationModalOpen - extends ReduxAction { - open: boolean; -} - export interface SetDataCollectionForMarketing extends ReduxAction { enabled: boolean; @@ -52,8 +46,7 @@ export type Action = | UserSelectedAutomaticSecurityChecksOptions | SetAutomaticSecurityChecksModalOpen | SetDataCollectionForMarketing - | SetNftAutoDetectionModalOpen - | SetMultiRpcMigrationModalOpen; + | SetNftAutoDetectionModalOpen; export const setAllowLoginWithRememberMe = ( enabled: boolean, @@ -89,13 +82,6 @@ export const setNftAutoDetectionModalOpen = ( open, }); -export const setMultiRpcMigrationModalOpen = ( - open: boolean, -): SetMultiRpcMigrationModalOpen => ({ - type: ActionType.SET_MULTI_RPC_MIGRATION_MODAL_OPEN, - open, -}); - export const setDataCollectionForMarketing = (enabled: boolean) => ({ type: ActionType.SET_DATA_COLLECTION_FOR_MARKETING, enabled, diff --git a/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx b/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx index e18ed0465956..ff8df60913ae 100644 --- a/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx +++ b/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx @@ -33,7 +33,6 @@ const CellSelectWithMenu = ({ tagLabel, isSelected = false, children, - withAvatar = true, ...props }: CellSelectWithMenuProps) => { const { styles } = useStyles(styleSheet, { style }); @@ -47,15 +46,12 @@ const CellSelectWithMenu = ({ > {/* DEV Note: Account Avatar should be replaced with Avatar with Badge whenever available */} - {withAvatar ? ( - - ) : null} - + @@ -14,10 +16,10 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] = disabled={false} style={ { - "flex": 1, "opacity": 1, "padding": 16, "position": "relative", + "width": "95%", "zIndex": 1, } } @@ -285,13 +287,7 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] = - + { +const KeyValueRowLabel = ({ + label, + variant = TextVariant.BodyMDMedium, + color = TextColor.Default, + tooltip, +}: KeyValueRowLabelProps) => { const { styles } = useStyles(styleSheet, {}); const { openTooltipModal } = useTooltipModal(); - const hasTooltip = tooltip?.title && tooltip?.content; + const hasTooltip = tooltip?.title && tooltip?.text; const onNavigateToTooltipModal = () => { if (!hasTooltip) return; - openTooltipModal(tooltip.title, tooltip.content); + openTooltipModal(tooltip.title, tooltip.text); }; return ( - {isPreDefinedKeyValueRowLabel(label) ? ( - - ) : ( - label - )} + {hasTooltip && ( )} diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx b/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx index ee34ef3c4b43..e5a440b32763 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx @@ -8,7 +8,6 @@ import KeyValueRowComponent, { import Text, { TextColor, TextVariant } from '../../components/Texts/Text'; import Title from '../../../components/Base/Title'; import { IconColor, IconName, IconSize } from '../../components/Icons/Icon'; -import Button, { ButtonVariants } from '../../components/Buttons/Button'; const KeyValueRowMeta = { title: 'Components Temp / KeyValueRow', @@ -39,56 +38,42 @@ export const KeyValueRow = { - {/* Using Custom ReactNode */} - alert('test')} - /> - ), - }} - /> ), diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx b/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx index 389a3213db5f..a9b00ece7e86 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx @@ -19,8 +19,8 @@ describe('KeyValueRow', () => { it('should render when there is only text', () => { const { toJSON } = render( , ); @@ -31,17 +31,17 @@ describe('KeyValueRow', () => { const { toJSON } = render( , @@ -54,13 +54,13 @@ describe('KeyValueRow', () => { const { toJSON } = render( { const { toJSON } = render( , diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx b/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx index 212396f888e6..18c6300b1cfa 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx @@ -8,6 +8,7 @@ import { } from './KeyValueRow.types'; import Icon from '../../components/Icons/Icon'; import { View } from 'react-native'; +import { areKeyValueRowPropsEqual } from './KeyValueRow.utils'; import KeyValueSection from './KeyValueSection/KeyValueSection'; import KeyValueRowLabel from './KeyValueLabel/KeyValueLabel'; import KeyValueRowRoot from './KeyValueRoot/KeyValueRoot'; @@ -44,7 +45,12 @@ const KeyValueRow = React.memo(({ field, value, style }: KeyValueRowProps) => { (fieldIcon.side === KeyValueRowFieldIconSides.LEFT || fieldIcon.side === KeyValueRowFieldIconSides.BOTH || !fieldIcon?.side) && } - + {shouldShowFieldIcon && (fieldIcon?.side === KeyValueRowFieldIconSides.RIGHT || fieldIcon?.side === KeyValueRowFieldIconSides.BOTH) && ( @@ -58,7 +64,12 @@ const KeyValueRow = React.memo(({ field, value, style }: KeyValueRowProps) => { (valueIcon?.side === KeyValueRowFieldIconSides.LEFT || valueIcon?.side === KeyValueRowFieldIconSides.BOTH || !valueIcon?.side) && } - + {shouldShowValueIcon && (valueIcon?.side === KeyValueRowFieldIconSides.RIGHT || valueIcon?.side === KeyValueRowFieldIconSides.BOTH) && ( @@ -68,7 +79,7 @@ const KeyValueRow = React.memo(({ field, value, style }: KeyValueRowProps) => { ); -}); +}, areKeyValueRowPropsEqual); /** * Exported sub-components to provide a base for new KeyValueRow variants. diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts b/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts index fc4e825921e4..0e9c864d3095 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts @@ -19,9 +19,9 @@ interface KeyValueRowTooltip { */ title: string; /** - * The content displayed within the tooltip body. + * The text displayed within the tooltip body. */ - content: string | ReactNode; + text: string; /** * Optional size of the tooltip icon. * @default TooltipSizes.Md @@ -47,9 +47,19 @@ export enum KeyValueRowFieldIconSides { */ interface KeyValueRowField { /** - * The label content displayed. + * The text to display. + */ + text: string; + /** + * Optional text variant. + * @default TextVariant.BodyMDMedium */ - label: PreDefinedKeyValueRowLabel | ReactNode; + variant?: TextProps['variant']; + /** + * Optional text color. + * @default TextColor.Default + */ + color?: TextProps['color']; /** * Optional icon to display. If undefined, no icon is displayed. */ @@ -64,11 +74,16 @@ export const IconSizes = IconSize; export const TooltipSizes = ButtonIconSizes; -export interface PreDefinedKeyValueRowLabel { +/** + * The KeyValueRowLabel prop interface. + * + * @see KeyValueRowLabel in ./KeyValueRow.tsx + */ +export interface KeyValueRowLabelProps { /** * Text to display. */ - text: string; + label: string; /** * Optional text variant. * @default TextVariant.BodyMDMedium @@ -79,18 +94,6 @@ export interface PreDefinedKeyValueRowLabel { * @default TextColor.Default */ color?: TextProps['color']; -} - -/** - * The KeyValueRowLabel prop interface. - * - * @see KeyValueRowLabel in ./KeyValueRow.tsx - */ -export interface KeyValueRowLabelProps { - /** - * The label content displayed. - */ - label: PreDefinedKeyValueRowLabel | ReactNode; /** * Optional tooltip. If undefined, the tooltip won't be displayed. */ diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts b/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts index 3361cb4d66f5..bf4c38843e43 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts @@ -1,9 +1,8 @@ -import { - KeyValueRowLabelProps, - PreDefinedKeyValueRowLabel, -} from './KeyValueRow.types'; +import { KeyValueRowProps } from './KeyValueRow.types'; -export const isPreDefinedKeyValueRowLabel = ( - label: KeyValueRowLabelProps['label'], -): label is PreDefinedKeyValueRowLabel => - !!label && typeof label === 'object' && 'text' in label; +export const areKeyValueRowPropsEqual = ( + prevProps: KeyValueRowProps, + newProps: KeyValueRowProps, +) => + JSON.stringify(prevProps.field) === JSON.stringify(newProps.field) && + JSON.stringify(prevProps.value) === JSON.stringify(newProps.value); diff --git a/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap b/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap index a4c9e5f6bfef..c83d3a4fd5fa 100644 --- a/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap +++ b/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap @@ -201,7 +201,7 @@ exports[`KeyValueRow Prebuilt Component KeyValueRow should render text with icon Key Text { const { getByRole } = render( , @@ -66,9 +64,7 @@ describe('ListItemMultiSelectButton', () => { const { getByTestId } = render( , diff --git a/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx b/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx index a3cb0d079ffc..e8610e457352 100644 --- a/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx +++ b/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx @@ -20,12 +20,6 @@ import { IconColor, IconName, } from '../../../component-library/components/Icons/Icon'; -import Button, { - ButtonSize, - ButtonVariants, - ButtonWidthTypes, -} from '../../../component-library/components/Buttons/Button'; -import { TextVariant } from '../../../component-library/components/Texts/Text'; const ListItemMultiSelectButton: React.FC = ({ style, @@ -33,9 +27,7 @@ const ListItemMultiSelectButton: React.FC = ({ isDisabled = false, children, gap = DEFAULT_LISTITEMMULTISELECT_GAP, - showButtonIcon = true, buttonIcon = IconName.MoreVertical, - buttonProps, ...props }) => { const { styles } = useStyles(styleSheet, { @@ -63,29 +55,15 @@ const ListItemMultiSelectButton: React.FC = ({ )} - {showButtonIcon ? ( - - - - ) : null} - {buttonProps?.textButton ? ( - -