From 561124dd0d7f49bef95bede7887faa819c915b51 Mon Sep 17 00:00:00 2001 From: metamaskbot Date: Fri, 14 Jul 2023 14:34:07 +0000 Subject: [PATCH 01/11] 7.4.0 --- CHANGELOG.md | 22 ++++++++++++++++++++++ android/app/build.gradle | 6 +++--- bitrise.yml | 4 ++-- ios/MetaMask.xcodeproj/project.pbxproj | 16 ++++++++-------- package.json | 2 +- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb0c20f58b0..0d850855e02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,28 @@ # Changelog ## Current Main Branch +- [#6805](https://github.com/MetaMask/metamask-mobile/pull/6805): feat(on-ramp): upgrade on-ramp SDK with apple pay support +- [#6804](https://github.com/MetaMask/metamask-mobile/pull/6804): refactor(on-ramp): refactor quotes screen +- [#6747](https://github.com/MetaMask/metamask-mobile/pull/6747): feat: 7.3.0 +- [#6679](https://github.com/MetaMask/metamask-mobile/pull/6679): feat(on-ramp): upgrade on-ramp-sdk to v1.22.0 with abort controller support +- [#6784](https://github.com/MetaMask/metamask-mobile/pull/6784): refactor: Use selectors for token list controller state access +- [#6799](https://github.com/MetaMask/metamask-mobile/pull/6799): feat: prioritize resume over deeplink to accelerate reconnection flow +- [#6758](https://github.com/MetaMask/metamask-mobile/pull/6758): refactor: Use selectors for tokens controller state access +- [#6795](https://github.com/MetaMask/metamask-mobile/pull/6795): feat(MMPD-546): update portfolio icon +- [#6738](https://github.com/MetaMask/metamask-mobile/pull/6738): feat: add approval flow success and error pages +- [#6782](https://github.com/MetaMask/metamask-mobile/pull/6782): feat: wc2 dependencies update and handle switchNetwork +- [#6796](https://github.com/MetaMask/metamask-mobile/pull/6796): ci: Fix pipelines to reflect running tests on android detox +- [#6766](https://github.com/MetaMask/metamask-mobile/pull/6766): Added horizontalAlignment to Accordions +- [#6755](https://github.com/MetaMask/metamask-mobile/pull/6755): feat: sdk protocol update +- [#6754](https://github.com/MetaMask/metamask-mobile/pull/6754): fix: sending an ERC20 token with an amount with more decimals than the token decimal, results in nothing +- [#6384](https://github.com/MetaMask/metamask-mobile/pull/6384): test: Add android detox coverage with new RN upgrade +- [#6790](https://github.com/MetaMask/metamask-mobile/pull/6790): fix: update snapshot for linea mainnet +- [#6587](https://github.com/MetaMask/metamask-mobile/pull/6587): [FIX] Improves handling of missing WCv2 Project ID +- [#6772](https://github.com/MetaMask/metamask-mobile/pull/6772): fix: update cookie-tough dependency +- [#6739](https://github.com/MetaMask/metamask-mobile/pull/6739): fix: deeplink connection using metamask://connect +- [#6753](https://github.com/MetaMask/metamask-mobile/pull/6753): fix: Delete collectible media reproductor +- [#6752](https://github.com/MetaMask/metamask-mobile/pull/6752): refactor: Use selectors for currency rate controller state access +- [#6745](https://github.com/MetaMask/metamask-mobile/pull/6745): Add delay for browser permission dialog ## 7.3.0 - Jul 13, 2023 ### Added diff --git a/android/app/build.gradle b/android/app/build.gradle index 4b8fc6e01e2..12206de3179 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -137,8 +137,8 @@ android { applicationId "io.metamask" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1144 - versionName "7.3.0" + versionCode 1148 + versionName "7.4.0" testBuildType System.getProperty('testBuildType', 'debug') missingDimensionStrategy 'react-native-camera', 'general' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -217,7 +217,7 @@ android { variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html - // Example: versionCode 1143 will generate 1001 for armeabi-v7a, 1002 for x86, etc. + // Example: versionCode 1148 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants diff --git a/bitrise.yml b/bitrise.yml index 69a2b8e3811..fb11791b198 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -740,10 +740,10 @@ app: PROJECT_LOCATION_IOS: ios - opts: is_expand: false - VERSION_NAME: 7.3.0 + VERSION_NAME: 7.4.0 - opts: is_expand: false - VERSION_NUMBER: 1144 + VERSION_NUMBER: 1148 - opts: is_expand: false ANDROID_APK_LINK: '' diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index ef19a100ff6..d9fcfb07fae 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -1039,7 +1039,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1144; + CURRENT_PROJECT_VERSION = 1148; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1073,7 +1073,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; LLVM_LTO = YES; - MARKETING_VERSION = 7.3.0; + MARKETING_VERSION = 7.4.0; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "$(inherited)", @@ -1105,7 +1105,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1144; + CURRENT_PROJECT_VERSION = 1148; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG; @@ -1139,7 +1139,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; LLVM_LTO = YES; - MARKETING_VERSION = 7.3.0; + MARKETING_VERSION = 7.4.0; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "$(inherited)", @@ -1251,7 +1251,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1144; + CURRENT_PROJECT_VERSION = 1148; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1288,7 +1288,7 @@ "\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"", ); LLVM_LTO = YES; - MARKETING_VERSION = 7.3.0; + MARKETING_VERSION = 7.4.0; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "$(inherited)", @@ -1320,7 +1320,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1144; + CURRENT_PROJECT_VERSION = 1148; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG; @@ -1357,7 +1357,7 @@ "\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"", ); LLVM_LTO = YES; - MARKETING_VERSION = 7.3.0; + MARKETING_VERSION = 7.4.0; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "$(inherited)", diff --git a/package.json b/package.json index 683673bed1c..ea291c3f80a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask", - "version": "7.3.0", + "version": "7.4.0", "private": true, "scripts": { "audit:ci": "./scripts/yarn-audit.sh", From 3f7eafc71ca06430dab85abd77e0ffee96a027b3 Mon Sep 17 00:00:00 2001 From: sethkfman Date: Fri, 14 Jul 2023 09:06:36 -0600 Subject: [PATCH 02/11] updated format changelog --- CHANGELOG.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d850855e02..281aeb83338 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,28 +1,33 @@ # Changelog ## Current Main Branch + +## 7.4.0 - Jul 14, 2023 +### Added - [#6805](https://github.com/MetaMask/metamask-mobile/pull/6805): feat(on-ramp): upgrade on-ramp SDK with apple pay support -- [#6804](https://github.com/MetaMask/metamask-mobile/pull/6804): refactor(on-ramp): refactor quotes screen -- [#6747](https://github.com/MetaMask/metamask-mobile/pull/6747): feat: 7.3.0 - [#6679](https://github.com/MetaMask/metamask-mobile/pull/6679): feat(on-ramp): upgrade on-ramp-sdk to v1.22.0 with abort controller support -- [#6784](https://github.com/MetaMask/metamask-mobile/pull/6784): refactor: Use selectors for token list controller state access - [#6799](https://github.com/MetaMask/metamask-mobile/pull/6799): feat: prioritize resume over deeplink to accelerate reconnection flow -- [#6758](https://github.com/MetaMask/metamask-mobile/pull/6758): refactor: Use selectors for tokens controller state access - [#6795](https://github.com/MetaMask/metamask-mobile/pull/6795): feat(MMPD-546): update portfolio icon - [#6738](https://github.com/MetaMask/metamask-mobile/pull/6738): feat: add approval flow success and error pages - [#6782](https://github.com/MetaMask/metamask-mobile/pull/6782): feat: wc2 dependencies update and handle switchNetwork -- [#6796](https://github.com/MetaMask/metamask-mobile/pull/6796): ci: Fix pipelines to reflect running tests on android detox -- [#6766](https://github.com/MetaMask/metamask-mobile/pull/6766): Added horizontalAlignment to Accordions +- [#6766](https://github.com/MetaMask/metamask-mobile/pull/6766): feat: Added horizontalAlignment to Accordions - [#6755](https://github.com/MetaMask/metamask-mobile/pull/6755): feat: sdk protocol update + +### Changed +- [#6804](https://github.com/MetaMask/metamask-mobile/pull/6804): refactor(on-ramp): refactor quotes screen +- [#6784](https://github.com/MetaMask/metamask-mobile/pull/6784): refactor: Use selectors for token list controller state access +- [#6758](https://github.com/MetaMask/metamask-mobile/pull/6758): refactor: Use selectors for tokens controller state access +- [#6758](https://github.com/MetaMask/metamask-mobile/pull/6758): refactor: Use selectors for tokens controller state access +- [#6796](https://github.com/MetaMask/metamask-mobile/pull/6796): ci: Fix pipelines to reflect running tests on android detox +- [#6752](https://github.com/MetaMask/metamask-mobile/pull/6752): refactor: Use selectors for currency rate controller state access + +### Fixed - [#6754](https://github.com/MetaMask/metamask-mobile/pull/6754): fix: sending an ERC20 token with an amount with more decimals than the token decimal, results in nothing -- [#6384](https://github.com/MetaMask/metamask-mobile/pull/6384): test: Add android detox coverage with new RN upgrade - [#6790](https://github.com/MetaMask/metamask-mobile/pull/6790): fix: update snapshot for linea mainnet -- [#6587](https://github.com/MetaMask/metamask-mobile/pull/6587): [FIX] Improves handling of missing WCv2 Project ID +- [#6587](https://github.com/MetaMask/metamask-mobile/pull/6587): fix: Improves handling of missing WCv2 Project ID - [#6772](https://github.com/MetaMask/metamask-mobile/pull/6772): fix: update cookie-tough dependency - [#6739](https://github.com/MetaMask/metamask-mobile/pull/6739): fix: deeplink connection using metamask://connect - [#6753](https://github.com/MetaMask/metamask-mobile/pull/6753): fix: Delete collectible media reproductor -- [#6752](https://github.com/MetaMask/metamask-mobile/pull/6752): refactor: Use selectors for currency rate controller state access -- [#6745](https://github.com/MetaMask/metamask-mobile/pull/6745): Add delay for browser permission dialog ## 7.3.0 - Jul 13, 2023 ### Added From a9aded316d7a33560491ae650705e57fa597e1dc Mon Sep 17 00:00:00 2001 From: Pedro Pablo Aste Kompen Date: Mon, 17 Jul 2023 11:42:11 -0400 Subject: [PATCH 03/11] fix: define ReactNativePayments podspec path in podfile (#6821) --- ios/Podfile | 1 + ios/Podfile.lock | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ios/Podfile b/ios/Podfile index c16dfd242a5..1abfef98521 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -79,6 +79,7 @@ def common_target_logic # Pods for MetaMask pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS' + pod 'ReactNativePayments', :path => '../node_modules/@exodus/react-native-payments/lib/ios/' end target 'MetaMask' do diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ad7018b57f3..f6eb50309a4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -448,6 +448,8 @@ PODS: - React-jsi (= 0.71.6) - React-logger (= 0.71.6) - React-perflogger (= 0.71.6) + - ReactNativePayments (1.5.0): + - React - rn-fetch-blob (0.12.0): - React-Core - RNCAsyncStorage (1.17.10): @@ -611,6 +613,7 @@ DEPENDENCIES: - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) + - "ReactNativePayments (from `../node_modules/@exodus/react-native-payments/lib/ios/`)" - rn-fetch-blob (from `../node_modules/rn-fetch-blob`) - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - "RNCCheckbox (from `../node_modules/@react-native-community/checkbox`)" @@ -766,6 +769,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" ReactCommon: :path: "../node_modules/react-native/ReactCommon" + ReactNativePayments: + :path: "../node_modules/@exodus/react-native-payments/lib/ios/" rn-fetch-blob: :path: "../node_modules/rn-fetch-blob" RNCAsyncStorage: @@ -886,6 +891,7 @@ SPEC CHECKSUMS: React-RCTVibration: 73d201599a64ea14b4e0b8f91b64970979fd92e6 React-runtimeexecutor: 8692ac548bec648fa121980ccb4304afd136d584 ReactCommon: e1067159764444e5db7c14e294d5cd79fb159c59 + ReactNativePayments: a4e3ac915256a4e759c8a04338b558494a63a0f5 rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba RNCAsyncStorage: 0c357f3156fcb16c8589ede67cc036330b6698ca RNCCheckbox: ed1b4ca295475b41e7251ebae046360a703b6eb5 @@ -916,6 +922,6 @@ SPEC CHECKSUMS: Yoga: ba09b6b11e6139e3df8229238aa794205ca6a02a YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 8af07a0374b01755391378e42ef086ec6c9752a9 +PODFILE CHECKSUM: 8d3adf4eeb9c38c94e164bf39d459809e3147413 COCOAPODS: 1.12.1 From 3cb0b45a9db859e56c405e2686275fa6b1728d7b Mon Sep 17 00:00:00 2001 From: tommasini <46944231+tommasini@users.noreply.github.com> Date: Wed, 19 Jul 2023 20:15:45 +0100 Subject: [PATCH 04/11] from address changing on transaction object (#6841) --- app/components/Views/SendFlow/AddressFrom/AddressFrom.tsx | 2 ++ .../Views/SendFlow/AddressFrom/AddressFrom.types.ts | 1 + app/components/Views/SendFlow/SendTo/index.js | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/app/components/Views/SendFlow/AddressFrom/AddressFrom.tsx b/app/components/Views/SendFlow/AddressFrom/AddressFrom.tsx index 634d5e93ead..b5149f85662 100644 --- a/app/components/Views/SendFlow/AddressFrom/AddressFrom.tsx +++ b/app/components/Views/SendFlow/AddressFrom/AddressFrom.tsx @@ -20,6 +20,7 @@ import { SFAddressFromProps } from './AddressFrom.types'; const SendFlowAddressFrom = ({ fromAccountBalanceState, + setFromAddress, }: SFAddressFromProps) => { const navigation = useNavigation(); const identities = useSelector( @@ -110,6 +111,7 @@ const SendFlowAddressFrom = ({ setAccountName(accName); setAccountBalance(balance); fromAccountBalanceState(balanceIsZero); + setFromAddress(address); }; const openAccountSelector = () => { diff --git a/app/components/Views/SendFlow/AddressFrom/AddressFrom.types.ts b/app/components/Views/SendFlow/AddressFrom/AddressFrom.types.ts index 2f05a877ae2..fbd8d26a291 100644 --- a/app/components/Views/SendFlow/AddressFrom/AddressFrom.types.ts +++ b/app/components/Views/SendFlow/AddressFrom/AddressFrom.types.ts @@ -1,3 +1,4 @@ export interface SFAddressFromProps { fromAccountBalanceState: (value: boolean) => void; + setFromAddress: (address: string) => void; } diff --git a/app/components/Views/SendFlow/SendTo/index.js b/app/components/Views/SendFlow/SendTo/index.js index 1f3f02a3630..79cab395299 100644 --- a/app/components/Views/SendFlow/SendTo/index.js +++ b/app/components/Views/SendFlow/SendTo/index.js @@ -370,6 +370,10 @@ class SendFlow extends PureComponent { this.setState({ balanceIsZero: value }); }; + setFromAddress = (address) => { + this.setState({ fromSelectedAddress: address }); + }; + getAddressNameFromBookOrIdentities = (toAccount) => { const { addressBook, identities, network } = this.props; if (!toAccount) return; @@ -490,6 +494,7 @@ class SendFlow extends PureComponent { Date: Wed, 19 Jul 2023 15:00:38 -0600 Subject: [PATCH 05/11] fix: invalid transaction data used for approve transaction (#6833) (#6842) * use valid txn data when approving txn * rename variable Co-authored-by: Sylva Elendu --- .../UI/ApproveTransactionReview/index.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/components/UI/ApproveTransactionReview/index.js b/app/components/UI/ApproveTransactionReview/index.js index af408a205cd..e77f1e19be9 100644 --- a/app/components/UI/ApproveTransactionReview/index.js +++ b/app/components/UI/ApproveTransactionReview/index.js @@ -349,8 +349,9 @@ class ApproveTransactionReview extends PureComponent { tokenBalance, createdSpendCap; - const { spenderAddress, encodedAmount } = decodeApproveData(data); - const encodedValue = hexToBN(encodedAmount).toString(); + const { spenderAddress, encodedAmount: encodedHexAmount } = + decodeApproveData(data); + const encodedDecimalAmount = hexToBN(encodedHexAmount).toString(); const erc20TokenBalance = await TokenBalancesController.getERC20BalanceOf( to, @@ -376,7 +377,7 @@ class ApproveTransactionReview extends PureComponent { createdSpendCap = isReadyToApprove; } else if (!contract) { try { - const result = await getTokenDetails(to, from, encodedValue); + const result = await getTokenDetails(to, from, encodedDecimalAmount); const { standard, name, decimals, symbol } = result; @@ -407,7 +408,7 @@ class ApproveTransactionReview extends PureComponent { } const approveAmount = fromTokenMinimalUnit( - hexToBN(encodedAmount), + hexToBN(encodedHexAmount), tokenDecimals, ); @@ -418,7 +419,7 @@ class ApproveTransactionReview extends PureComponent { spender: spenderAddress, value: tokenStandard === ERC721 || tokenStandard === ERC1155 - ? encodedValue + ? encodedHexAmount : '0', }); @@ -442,13 +443,13 @@ class ApproveTransactionReview extends PureComponent { tokenSymbol, tokenDecimals, tokenName, - tokenValue: encodedValue, + tokenValue: encodedDecimalAmount, tokenStandard, tokenBalance, tokenImage: token[0]?.iconUrl, }, spenderAddress, - encodedAmount, + encodedHexAmount, fetchingUpdateDone: true, isReadyToApprove: createdSpendCap, tokenSpendValue: tokenAllowanceState @@ -508,14 +509,14 @@ class ApproveTransactionReview extends PureComponent { const { token: { tokenSymbol }, originalApproveAmount, - encodedAmount, + encodedHexAmount, } = this.state; const { NetworkController } = Engine.context; const { chainId } = NetworkController?.state?.providerConfig || {}; const isDapp = !Object.values(AppConstants.DEEPLINKS).includes( transaction?.origin, ); - const unlimited = encodedAmount === UINT256_HEX_MAX_VALUE; + const unlimited = encodedHexAmount === UINT256_HEX_MAX_VALUE; const params = { account_type: getAddressAccountType(transaction?.from), dapp_host_name: transaction?.origin, From 499860fc9c8004226644cc88d82814c8dac12bb7 Mon Sep 17 00:00:00 2001 From: Vinicius Stevam <45455812+vinistevam@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:50:28 +0100 Subject: [PATCH 06/11] add check approval request exists before rejecting (#6838) --- app/components/Views/Approval/index.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/components/Views/Approval/index.js b/app/components/Views/Approval/index.js index d3df5c0f5bf..970d6857229 100644 --- a/app/components/Views/Approval/index.js +++ b/app/components/Views/Approval/index.js @@ -137,13 +137,13 @@ class Approval extends PureComponent { try { const { transactionHandled } = this.state; const { transaction, selectedAddress } = this.props; - const { KeyringController } = Engine.context; + const { KeyringController, ApprovalController } = Engine.context; if (!transactionHandled) { if (isQRHardwareAccount(selectedAddress)) { KeyringController.cancelQRSignRequest(); - } else { - Engine.context.ApprovalController.reject( - transaction.id, + } else if (ApprovalController.has({ id: transaction?.id })) { + ApprovalController.reject( + transaction?.id, ethErrors.provider.userRejectedRequest(), ); } @@ -177,17 +177,21 @@ class Approval extends PureComponent { try { if (appState !== 'active') { const { transaction, transactions } = this.props; + const { ApprovalController } = Engine.context; const currentTransaction = transactions.find( (tx) => tx.id === transaction.id, ); - transaction && - transaction.id && - this.isTxStatusCancellable(currentTransaction) && - Engine.context.ApprovalController.reject( + if ( + transaction?.id && + ApprovalController.has({ id: transaction?.id }) && + this.isTxStatusCancellable(currentTransaction) + ) { + ApprovalController.reject( transaction.id, ethErrors.provider.userRejectedRequest(), ); + } this.props.hideModal(); } } catch (e) { From 88ee868a911b769959208f4d7733cb27e9403690 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Fri, 21 Jul 2023 15:11:55 -0700 Subject: [PATCH 07/11] build 1155 RC2 (#6861) --- android/app/build.gradle | 2 +- bitrise.yml | 2 +- ios/MetaMask.xcodeproj/project.pbxproj | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 12206de3179..053143269c9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -137,7 +137,7 @@ android { applicationId "io.metamask" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1148 + versionCode 1155 versionName "7.4.0" testBuildType System.getProperty('testBuildType', 'debug') missingDimensionStrategy 'react-native-camera', 'general' diff --git a/bitrise.yml b/bitrise.yml index fb11791b198..767311d8e14 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -743,7 +743,7 @@ app: VERSION_NAME: 7.4.0 - opts: is_expand: false - VERSION_NUMBER: 1148 + VERSION_NUMBER: 1155 - opts: is_expand: false ANDROID_APK_LINK: '' diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index d9fcfb07fae..36742fef2c6 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -1039,7 +1039,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1148; + CURRENT_PROJECT_VERSION = 1155; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1105,7 +1105,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1148; + CURRENT_PROJECT_VERSION = 1155; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG; @@ -1251,7 +1251,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1148; + CURRENT_PROJECT_VERSION = 1155; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1320,7 +1320,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1148; + CURRENT_PROJECT_VERSION = 1155; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG; From f5c102eae621433c20d261bae84dc9ee5b8535af Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Mon, 24 Jul 2023 11:34:41 -0700 Subject: [PATCH 08/11] fix(test): Permission Systems fix taping connect modals (#6868) * fix tapping connect modals * fixed lint issues * removed unused function, not referenced anywhere --- e2e/pages/modals/AddAccountModal.js | 8 +++++++- e2e/pages/modals/ConnectModal.js | 11 +++++++++++ e2e/pages/modals/ConnectedAccountsModal.js | 8 +++++++- ...ermission-system-removing-imported-account.spec.js | 6 +++--- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/e2e/pages/modals/AddAccountModal.js b/e2e/pages/modals/AddAccountModal.js index a5140729ca7..3490d8eec59 100644 --- a/e2e/pages/modals/AddAccountModal.js +++ b/e2e/pages/modals/AddAccountModal.js @@ -1,8 +1,14 @@ import TestHelpers from '../../helpers'; -import { ADD_ACCOUNT_NEW_ACCOUNT_BUTTON } from '../../../wdio/screen-objects/testIDs/Components/AddAccountModal.testIds'; +import { + ADD_ACCOUNT_NEW_ACCOUNT_BUTTON, + ADD_ACCOUNT_IMPORT_ACCOUNT_BUTTON, +} from '../../../wdio/screen-objects/testIDs/Components/AddAccountModal.testIds'; export default class AddAccountModal { static async tapAddNewAccount() { await TestHelpers.waitAndTap(ADD_ACCOUNT_NEW_ACCOUNT_BUTTON); } + static async tapImportAccount() { + await TestHelpers.waitAndTap(ADD_ACCOUNT_IMPORT_ACCOUNT_BUTTON); + } } diff --git a/e2e/pages/modals/ConnectModal.js b/e2e/pages/modals/ConnectModal.js index 8ba2a4d34a0..e115c39ea97 100644 --- a/e2e/pages/modals/ConnectModal.js +++ b/e2e/pages/modals/ConnectModal.js @@ -9,6 +9,9 @@ import messages from '../../../locales/languages/en.json'; const CONNECT_MULTIPLE_ACCOUNTS_STRING = messages.accounts.connect_multiple_accounts; +const CONNECT_MULTIPLE_ACCOUNTS_IMPORT_ACCOUNT_TEXT = + messages.account_actions.add_account_or_hardware_wallet; + const SELECT_ALL_TEXT = messages.accounts.select_all; export default class ConnectModal { @@ -24,6 +27,14 @@ export default class ConnectModal { await TestHelpers.tapByText(CONNECT_MULTIPLE_ACCOUNTS_STRING); } + static async tapImportAccountButton() { + await TestHelpers.tapByText(CONNECT_MULTIPLE_ACCOUNTS_IMPORT_ACCOUNT_TEXT); + } + + static async tapImportAccountOrHWButton() { + await TestHelpers.tapByText(CONNECT_MULTIPLE_ACCOUNTS_IMPORT_ACCOUNT_TEXT); + } + static async tapSelectAllButton() { await TestHelpers.tapByText(SELECT_ALL_TEXT); } diff --git a/e2e/pages/modals/ConnectedAccountsModal.js b/e2e/pages/modals/ConnectedAccountsModal.js index 0e3776cb839..c6a725f70a3 100644 --- a/e2e/pages/modals/ConnectedAccountsModal.js +++ b/e2e/pages/modals/ConnectedAccountsModal.js @@ -37,7 +37,13 @@ export default class ConnectedAccountsModal { } static async tapToSetAsPrimaryAccount() { - await TestHelpers.tapItemAtIndex(CELL_SELECT_TEST_ID, 1); // selecting the second account on the list + // await TestHelpers.delay(8000); + if (device.getPlatform() === 'android') { + await TestHelpers.tapByText(messages.accounts.imported); //does not work for iOS + } else { + await TestHelpers.typeTextAndHideKeyboard(CELL_SELECT_TEST_ID, 1); //not working for android or iOS + } + await TestHelpers.delay(8000); //waiting for toast message to move out of the way } static async isVisible() { diff --git a/e2e/specs/permission-system-removing-imported-account.spec.js b/e2e/specs/permission-system-removing-imported-account.spec.js index 8e63702c44f..94913944d72 100644 --- a/e2e/specs/permission-system-removing-imported-account.spec.js +++ b/e2e/specs/permission-system-removing-imported-account.spec.js @@ -16,6 +16,7 @@ import NetworkEducationModal from '../pages/modals/NetworkEducationModal'; import Accounts from '../../wdio/helpers/Accounts'; import { importWalletWithRecoveryPhrase } from '../viewHelper'; +import AddAccountModal from '../pages/modals/AddAccountModal'; const SEPOLIA = 'Sepolia Test Network'; @@ -50,9 +51,8 @@ describe( }); it('should import account', async () => { - await AccountListView.tapAddAccountButton(); - - await AccountListView.tapImportAccountButton(); + await ConnectModal.tapImportAccountOrHWButton(); + await AddAccountModal.tapImportAccount(); await ImportAccountView.isVisible(); await ImportAccountView.enterPrivateKey(accountPrivateKey.keys); await ImportAccountView.isImportSuccessSreenVisible(); From 2a9872b84a73346633cbebfbd413ce32b0e6c35a Mon Sep 17 00:00:00 2001 From: sethkfman <10342624+sethkfman@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:00:28 -0600 Subject: [PATCH 09/11] chore: merge 7.3.1 cherry-pick (#6923) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 281aeb83338..e7ba62bd083 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ - [#6739](https://github.com/MetaMask/metamask-mobile/pull/6739): fix: deeplink connection using metamask://connect - [#6753](https://github.com/MetaMask/metamask-mobile/pull/6753): fix: Delete collectible media reproductor +## 7.3.1 - Jul 26, 2023 +- [#6833](https://github.com/MetaMask/metamask-mobile/pull/6833): fix: invalid transaction data used for approve transaction + ## 7.3.0 - Jul 13, 2023 ### Added - [#6220](https://github.com/MetaMask/metamask-mobile/pull/6220): feat: Upgrade React Native to 0.71.6 From e4d64e2f6383270747d8001c7f9bed767dc7f70a Mon Sep 17 00:00:00 2001 From: sethkfman <10342624+sethkfman@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:00:45 -0600 Subject: [PATCH 10/11] chore: version bump for 7.4.0 RC 3 (#6924) --- android/app/build.gradle | 2 +- bitrise.yml | 2 +- ios/MetaMask.xcodeproj/project.pbxproj | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 053143269c9..9f89fb378d4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -137,7 +137,7 @@ android { applicationId "io.metamask" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1155 + versionCode 1158 versionName "7.4.0" testBuildType System.getProperty('testBuildType', 'debug') missingDimensionStrategy 'react-native-camera', 'general' diff --git a/bitrise.yml b/bitrise.yml index 767311d8e14..2b18ec29584 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -743,7 +743,7 @@ app: VERSION_NAME: 7.4.0 - opts: is_expand: false - VERSION_NUMBER: 1155 + VERSION_NUMBER: 1158 - opts: is_expand: false ANDROID_APK_LINK: '' diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index 36742fef2c6..d5b609c7b61 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -1039,7 +1039,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1155; + CURRENT_PROJECT_VERSION = 1158; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1105,7 +1105,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1155; + CURRENT_PROJECT_VERSION = 1158; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG; @@ -1251,7 +1251,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1155; + CURRENT_PROJECT_VERSION = 1158; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1320,7 +1320,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1155; + CURRENT_PROJECT_VERSION = 1158; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG; From e128e67c13291fd2e7173e59362609e1915140f2 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Fri, 28 Jul 2023 13:03:38 -0700 Subject: [PATCH 11/11] build 1159 RC4 (#6928) --- android/app/build.gradle | 2 +- bitrise.yml | 2 +- ios/MetaMask.xcodeproj/project.pbxproj | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9f89fb378d4..0b521199806 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -137,7 +137,7 @@ android { applicationId "io.metamask" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1158 + versionCode 1159 versionName "7.4.0" testBuildType System.getProperty('testBuildType', 'debug') missingDimensionStrategy 'react-native-camera', 'general' diff --git a/bitrise.yml b/bitrise.yml index 2b18ec29584..c387283f210 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -743,7 +743,7 @@ app: VERSION_NAME: 7.4.0 - opts: is_expand: false - VERSION_NUMBER: 1158 + VERSION_NUMBER: 1159 - opts: is_expand: false ANDROID_APK_LINK: '' diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index d5b609c7b61..30d4b026dea 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -1039,7 +1039,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1158; + CURRENT_PROJECT_VERSION = 1159; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1105,7 +1105,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1158; + CURRENT_PROJECT_VERSION = 1159; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG; @@ -1251,7 +1251,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1158; + CURRENT_PROJECT_VERSION = 1159; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 48XVW22RCG; @@ -1320,7 +1320,7 @@ CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1158; + CURRENT_PROJECT_VERSION = 1159; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 48XVW22RCG; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;