Skip to content

Commit 8bfa887

Browse files
temp+chore: cp-7.61.2 update @metamask/network-controller to latest version (#24166)
## **Description** The package `@metamask/network-controller` has been updated from v27.0 to v27.1, which is the latest version. The primary motivation for the update is this bug fix: MetaMask/core#7532 (included in v27.1.0). ## **Changelog** CHANGELOG entry: Fix bug where EIP-1559 compatibility check was skipped in some circumstances ## **Related issues** Related core issue: MetaMask/core#7533 ## **Manual testing steps** - do a fresh install of 7.61.0 - submit a transaction (see that it was a type 0.. no gas fee properties included) - try to submit a type 4 transaction (upgrade/downgrade doesn't matter.. see that the transaction fails locally) - update to the build from your PR - re-do the previous actions and they all should succeed - type 2 transaction submitted - type 4 transaction submitted ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **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). - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Update `@metamask/network-controller` to `^27.1.0` and refresh lockfile with related dependency bumps. > > - **Dependencies**: > - Bump `@metamask/network-controller` from `^27.0.0` to `^27.1.0` in `package.json` and `yarn.lock`. > - Lockfile updates for transitive deps: > - `@metamask/controller-utils` → `11.17.0`. > - `@metamask/eth-json-rpc-middleware` → `22.0.1`. > - Corresponding `yarn.lock` resolutions and checksums updated. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit aea2716. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 1347372 commit 8bfa887

File tree

1,820 files changed

+146070
-97305
lines changed

Some content is hidden

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

1,820 files changed

+146070
-97305
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
globs: "**/*"
3+
alwaysApply: true
4+
---
5+
6+
# Feature Flag Guidelines
7+
8+
## Core Principle
9+
10+
**ALWAYS** use the `useFeatureFlag` hook instead of creating new feature flag selectors.
11+
12+
## Forbidden Patterns
13+
14+
### ❌ NEVER Create New Feature Flag Selectors
15+
16+
**DO NOT** create new selectors using `createSelector` for feature flags:
17+
18+
```typescript
19+
// ❌ FORBIDDEN - Do not create new feature flag selectors
20+
export const selectMyFeatureEnabledFlag = createSelector(
21+
selectRemoteFeatureFlags,
22+
(remoteFeatureFlags) => {
23+
// ... selector logic
24+
},
25+
);
26+
```
27+
28+
**DO NOT** add new feature flag selectors in:
29+
- `app/selectors/featureFlagController/**/*.ts`
30+
- `app/components/**/selectors/featureFlags/**/*.ts`
31+
- Any other location that creates feature flag selectors
32+
33+
## Required Pattern
34+
35+
### ✅ ALWAYS Use the `useFeatureFlag` Hook
36+
37+
**MUST** use the `useFeatureFlag` hook from `app/components/hooks/FeatureFlags/useFeatureFlag.ts`:
38+
39+
```typescript
40+
// ✅ REQUIRED - Use the hook instead
41+
import { useFeatureFlag, FeatureFlagNames } from '../../../hooks/FeatureFlags/useFeatureFlag';
42+
43+
const MyComponent = () => {
44+
const isFeatureEnabled = useFeatureFlag(FeatureFlagNames.rewardsEnabled);
45+
46+
// Use the flag value
47+
if (isFeatureEnabled) {
48+
// ... feature logic
49+
}
50+
};
51+
```
52+
53+
## Steps to Use Feature Flags
54+
55+
1. **Add the flag name** to the `FeatureFlagNames` enum in `app/components/hooks/FeatureFlags/useFeatureFlag.ts`:
56+
```typescript
57+
export enum FeatureFlagNames {
58+
rewardsEnabled = 'rewardsEnabled',
59+
myNewFeature = 'myNewFeature', // Add your new flag here
60+
}
61+
```
62+
63+
2. **Use the hook** in your component:
64+
```typescript
65+
const isMyFeatureEnabled = useFeatureFlag(FeatureFlagNames.myNewFeature);
66+
```
67+
68+
3. **Do NOT** create a selector for the feature flag
69+
70+
## Migration Pattern
71+
72+
If you encounter existing feature flag selectors, prefer migrating to the hook:
73+
74+
```typescript
75+
// ❌ Old pattern (existing code - do not replicate)
76+
const isFeatureEnabled = useSelector(selectMyFeatureEnabledFlag);
77+
78+
// ✅ New pattern (use this instead)
79+
const isFeatureEnabled = useFeatureFlag(FeatureFlagNames.myNewFeature);
80+
```
81+
82+
## Enforcement
83+
84+
- **REJECT** any code that creates new `createSelector` instances for feature flags
85+
- **REJECT** any new files in `app/selectors/featureFlagController/` directories
86+
- **REQUIRE** use of `useFeatureFlag` hook for all feature flag access
87+
- **REQUIRE** adding flag names to `FeatureFlagNames` enum before use
88+
89+
## Exception
90+
91+
The only exception is the base selector `selectRemoteFeatureFlags` in `app/selectors/featureFlagController/index.ts`, which is used internally by the `useFeatureFlag` hook infrastructure.

.depcheckrc.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# List things here that *are - 'used, that depcheck is wrong about'
2-
32
ignores:
43
- '@metamask/oss-attribution-generator'
54
- '@metamask/test-dapp-multichain'
@@ -35,8 +34,6 @@ ignores:
3534
# ESBuild is used for AI E2E script compilation
3635
- 'esbuild'
3736
- 'esbuild-register'
38-
# xml2js is used in .github/scripts/ for E2E test report processing
39-
- 'xml2js'
4037

4138
# Used in scripts/repack for CI optimization
4239
- '@expo/repack-app'
@@ -46,11 +43,19 @@ ignores:
4643
## Unused dependencies to investigate
4744
- '@babel/preset-env'
4845
- '@babel/runtime'
46+
- '@cucumber/message-streams'
47+
- '@cucumber/messages'
4948
- '@metamask/mobile-provider'
49+
- '@rpii/wdio-html-reporter'
5050
- '@testing-library/react'
5151
- '@testing-library/react-hooks'
5252
- '@types/jest'
5353
- '@types/react-native-video'
54+
- '@wdio/appium-service'
55+
- '@wdio/browserstack-service'
56+
- '@wdio/junit-reporter'
57+
- '@wdio/local-runner'
58+
- '@wdio/spec-reporter'
5459
- 'appium'
5560
- 'assert'
5661
- 'babel-core'
@@ -62,6 +67,7 @@ ignores:
6267
- 'execa'
6368
- 'jetifier'
6469
- 'metro-react-native-babel-preset'
70+
- 'prettier-plugin-gherkin'
6571
- 'react-native-svg-asset-plugin'
6672
- 'regenerator-runtime'
6773
- 'prettier-2'
@@ -108,7 +114,6 @@ ignores:
108114
- 'cross-spawn'
109115
- 'expo-build-properties'
110116
- 'expo-dev-client'
111-
- 'expo-font'
112117

113118
## react native
114119
- '@react-native-community/cli'

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/app/util/blockies.js
44
__snapshots__
55
android
6-
build
76
coverage
87
ios
98
jest.preprocessor.js

.eslintrc.js

Lines changed: 94 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable import/no-commonjs */
1+
// eslint-disable-next-line import/no-commonjs
22
module.exports = {
33
root: true,
44
parser: '@typescript-eslint/parser',
@@ -34,11 +34,15 @@ module.exports = {
3434
'react/no-unused-prop-types': 'off',
3535
'react/prop-types': 'off',
3636
'react/self-closing-comp': 'off',
37-
// Temporarily overriding this rule to postpone this breaking change: https://github.com/MetaMask/eslint-config/pull/216
38-
// TODO: Remove this override and align on prefering type over interface.
39-
'@typescript-eslint/consistent-type-definitions': [
37+
// This change is included in `@metamask/[email protected]
38+
'@typescript-eslint/no-unused-vars': [
4039
'error',
41-
'interface',
40+
{
41+
vars: 'all',
42+
args: 'all',
43+
argsIgnorePattern: '[_]+',
44+
ignoreRestSiblings: true, // this line is what has changed
45+
},
4246
],
4347
'@typescript-eslint/no-explicit-any': 'error',
4448
// Under discussion
@@ -75,9 +79,9 @@ module.exports = {
7579
{
7680
files: ['scripts/**/*.js', 'e2e/tools/**/*.{js,ts}', 'app.config.js'],
7781
rules: {
78-
'no-console': 'off',
79-
'import/no-commonjs': 'off',
80-
'import/no-nodejs-modules': 'off',
82+
'no-console': 0,
83+
'import/no-commonjs': 0,
84+
'import/no-nodejs-modules': 0,
8185
},
8286
},
8387
{
@@ -188,7 +192,7 @@ module.exports = {
188192
rules: {
189193
// Set to error once all warnings reported by React Compiler are resolved
190194
'react-compiler/react-compiler': 'warn',
191-
'no-catch-shadow': 'off',
195+
'no-catch-shadow': 0,
192196
'no-console': ['error', { allow: ['warn', 'error'] }],
193197
quotes: [
194198
'error',
@@ -198,105 +202,105 @@ module.exports = {
198202
allowTemplateLiterals: true,
199203
},
200204
],
201-
'comma-dangle': 'off',
202-
curly: 'off',
203-
'no-shadow': 'off',
204-
'no-bitwise': 'off',
205-
'class-methods-use-this': 'off',
206-
'eol-last': 'warn',
207-
'import/no-named-as-default': 'off',
208-
'no-invalid-this': 'off',
209-
'no-new': 'off',
210-
'react/jsx-handler-names': 'off',
211-
'react/no-did-mount-set-state': 'off',
212-
'react/prefer-stateless-function': 'off',
213-
'require-atomic-updates': 'off',
214-
'array-callback-return': 'error',
215-
'arrow-body-style': 'error',
216-
'dot-notation': 'error',
217-
eqeqeq: 'error',
218-
'import/no-amd': 'error',
219-
'import/no-commonjs': 'error',
220-
'import/no-duplicates': 'error',
205+
'comma-dangle': 0,
206+
curly: 0,
207+
'no-shadow': 0,
208+
'no-bitwise': 0,
209+
'class-methods-use-this': 0,
210+
'eol-last': 1,
211+
'import/no-named-as-default': 0,
212+
'no-invalid-this': 0,
213+
'no-new': 0,
214+
'react/jsx-handler-names': 0,
215+
'react/no-did-mount-set-state': 0,
216+
'react/prefer-stateless-function': 0,
217+
'require-atomic-updates': 0,
218+
'array-callback-return': 2,
219+
'arrow-body-style': 2,
220+
'dot-notation': 2,
221+
eqeqeq: 2,
222+
'import/no-amd': 2,
223+
'import/no-commonjs': 2,
224+
'import/no-duplicates': 2,
221225
'import/no-extraneous-dependencies': ['error', { packageDir: ['./'] }],
222-
'import/no-mutable-exports': 'error',
223-
'import/no-namespace': 'error',
224-
'import/no-nodejs-modules': 'error',
225-
'import/prefer-default-export': 'off',
226-
'no-alert': 'error',
226+
'import/no-mutable-exports': 2,
227+
'import/no-namespace': 2,
228+
'import/no-nodejs-modules': 2,
229+
'import/prefer-default-export': 0,
230+
'no-alert': 2,
227231
'no-constant-condition': [
228-
'error',
232+
2,
229233
{
230234
checkLoops: false,
231235
},
232236
],
233-
'no-duplicate-imports': 'error',
234-
'no-empty-function': 'error',
235-
'no-else-return': 'error',
236-
'no-eval': 'error',
237-
'no-extend-native': 'error',
238-
'no-extra-bind': 'error',
239-
'no-global-assign': 'error',
240-
'no-implicit-globals': 'error',
241-
'no-implied-eval': 'error',
242-
'no-lonely-if': 'error',
243-
'no-loop-func': 'error',
244-
'no-new-func': 'error',
245-
'no-new-wrappers': 'error',
246-
'no-proto': 'error',
247-
'no-script-url': 'error',
248-
'no-self-compare': 'error',
249-
'no-throw-literal': 'error',
250-
'no-unmodified-loop-condition': 'error',
237+
'no-duplicate-imports': 2,
238+
'no-empty-function': 2,
239+
'no-else-return': 2,
240+
'no-eval': 2,
241+
'no-extend-native': 2,
242+
'no-extra-bind': 2,
243+
'no-global-assign': 2,
244+
'no-implicit-globals': 2,
245+
'no-implied-eval': 2,
246+
'no-lonely-if': 2,
247+
'no-loop-func': 2,
248+
'no-new-func': 2,
249+
'no-new-wrappers': 2,
250+
'no-proto': 2,
251+
'no-script-url': 2,
252+
'no-self-compare': 2,
253+
'no-throw-literal': 2,
254+
'no-unmodified-loop-condition': 2,
251255
'no-unneeded-ternary': [
252-
'error',
256+
2,
253257
{
254258
defaultAssignment: false,
255259
},
256260
],
257-
'no-unsafe-negation': 'error',
261+
'no-unsafe-negation': 2,
258262
'no-unused-expressions': 'off',
259-
'no-use-before-define': ['error', 'nofunc'],
260-
'no-useless-call': 'error',
261-
'no-useless-computed-key': 'error',
262-
'no-useless-concat': 'error',
263-
'no-useless-constructor': 'error',
264-
'no-useless-rename': 'error',
265-
'no-var': 'error',
266-
'no-with': 'error',
267-
'object-shorthand': 'error',
268-
'operator-assignment': 'error',
269-
'prefer-arrow-callback': 'error',
270-
'prefer-const': 'error',
271-
'prefer-rest-params': 'error',
272-
'prefer-spread': 'error',
273-
'import/no-unresolved': 'error',
274-
'eslint-comments/no-unlimited-disable': 'off',
275-
'eslint-comments/no-unused-disable': 'off',
276-
'react-native/no-color-literals': 'error',
277-
'react-native/no-inline-styles': 'error',
278-
'react-native/no-unused-styles': 'off',
279-
'react-native/split-platform-components': 'error',
280-
'react/jsx-boolean-value': 'error',
281-
'react/jsx-key': 'warn',
282-
'react/jsx-no-bind': 'off',
283-
'react/jsx-pascal-case': 'error',
284-
'react/jsx-wrap-multilines': 'error',
285-
'react/no-danger': 'error',
286-
'react/no-did-update-set-state': 'error',
287-
'react/no-find-dom-node': 'error',
263+
'no-use-before-define': [2, 'nofunc'],
264+
'no-useless-call': 2,
265+
'no-useless-computed-key': 2,
266+
'no-useless-concat': 2,
267+
'no-useless-constructor': 2,
268+
'no-useless-rename': 2,
269+
'no-var': 2,
270+
'no-with': 2,
271+
'object-shorthand': 2,
272+
'operator-assignment': 2,
273+
'prefer-arrow-callback': 2,
274+
'prefer-const': 2,
275+
'prefer-rest-params': 2,
276+
'prefer-spread': 2,
277+
'import/no-unresolved': 2,
278+
'eslint-comments/no-unlimited-disable': 0,
279+
'eslint-comments/no-unused-disable': 0,
280+
'react-native/no-color-literals': 2,
281+
'react-native/no-inline-styles': 2,
282+
'react-native/no-unused-styles': 0,
283+
'react-native/split-platform-components': 2,
284+
'react/jsx-boolean-value': 2,
285+
'react/jsx-key': 1,
286+
'react/jsx-no-bind': 0,
287+
'react/jsx-pascal-case': 2,
288+
'react/jsx-wrap-multilines': 2,
289+
'react/no-danger': 2,
290+
'react/no-did-update-set-state': 2,
291+
'react/no-find-dom-node': 2,
288292
'react/no-multi-comp': [
289-
'error',
293+
2,
290294
{
291295
ignoreStateless: true,
292296
},
293297
],
294-
'react/no-render-return-value': 'error',
295-
'react/no-string-refs': 'error',
296-
'react/no-unused-prop-types': 'error',
297-
'react/prefer-es6-class': 'error',
298+
'react/no-render-return-value': 2,
299+
'react/no-string-refs': 2,
300+
'react/no-unused-prop-types': 2,
301+
'react/prefer-es6-class': 2,
298302
'@metamask/design-tokens/color-no-hex': 'warn',
299-
radix: 'off',
303+
radix: 0,
300304
},
301305

302306
ignorePatterns: ['wdio.conf.js', 'app/util/termsOfUse/termsOfUseContent.ts'],

0 commit comments

Comments
 (0)