Skip to content

Commit 5cd903e

Browse files
temp+fix: cp-7.53.0 Properly stop Snaps when clearing state (#17810)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Properly stop Snaps when clearing state. Patching in a fix from MetaMask/snaps#3552 because mobile is a few versions behind on `snaps-controllers`.
1 parent ca4425e commit 5cd903e

File tree

198 files changed

+12162
-20136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+12162
-20136
lines changed

.detoxrc.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
configurations: {
3232
'ios.sim.apiSpecs': {
3333
device: 'ios.simulator',
34-
app: process.env.CI ? `ios.${process.env.METAMASK_BUILD_TYPE}.release` : 'ios.debug',
34+
app: process.env.CI ? 'ios.qa' :'ios.debug',
3535
testRunner: {
3636
args: {
3737
"$0": "node e2e/api-specs/run-api-spec-tests.js",
@@ -42,14 +42,19 @@ module.exports = {
4242
device: 'ios.simulator',
4343
app: 'ios.debug',
4444
},
45-
'ios.sim.main.release': {
45+
'ios.sim.release': {
4646
device: 'ios.simulator',
47-
app: 'ios.main.release',
47+
app: 'ios.release',
4848
},
49-
'ios.sim.flask.release': {
49+
'ios.sim.qa': {
5050
device: 'ios.simulator',
51-
app: 'ios.flask.release',
51+
app: 'ios.qa',
5252
},
53+
'ios.sim.flask': {
54+
device: 'ios.simulator',
55+
app: 'ios.flask',
56+
},
57+
5358
'android.emu.debug': {
5459
device: 'android.emulator',
5560
app: 'android.debug',
@@ -58,9 +63,9 @@ module.exports = {
5863
device: 'android.bitrise.emulator',
5964
app: 'android.release',
6065
},
61-
'android.emu.flask.release': {
66+
'android.emu.release.qa': {
6267
device: 'android.bitrise.emulator',
63-
app: 'android.flask.release',
68+
app: 'android.qa',
6469
},
6570
},
6671
devices: {
@@ -92,35 +97,30 @@ module.exports = {
9297
type: 'ios.app',
9398
binaryPath:
9499
process.env.PREBUILT_IOS_APP_PATH || 'ios/build/Build/Products/Debug-iphonesimulator/MetaMask.app',
95-
build: 'export CONFIGURATION="Debug" && yarn build:ios:main:e2e',
100+
build: 'yarn start:ios:e2e',
96101
},
97-
'ios.main.release': {
102+
'ios.qa': {
98103
type: 'ios.app',
99104
binaryPath:
100-
'ios/build/Build/Products/Release-iphonesimulator/MetaMask.app',
101-
build: `yarn build:ios:main:e2e`,
105+
'ios/build/Build/Products/Release-iphonesimulator/MetaMask-QA.app',
106+
build: `METAMASK_BUILD_TYPE='${process.env.METAMASK_BUILD_TYPE || 'main'}' METAMASK_ENVIRONMENT='qa' yarn build:ios:qa`,
102107
},
103-
'ios.flask.release': {
108+
'ios.flask': {
104109
type: 'ios.app',
105110
binaryPath:
106-
'ios/build/Build/Products/Release-iphonesimulator/MetaMask-Flask.app',
107-
build: `yarn build:ios:flask:e2e`,
111+
process.env.PREBUILT_IOS_FLASK_APP_PATH || 'ios/build/Build/Products/Debug-iphonesimulator/MetaMask-Flask.app',
112+
build: 'yarn start:ios:e2e:flask',
108113
},
109114
'android.debug': {
110115
type: 'android.apk',
111116
binaryPath: process.env.PREBUILT_ANDROID_APK_PATH || 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk',
112117
testBinaryPath: process.env.PREBUILT_ANDROID_TEST_APK_PATH,
113118
build: 'yarn start:android:e2e',
114119
},
115-
'android.release': {
120+
'android.qa': {
116121
type: 'android.apk',
117-
binaryPath: 'android/app/build/outputs/apk/prod/release/app-prod-release.apk',
118-
build: `yarn build:android:main:e2e`,
119-
},
120-
'android.flask.release': {
121-
type: 'android.apk',
122-
binaryPath: 'android/app/build/outputs/apk/flask/release/app-flask-release.apk',
123-
build: `yarn build:android:flask:e2e`,
124-
},
122+
binaryPath: 'android/app/build/outputs/apk/qa/release/app-qa-release.apk',
123+
build: `METAMASK_BUILD_TYPE='${process.env.METAMASK_BUILD_TYPE || 'main'}' METAMASK_ENVIRONMENT='qa' yarn build:android:qa`,
124+
}
125125
},
126126
};

.github/pull-request-template.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ Fixes:
3333

3434
## **Manual testing steps**
3535

36-
```gherkin
37-
Feature: my feature name
38-
Scenario: user [verb for user action]
39-
Given [describe expected initial app state]
40-
When user [verb for user action]
41-
Then [describe expected outcome]
42-
```
36+
1. Go to this page...
37+
2.
38+
3.
4339

4440
## **Screenshots/Recordings**
4541

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
with:
101101
node-version-file: '.nvmrc'
102102
cache: yarn
103-
- run: yarn setup --node
103+
- run: yarn setup
104104
# The "10" in this command is the total number of shards. It must be kept
105105
# in sync with the length of matrix.shard
106106
- run: yarn test:unit --shard=${{ matrix.shard }}/10 --forceExit --silent --coverageReporters=json
@@ -133,7 +133,7 @@ jobs:
133133
with:
134134
node-version-file: '.nvmrc'
135135
cache: yarn
136-
- run: yarn setup --node
136+
- run: yarn setup
137137
- uses: actions/download-artifact@v4
138138
with:
139139
path: tests/coverage/
@@ -167,7 +167,7 @@ jobs:
167167
node-version-file: '.nvmrc'
168168
cache: yarn
169169
- name: Install dependencies
170-
run: yarn setup --no-build-android
170+
run: yarn setup
171171

172172
- name: Generate iOS bundle
173173
run: yarn gen-bundle:ios
@@ -216,11 +216,9 @@ jobs:
216216
path: coverage/
217217
- name: Upload coverage reports to Codecov
218218
if: ${{ always() }}
219-
continue-on-error: true
220219
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
221220
- name: SonarCloud Scan
222-
if: ${{ env.HAVE_SONAR_TOKEN == 'true' && github.event_name == 'pull_request' }}
223-
continue-on-error: true
221+
if: ${{ env.HAVE_SONAR_TOKEN == 'true' }}
224222
# This is SonarSource/[email protected]
225223
uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1
226224
env:
@@ -255,7 +253,7 @@ jobs:
255253
ISSUE_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
256254
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
257255
run: |
258-
# Skip step if event is not a PR
256+
# Skip step if event is a PR
259257
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
260258
echo "This job only runs for pull requests."
261259
exit 0

.github/workflows/update-latest-build-version.yml

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,45 @@
77
##############################################################################################
88
name: Update Latest Build Version
99

10+
1011
on:
1112
workflow_dispatch:
1213
inputs:
1314
base-branch:
1415
description: 'The base branch, tag, or SHA for git operations and the pull request.'
1516
required: true
1617
jobs:
17-
generate-build-version:
18-
uses: MetaMask/metamask-mobile-build-version/.github/workflows/[email protected]
19-
permissions:
20-
id-token: write
21-
22-
bump-version:
23-
runs-on: ubuntu-latest
24-
needs: generate-build-version
25-
steps:
26-
- uses: actions/checkout@v3
27-
with:
28-
fetch-depth: 0
29-
ref: ${{ inputs.base-branch }}
30-
token: ${{ secrets.PR_TOKEN }}
18+
generate-build-version:
19+
uses: MetaMask/metamask-mobile-build-version/.github/workflows/[email protected]
20+
permissions:
21+
id-token: write
3122

32-
- name: Bump script
33-
env:
34-
HEAD_REF: ${{ inputs.base-branch }}
35-
run: |
36-
./scripts/set-build-version.sh ${{ needs.generate-build-version.outputs.build-version }}
37-
git diff
38-
git config user.name metamaskbot
39-
git config user.email [email protected]
40-
git add bitrise.yml
41-
git add package.json
42-
git add ios/MetaMask.xcodeproj/project.pbxproj
43-
git add android/app/build.gradle
44-
git commit -m "Bump version number to ${{ needs.generate-build-version.outputs.build-version }}"
45-
git push origin HEAD:"$HEAD_REF" --force-with-lease
23+
bump-version:
24+
runs-on: ubuntu-latest
25+
needs: generate-build-version
26+
permissions:
27+
contents: write
28+
id-token: write
29+
steps:
30+
- uses: actions/checkout@v3
31+
with:
32+
fetch-depth: 0
33+
ref: ${{ inputs.base-branch }}
34+
token: ${{ secrets.PR_TOKEN }}
35+
36+
- name: Bump script
37+
env:
38+
HEAD_REF: ${{ inputs.base-branch }}
39+
run: |
40+
./scripts/set-build-version.sh ${{ needs.generate-build-version.outputs.build-version }}
41+
git diff
42+
git config user.name metamaskbot
43+
git config user.email [email protected]
44+
git add bitrise.yml
45+
git add package.json
46+
git add ios/MetaMask.xcodeproj/project.pbxproj
47+
git add android/app/build.gradle
48+
git commit -m "Bump version number to ${{ needs.generate-build-version.outputs.build-version }}"
49+
git push origin HEAD:"$HEAD_REF" --force
50+
51+

ReactotronConfig.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def reactNativeArchitectures() {
171171
* Adding function that will retuen the Bitrise ndkPath if it is a QA or Production Build
172172
*/
173173
def ndkPath() {
174-
return System.getenv('METAMASK_BUILD_TYPE') == 'qa' || System.getenv('METAMASK_ENVIRONMENT') == 'qa' || System.getenv('METAMASK_ENVIRONMENT') == 'production' ? rootProject.ext.bitriseNdkPath : ""
174+
return System.getenv('METAMASK_ENVIRONMENT') == 'qa' || System.getenv('METAMASK_ENVIRONMENT') == 'production' ? rootProject.ext.bitriseNdkPath : ""
175175
}
176176

177177

@@ -187,8 +187,8 @@ android {
187187
applicationId "io.metamask"
188188
minSdkVersion rootProject.ext.minSdkVersion
189189
targetSdkVersion rootProject.ext.targetSdkVersion
190-
versionName "7.54.0"
191-
versionCode 2203
190+
versionName "7.53.0"
191+
versionCode 2215
192192
testBuildType System.getProperty('testBuildType', 'debug')
193193
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
194194
manifestPlaceholders.MM_BRANCH_KEY_TEST = "$System.env.MM_BRANCH_KEY_TEST"
@@ -275,7 +275,7 @@ android {
275275
applicationIdSuffix ".flask"
276276
applicationId "io.metamask"
277277
// Use the appropriate signing config based on environment
278-
if (System.getenv("METAMASK_ENVIRONMENT") == 'qa' || System.getenv('METAMASK_BUILD_TYPE') == 'qa') {
278+
if (System.getenv("METAMASK_ENVIRONMENT") == 'qa') {
279279
signingConfig signingConfigs.qa
280280
} else {
281281
signingConfig signingConfigs.flask
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
/* eslint-disable no-console */
22
/* eslint-disable import/prefer-default-export */
3+
// External dependencies.
4+
import { AvatarAccountType } from '../../Avatars/Avatar/variants/AvatarAccount';
5+
36
// Internal dependencies.
47
import { PickerAccountProps } from './PickerAccount.types';
58

69
// Sample consts
710
export const SAMPLE_PICKERACCOUNT_PROPS: PickerAccountProps = {
11+
accountAddress: '0x2990079bcdEe240329a520d2444386FC119da21a',
12+
accountAvatarType: AvatarAccountType.JazzIcon,
813
accountName: 'Orangefox.eth',
914
onPress: () => console.log('PickerAccount pressed'),
15+
showAddress: false,
1016
};
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
/* eslint-disable react/display-name */
2-
// Third party dependencies.
3-
import React from 'react';
2+
// External dependencies.
3+
import { AvatarAccountType } from '../../Avatars/Avatar/variants/AvatarAccount';
44

55
// Internal dependencies.
66
import { default as PickerAccountComponent } from './PickerAccount';
77
import { SAMPLE_PICKERACCOUNT_PROPS } from './PickerAccount.constants';
8-
import { TouchableOpacityProps, View } from 'react-native';
9-
import { PickerAccountProps } from './PickerAccount.types';
108

119
const PickerAccountMeta = {
1210
title: 'Component Library / Pickers',
1311
component: PickerAccountComponent,
1412
argTypes: {
13+
accountAddress: {
14+
control: { type: 'text' },
15+
defaultValue: SAMPLE_PICKERACCOUNT_PROPS.accountAddress,
16+
},
17+
accountAvatarType: {
18+
options: AvatarAccountType,
19+
control: {
20+
type: 'select',
21+
},
22+
defaultValue: SAMPLE_PICKERACCOUNT_PROPS.accountAvatarType,
23+
},
1524
accountName: {
1625
control: { type: 'text' },
26+
defaultValue: SAMPLE_PICKERACCOUNT_PROPS.accountName,
27+
},
28+
showAddress: {
29+
control: { type: 'boolean' },
30+
defaultValue: SAMPLE_PICKERACCOUNT_PROPS.showAddress,
1731
},
1832
},
1933
};
2034
export default PickerAccountMeta;
2135

22-
export const PickerAccount = {
23-
args: {
24-
accountName: SAMPLE_PICKERACCOUNT_PROPS.accountName,
25-
},
26-
render: (
27-
args: React.JSX.IntrinsicAttributes &
28-
PickerAccountProps &
29-
React.RefAttributes<
30-
React.ForwardRefExoticComponent<
31-
TouchableOpacityProps & React.RefAttributes<View>
32-
>
33-
>,
34-
) => <PickerAccountComponent {...args} />,
35-
};
36+
export const PickerAccount = {};

app/component-library/components/Pickers/PickerAccount/PickerAccount.styles.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,39 @@ const styleSheet = (params: {
2121
}) => {
2222
const { vars, theme } = params;
2323
const { colors } = theme;
24-
const { style } = vars;
24+
const { style, cellAccountContainerStyle } = vars;
2525
return StyleSheet.create({
2626
base: {
2727
...(style as ViewStyle),
2828
flexDirection: 'row',
29+
padding: 0,
2930
borderWidth: 0,
3031
},
31-
basePressed: {
32-
...(style as ViewStyle),
33-
flexDirection: 'row',
34-
borderWidth: 0,
35-
borderRadius: 2,
36-
backgroundColor: colors.background.pressed,
32+
accountAvatar: {
33+
marginRight: 8,
3734
},
3835
accountAddressLabel: {
3936
color: colors.text.alternative,
4037
textAlign: 'center',
4138
},
39+
cellAccount: {
40+
flexDirection: 'row',
41+
alignItems: 'center',
42+
justifyContent: 'center',
43+
...cellAccountContainerStyle,
44+
},
45+
accountNameLabel: {
46+
alignItems: 'center',
47+
justifyContent: 'center',
48+
},
49+
accountNameAvatar: {
50+
flexDirection: 'row',
51+
alignItems: 'center',
52+
},
53+
pickerAccountContainer: {
54+
justifyContent: 'center',
55+
alignItems: 'center',
56+
},
4257
dropDownIcon: {
4358
marginLeft: 8,
4459
},

0 commit comments

Comments
 (0)