Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into jongsun/chore/bump/ap…
Browse files Browse the repository at this point in the history
…proval-controller-7.0.3
  • Loading branch information
cryptodev-2s committed Oct 23, 2024
2 parents f84da3d + 9f72156 commit 20d14ca
Show file tree
Hide file tree
Showing 363 changed files with 19,258 additions and 6,954 deletions.
8 changes: 1 addition & 7 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ignores:
- '@metamask/oss-attribution-generator'
- 'webpack-cli'
- '@react-native-community/datetimepicker'
- '@react-native-community/slider'
- 'patch-package'
- '@lavamoat/allow-scripts'
Expand Down Expand Up @@ -48,22 +49,17 @@ ignores:
- 'rn-nodeify'

## Unused devDependencies to investigate
- '@ethersproject/abi'
- '@metamask/swappable-obj-proxy'
- '@react-native-picker/picker'
- '@rnhooks/keyboard'
- '@segment/sovran-react-native'
- '@tradle/react-native-http'
- 'asyncstorage-down'
- 'buffer'
- 'd3-shape'
- 'dnode'
- 'eciesjs'
- 'eth-block-tracker'
- 'eth-json-rpc-infura'
- 'events'
- 'https-browserify'
- 'obs-store'
- 'path'
- 'pbkdf2'
- 'pify'
Expand All @@ -72,11 +68,9 @@ ignores:
- 'react-native-aes-crypto'
- 'react-native-aes-crypto-forked'
- 'react-native-crypto'
- 'react-native-flash-message'
- 'react-native-level-fs'
- 'react-native-os'
- 'react-native-randombytes'
- 'react-native-redash'
- 'react-native-swipe-gestures'
- 'react-native-tcp'
- 'socket.io-client'
Expand Down
2 changes: 1 addition & 1 deletion .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
configurations: {
'ios.sim.apiSpecs': {
device: 'ios.simulator',
app: 'ios.qa',
app: process.env.CI ? 'ios.qa' :'ios.debug',
testRunner: {
args: {
"$0": "node e2e/api-specs/run-api-spec-tests.js",
Expand Down
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ module.exports = {
rules: {
// under discussion
'no-unused-vars': 'off',
'react/no-unstable-nested-components': [
'warn',
{
allowAsProps: true,
},
],
},
},
{
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ app/component-library/ @MetaMask/design-system-engineers
patches/ @MetaMask/mobile-platform
app/core/Engine.ts @MetaMask/mobile-platform
app/core/Engine.test.js @MetaMask/mobile-platform
app/core/Analytics/ @MetaMask/mobile-platform
app/util/metrics/ @MetaMask/mobile-platform
app/components/hooks/useMetrics/ @MetaMask/mobile-platform

# Supply Chain Team
bitrise.yml @MetaMask/supply-chain @MetaMask/mobile-platform
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
cache: yarn
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 #v1
with:
ruby-version: '3.1.5'
ruby-version: '3.1.6'
bundler-cache: true
env:
BUNDLE_GEMFILE: ios/Gemfile
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/create-release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: create-release-draft

on:
push:
tags:
- 'v*'

permissions:
contents: write
pull-requests: read

jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref }} # Explicitly specifies the tag ref


- name: Setup GitHub CLI
run: |
sudo apt update
sudo apt install gh
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Create Draft Release
run: ./scripts/create-release-draft.sh ${{ github.ref_name }} ${{ github.workspace }}
10 changes: 3 additions & 7 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ jobs:
cache: yarn
- name: Install dependencies
run: yarn --immutable
- name: Set Versions
id: set-versions
shell: bash
run: SEMVER_VERSION=${{ github.event.inputs.semver-version }} VERSION_NUMBER=${{ github.event.inputs.version-number }} yarn set-version
- name: Create Release PR
id: create-release-pr
- name: Create Release & Changelog PR
id: create-release-changelog-pr
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/create-release-pr.sh ${{ github.event.inputs.previous-version-tag }} ${{ github.event.inputs.semver-version }}
./scripts/create-release-pr.sh ${{ github.event.inputs.previous-version-tag }} ${{ github.event.inputs.semver-version }} ${{ github.event.inputs.version-number }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,6 @@ app/util/termsOfUse/termsOfUseContent.ts
docs/assets/termsOfUse.html

/app/images/branding

# build metadata
android/app/src/main/assets/modules.json
7 changes: 5 additions & 2 deletions .js.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ export MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS="true"
# The endpoint used to submit errors and tracing data to Sentry for dev environment.
# export MM_SENTRY_DSN_DEV=

# Multichain Feature flag
export MULTICHAIN_V1=""
# Per dapp selected network (Amon Hen) feature flag
export MM_PER_DAPP_SELECTED_NETWORK=""

export MM_CHAIN_PERMISSIONS=""

#Multichain feature flag specific to UI changes
export MM_MULTICHAIN_V1_ENABLED=""
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12.2
20.14.0
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.5
3.1.6
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"cucumberautocomplete.steps": ["wdio/step-definitions/**/*.js"],
"cucumberautocomplete.syncfeatures": "wdio/to/features/*.feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"javascript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifier": "relative"
}
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,12 @@ cd metamask-mobile

Before running the app, keep in mind that MetaMask uses FCM (Firebase Cloud Message) to empower communications. Based on this, as an external contributor you would preferably need to provide your own FREE Firebase project config file with a matching client for package name `io.metamask`, and update your `google-services.json` file in the `android/app` directory as well your `.env` files (`.ios.env`, `.js.env`, `.android.env`), adding `GOOGLE_SERVICES_B64` variable depending on the environment you are running the app (ios/android).

The value you should provide to `GOOGLE_SERVICES_B64` is the base64 encoded version of your Firebase project config file, which can be generated as follows:
ATTENTION: In case you don't provide your own Firebase project config file, you can make use of a mock file at `android/app/google-services-example.json`, following the steps below from the root of the project:

```bash
base64 -i ./android/app/google-services-example.json
echo "export GOOGLE_SERVICES_B64=\"$(base64 -w0 -i ./android/app/google-services-example.json)\"" | tee -a .js.env .ios.env .android.env
```

Copy the result to your clipboard and paste it in the `GOOGLE_SERVICES_B64` variable in the `.env` file you are running the app.

> [!CAUTION]
> In case you don't provide your own Firebase project config file, you will face the error `No matching client found for package name 'io.metamask'`.
You can make usage of a mock file at `android/app/google-services-example.json`, following the same steps above from the root of the project.

In case of any doubt, please follow the instructions in the link below to get your Firebase project config file.
Expand Down
32 changes: 26 additions & 6 deletions android/app/google-services-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
},
"client": [
{
"api_key": [
{
"current_key": ""
}
],
"api_key": [{ "current_key": "" }],
"client_info": {
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
"client_id": "android:io.metamask",
Expand All @@ -21,7 +17,31 @@
"certificate_hash": []
}
}
},
{
"api_key": [{ "current_key": "" }],
"client_info": {
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
"client_id": "android:io.metamask.qa",
"client_type": 1,
"android_client_info": {
"package_name": "io.metamask.qa",
"certificate_hash": []
}
}
},
{
"api_key": [{ "current_key": "" }],
"client_info": {
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
"client_id": "android:io.metamask.flask",
"client_type": 1,
"android_client_info": {
"package_name": "io.metamask.flask",
"certificate_hash": []
}
}
}
],
"configuration_version": "1"
}
}
2 changes: 1 addition & 1 deletion app/actions/onboarding/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export function clearOnboardingEvents(): ClearEventsAction {
return {
type: CLEAR_EVENTS,
};
}
}
7 changes: 7 additions & 0 deletions app/actions/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ export function toggleDeviceNotification(deviceNotificationEnabled) {
deviceNotificationEnabled,
};
}

export function setTokenSortConfig(tokenSortConfig) {
return {
type: 'SET_TOKEN_SORT_CONFIG',
tokenSortConfig,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ContractBoxBase = ({
theme: { colors },
} = useStyles(styleSheet, {});

const IconView = ({ onPress, name, size, testID }: IconViewProps) => (
const renderIconView = ({ onPress, name, size, testID }: IconViewProps) => (
<Pressable style={styles.icon} onPress={onPress} testID={testID}>
<Icon color={colors.icon.alternative} name={name} size={size} />
</Pressable>
Expand Down Expand Up @@ -78,20 +78,19 @@ const ContractBoxBase = ({
)}
</View>
<View style={styles.iconContainer}>
<IconView
onPress={onCopyAddress}
name={IconName.Copy}
size={IconSize.Lg}
testID={COPY_ICON_TEST_ID}
/>
{hasBlockExplorer && (
<IconView
name={IconName.Export}
onPress={onExportAddress}
size={IconSize.Md}
testID={EXPORT_ICON_TEST_ID}
/>
)}
{renderIconView({
onPress: onCopyAddress,
name: IconName.Copy,
size: IconSize.Lg,
testID: COPY_ICON_TEST_ID,
})}
{hasBlockExplorer &&
renderIconView({
onPress: onExportAddress,
name: IconName.Export,
size: IconSize.Md,
testID: EXPORT_ICON_TEST_ID,
})}
</View>
</View>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,21 @@ exports[`Component ContractBoxBase should render correctly 1`] = `
}
}
>
<IconView
name="Copy"
<Component
onPress={[Function]}
size="24"
style={
{
"paddingHorizontal": 6,
}
}
testID="copy-icon"
/>
>
<Icon
color="#6a737d"
name="Copy"
size="24"
/>
</Component>
</View>
</View>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Input: React.FC<InputProps> = ({
isReadonly = false,
onBlur,
onFocus,
autoFocus = false,
autoFocus = true,
...props
}) => {
const [isFocused, setIsFocused] = useState(autoFocus);
Expand Down Expand Up @@ -64,7 +64,7 @@ const Input: React.FC<InputProps> = ({
{...props}
style={styles.base}
editable={!isDisabled && !isReadonly}
autoFocus
autoFocus={autoFocus}
onBlur={onBlurHandler}
onFocus={onFocusHandler}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`Input should render correctly 1`] = `
style={
{
"backgroundColor": "#ffffff",
"borderColor": "transparent",
"borderColor": "#0376c9",
"borderWidth": 1,
"color": "#141618",
"fontFamily": "Euclid Circular B",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable react/display-name */
import React from 'react';
import React, { ComponentProps } from 'react';

// Internal dependencies.
import { default as PickerNetworkComponent } from './PickerNetwork';
Expand All @@ -13,14 +13,16 @@ const PickerNetworkMeta = {
control: { type: 'text' },
defaultValue: SAMPLE_PICKERNETWORK_PROPS.label,
},
hideNetworkName: {
control: { type: 'boolean' },
defaultValue: false,
},
},
};
export default PickerNetworkMeta;

export const PickerNetwork = {
// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
render: (args: any) => (
render: (args: ComponentProps<typeof PickerNetworkComponent>) => (
<PickerNetworkComponent
{...args}
imageSource={SAMPLE_PICKERNETWORK_PROPS.imageSource}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ const styleSheet = (params: {
marginHorizontal: 8,
flexShrink: 1,
},
networkIconContainer: {
marginRight: 8,
},
});
};

Expand Down
Loading

0 comments on commit 20d14ca

Please sign in to comment.