Skip to content

Commit 4e1ae30

Browse files
authored
Merge branch 'main' into fix/mm-card-delegation-refresh-issue
2 parents eac35f4 + 8a8b861 commit 4e1ae30

File tree

343 files changed

+21907
-4471
lines changed

Some content is hidden

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

343 files changed

+21907
-4471
lines changed

.cursor/BUGBOT.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# BUGBOT Rules
2+
3+
## Core Mission
4+
5+
Automated test quality enforcement and bug detection for MetaMask Mobile React Native codebase
6+
7+
## Execution Protocol
8+
9+
### 1. Initial Setup
10+
11+
- **ALWAYS** load and reference [unit testing guidelines](rules/unit-testing-guidelines.mdc)
12+
- Verify test file naming pattern: `*.test.{ts,tsx,js,jsx}`
13+
- Check for proper Jest/React Native Testing Library imports
14+
15+
Use the rules in the[unit testing guidelines](rules/unit-testing-guidelines.mdc) to enforce the test quality and bug detection.

.cursor/rules/BUGBOT.md

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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ app/core/Engine/types.ts @MetaMask/mobile-pla
4242
app/core/Engine/controllers/remote-feature-flag-controller/ @MetaMask/mobile-platform
4343
app/core/DeeplinkManager @MetaMask/mobile-platform
4444
scripts/build.sh @MetaMask/mobile-platform
45+
scripts/update-expo-channel.js @MetaMask/mobile-admins
4546

4647
# Platform & Snaps Code Fencing File
4748
metro.transform.js @MetaMask/mobile-platform @MetaMask/core-platform

.js.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export WALLET_CONNECT_PROJECT_ID=""
4444
# Default PORT for metro
4545
export WATCHER_PORT=8081
4646

47+
# Expo Project ID for OTA updates
48+
export EXPO_PROJECT_ID=""
49+
4750
# Environment: "production", "pre-release" or "dev"
4851
export METAMASK_ENVIRONMENT="dev"
4952

@@ -164,5 +167,8 @@ export MM_PERPS_HIP3_ENABLED="true"
164167
export MM_PERPS_HIP3_ALLOWLIST_MARKETS="" # Allowlist: Empty = enable all markets. Examples: "xyz:XYZ100,xyz:TSLA" or "xyz:*,abc:TSLA"
165168
export MM_PERPS_HIP3_BLOCKLIST_MARKETS="" # Blocklist: Empty = no blocking. Examples: "BTC,ETH" or "xyz:*"
166169

170+
## Predict
171+
export MM_PREDICT_ENABLED="true"
172+
167173
## Card
168174
export MM_CARD_BAANX_API_CLIENT_KEY_DEV=""
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/dist/NetworkEnablementController.cjs b/dist/NetworkEnablementController.cjs
2+
index d4a40bea9e4ed3c28e347d96e309efe1ff889e81..fab280760de6bd5cdfdbecf01495c2d5616b2e16 100644
3+
--- a/dist/NetworkEnablementController.cjs
4+
+++ b/dist/NetworkEnablementController.cjs
5+
@@ -25,6 +25,11 @@ const getDefaultNetworkEnablementControllerState = () => ({
6+
[controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.Mainnet]]: true,
7+
[controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.LineaMainnet]]: true,
8+
[controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.BaseMainnet]]: true,
9+
+ [controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.ArbitrumOne]]: true,
10+
+ [controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.BscMainnet]]: true,
11+
+ [controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.OptimismMainnet]]: true,
12+
+ [controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.PolygonMainnet]]: true,
13+
+ [controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.SeiMainnet]]: true,
14+
},
15+
[utils_1.KnownCaipNamespace.Solana]: {
16+
[keyring_api_1.SolScope.Mainnet]: true,
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/android/src/main/java/expo/modules/updates/UpdatesPackage.kt b/android/src/main/java/expo/modules/updates/UpdatesPackage.kt
2+
index f697c9822c32544ddfcd62e218c09555bcb2915d..2c29988517b294b26714bccd371f5e836dd3b834 100644
3+
--- a/android/src/main/java/expo/modules/updates/UpdatesPackage.kt
4+
+++ b/android/src/main/java/expo/modules/updates/UpdatesPackage.kt
5+
@@ -1,6 +1,5 @@
6+
package expo.modules.updates
7+
8+
-import android.app.Application
9+
import android.content.Context
10+
import androidx.annotation.UiThread
11+
import androidx.annotation.WorkerThread
12+
@@ -8,7 +7,6 @@ import com.facebook.react.ReactActivity
13+
import com.facebook.react.ReactNativeHost
14+
import com.facebook.react.bridge.ReactContext
15+
import com.facebook.react.devsupport.interfaces.DevSupportManager
16+
-import expo.modules.core.interfaces.ApplicationLifecycleListener
17+
import expo.modules.core.interfaces.Package
18+
import expo.modules.core.interfaces.ReactActivityHandler
19+
import expo.modules.core.interfaces.ReactNativeHostHandler
20+
@@ -94,30 +92,6 @@ class UpdatesPackage : Package {
21+
return listOf(handler)
22+
}
23+
24+
- override fun createApplicationLifecycleListeners(context: Context): List<ApplicationLifecycleListener> {
25+
- val handler = object : ApplicationLifecycleListener {
26+
- override fun onCreate(application: Application) {
27+
- super.onCreate(application)
28+
- if (isRunningAndroidTest()) {
29+
- // Preload updates to prevent Detox ANR
30+
- UpdatesController.initialize(context)
31+
- UpdatesController.instance.launchAssetFile
32+
- }
33+
- }
34+
- }
35+
-
36+
- return listOf(handler)
37+
- }
38+
-
39+
- private fun isRunningAndroidTest(): Boolean {
40+
- try {
41+
- Class.forName("androidx.test.espresso.Espresso")
42+
- return true
43+
- } catch (_: ClassNotFoundException) {
44+
- }
45+
- return false
46+
- }
47+
-
48+
companion object {
49+
private val TAG = UpdatesPackage::class.java.simpleName
50+
val isUsingNativeDebug = BuildConfig.EX_UPDATES_NATIVE_DEBUG

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ android {
188188
minSdkVersion rootProject.ext.minSdkVersion
189189
targetSdkVersion rootProject.ext.targetSdkVersion
190190
versionName "7.60.0"
191-
versionCode 2818
191+
versionCode 2993
192192
testBuildType System.getProperty('testBuildType', 'debug')
193193
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
194194
manifestPlaceholders.MM_BRANCH_KEY_TEST = "$System.env.MM_BRANCH_KEY_TEST"

app.config.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { RUNTIME_VERSION, PROJECT_ID, UPDATE_URL } = require('./ota.config.js');
2+
13
module.exports = {
24
name: 'MetaMask',
35
displayName: 'MetaMask',
@@ -15,7 +17,9 @@ module.exports = {
1517
'../../node_modules/@notifee/react-native/android/libs',
1618
],
1719
},
18-
ios: {},
20+
ios: {
21+
jsEngine: 'hermes',
22+
},
1923
},
2024
],
2125
[
@@ -36,5 +40,28 @@ module.exports = {
3640
ios: {
3741
bundleIdentifier: 'io.metamask.MetaMask',
3842
usesAppleSignIn: true,
43+
jsEngine: 'hermes',
44+
},
45+
expo: {
46+
owner: 'metamask-test',
47+
runtimeVersion: RUNTIME_VERSION,
48+
updates: {
49+
url: UPDATE_URL,
50+
// Channel is set by requestHeaders, will be overridden with build script
51+
requestHeaders: {
52+
'expo-channel-name': 'preview',
53+
},
54+
},
55+
extra: {
56+
eas: {
57+
projectId: PROJECT_ID,
58+
},
59+
},
60+
android: {
61+
package: 'io.metamask',
62+
},
63+
ios: {
64+
bundleIdentifier: 'io.metamask.MetaMask',
65+
},
3966
},
4067
};

app/__mocks__/expo-updates.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Mock for expo-updates module
2+
export const channel = 'test-channel';
3+
export const runtimeVersion = '1.0.0';
4+
export const isEmbeddedLaunch = true;
5+
export const isEnabled = true;
6+
export const updateId = 'mock-update-id';
7+
8+
export const checkForUpdateAsync = jest.fn();
9+
export const fetchUpdateAsync = jest.fn();
10+
export const reloadAsync = jest.fn();
11+
export const useUpdates = jest.fn();
12+
13+
export const UpdateEventType = {
14+
ERROR: 'error',
15+
NO_UPDATE_AVAILABLE: 'noUpdateAvailable',
16+
UPDATE_AVAILABLE: 'updateAvailable',
17+
};
18+
19+
export const UpdateCheckResult = {
20+
isAvailable: false,
21+
manifest: null,
22+
};
23+
24+
export default {
25+
channel,
26+
runtimeVersion,
27+
isEmbeddedLaunch,
28+
isEnabled,
29+
updateId,
30+
checkForUpdateAsync,
31+
fetchUpdateAsync,
32+
reloadAsync,
33+
useUpdates,
34+
UpdateEventType,
35+
UpdateCheckResult,
36+
};

app/component-library/components-temp/ButtonFilter/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ const MyComponent = () => {
3030
const [filter, setFilter] = useState('all');
3131

3232
return (
33-
<ButtonFilter
34-
isActive={filter === 'all'}
35-
onPress={() => setFilter('all')}
36-
>
33+
<ButtonFilter isActive={filter === 'all'} onPress={() => setFilter('all')}>
3734
All
3835
</ButtonFilter>
3936
);
@@ -69,4 +66,3 @@ The component uses Tailwind CSS via the `useTailwind` hook and follows the MetaM
6966
/>
7067
</Box>
7168
```
72-

0 commit comments

Comments
 (0)