Skip to content

Commit

Permalink
chore: bump @metamsk/network-controller to 21.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptodev-2s committed Nov 29, 2024
1 parent 7143c96 commit 74f1bc1
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 56 deletions.
13 changes: 13 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ module.exports = {
config.resolve.alias['./useNftCollectionsMetadata'] = require.resolve(
'../ui/__mocks__/useNftCollectionsMetadata.js',
);
// Import within network-controller crashes storybook.
config.resolve.alias['@metamask/eth-block-tracker'] = require.resolve(
'../ui/__mocks__/eth-block-tracker.js',
);
config.resolve.alias['@metamask/eth-json-rpc-infura'] = require.resolve(
'../ui/__mocks__/eth-json-rpc-infura.js',
);
config.resolve.alias['@metamask/eth-json-rpc-middleware'] = require.resolve(
'../ui/__mocks__/eth-json-rpc-middleware.js',
);
config.resolve.alias['@metamask/swappable-obj-proxy'] = require.resolve(
'../ui/__mocks__/swappable-obj-proxy.js',
);
config.resolve.fallback = {
child_process: false,
constants: false,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/PATCH.txt b/PATCH.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ce3b18534f055ee00aa5821793f855fd300fb72c
--- /dev/null
+++ b/PATCH.txt
@@ -0,0 +1,4 @@
+We remove lookupNetwork from initializeProvider in the network controller to prevent network requests before user onboarding is completed.
+The network lookup is done after onboarding is completed, and when the extension reloads if onboarding has been completed.
+This patch is part of a temporary fix that will be reverted soon to make way for a more permanent solution. https://github.com/MetaMask/metamask-extension/pull/23005
+You can see the changes before compilation on this branch: https://github.com/MetaMask/core/compare/pnf/ext-23622-review?expand=1
\ No newline at end of file
diff --git a/dist/NetworkController.cjs b/dist/NetworkController.cjs
index b85de6f29620feecf6f1e395f3d25c96fb10f204..68c894de3975ab917e8320b5937b19a9b3ddd4ca 100644
--- a/dist/NetworkController.cjs
+++ b/dist/NetworkController.cjs
@@ -408,7 +408,6 @@ class NetworkController extends base_controller_1.BaseController {
*/
async initializeProvider() {
__classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_applyNetworkSelection).call(this, this.state.selectedNetworkClientId);
- await this.lookupNetwork();
}
/**
* Refreshes the network meta with EIP-1559 support and the network status
diff --git a/dist/NetworkController.mjs b/dist/NetworkController.mjs
index 966da694324513857dc6766590a4c965dedc2e3d..eb2fe95f9d77fa781d2bce97b7007d4676a3bede 100644
--- a/dist/NetworkController.mjs
+++ b/dist/NetworkController.mjs
@@ -383,7 +383,6 @@ export class NetworkController extends BaseController {
*/
async initializeProvider() {
__classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_applyNetworkSelection).call(this, this.state.selectedNetworkClientId);
- await this.lookupNetwork();
}
/**
* Refreshes the network meta with EIP-1559 support and the network status
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@
"@expo/config-plugins/glob": "^10.3.10",
"@solana/web3.js/rpc-websockets": "^8.0.1",
"@metamask/nonce-tracker@npm:^5.0.0": "patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch",
"@metamask/network-controller@npm:^17.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"@metamask/network-controller@npm:^19.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"@metamask/network-controller@npm:^20.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"@metamask/network-controller@npm:^17.0.0": "patch:@metamask/network-controller@npm%3A21.0.1#~/.yarn/patches/@metamask-network-controller-npm-21.0.1-55b6d471c0.patch",
"@metamask/network-controller@npm:^19.0.0": "patch:@metamask/network-controller@npm%3A21.0.1#~/.yarn/patches/@metamask-network-controller-npm-21.0.1-55b6d471c0.patch",
"@metamask/network-controller@npm:^20.0.0": "patch:@metamask/network-controller@npm%3A21.0.1#~/.yarn/patches/@metamask-network-controller-npm-21.0.1-55b6d471c0.patch",
"path-to-regexp": "1.9.0",
"@ledgerhq/cryptoassets-evm-signatures/axios": "^0.28.0",
"@ledgerhq/domain-service/axios": "^0.28.0",
Expand Down Expand Up @@ -320,7 +320,7 @@
"@metamask/message-signing-snap": "^0.4.0",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/name-controller": "^8.0.0",
"@metamask/network-controller": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"@metamask/network-controller": "patch:@metamask/network-controller@npm%3A21.0.1#~/.yarn/patches/@metamask-network-controller-npm-21.0.1-55b6d471c0.patch",
"@metamask/notification-services-controller": "^0.14.0",
"@metamask/object-multiplex": "^2.0.0",
"@metamask/obs-store": "^9.0.0",
Expand Down
6 changes: 6 additions & 0 deletions ui/__mocks__/eth-block-tracker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies, node/no-extraneous-require
const ethBlockTracker = require('@metamask/eth-json-rpc-infura');

module.exports = {
...ethBlockTracker,
};
6 changes: 6 additions & 0 deletions ui/__mocks__/eth-json-rpc-infura.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies, node/no-extraneous-require
const ethBlockTracker = require('@metamask/eth-block-tracker');

module.exports = {
...ethBlockTracker,
};
6 changes: 6 additions & 0 deletions ui/__mocks__/eth-json-rpc-middleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies, node/no-extraneous-require
const ethBlockTracker = require('@metamask/eth-json-rpc-middleware');

module.exports = {
...ethBlockTracker,
};
6 changes: 6 additions & 0 deletions ui/__mocks__/swappable-obj-proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies, node/no-extraneous-require
const ethBlockTracker = require('@metamask/swappable-obj-proxy');

module.exports = {
...ethBlockTracker,
};
38 changes: 19 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5299,7 +5299,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/eth-json-rpc-provider@npm:^4.0.0, @metamask/eth-json-rpc-provider@npm:^4.1.3, @metamask/eth-json-rpc-provider@npm:^4.1.5, @metamask/eth-json-rpc-provider@npm:^4.1.6":
"@metamask/eth-json-rpc-provider@npm:^4.0.0, @metamask/eth-json-rpc-provider@npm:^4.1.4, @metamask/eth-json-rpc-provider@npm:^4.1.5, @metamask/eth-json-rpc-provider@npm:^4.1.6":
version: 4.1.6
resolution: "@metamask/eth-json-rpc-provider@npm:4.1.6"
dependencies:
Expand Down Expand Up @@ -5612,7 +5612,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/json-rpc-engine@npm:^9.0.0, @metamask/json-rpc-engine@npm:^9.0.2, @metamask/json-rpc-engine@npm:^9.0.3":
"@metamask/json-rpc-engine@npm:^9.0.0, @metamask/json-rpc-engine@npm:^9.0.3":
version: 9.0.3
resolution: "@metamask/json-rpc-engine@npm:9.0.3"
dependencies:
Expand Down Expand Up @@ -5789,18 +5789,18 @@ __metadata:
languageName: node
linkType: hard

"@metamask/network-controller@npm:21.0.0":
version: 21.0.0
resolution: "@metamask/network-controller@npm:21.0.0"
"@metamask/network-controller@npm:21.0.1":
version: 21.0.1
resolution: "@metamask/network-controller@npm:21.0.1"
dependencies:
"@metamask/base-controller": "npm:^7.0.0"
"@metamask/controller-utils": "npm:^11.2.0"
"@metamask/base-controller": "npm:^7.0.1"
"@metamask/controller-utils": "npm:^11.3.0"
"@metamask/eth-block-tracker": "npm:^10.0.0"
"@metamask/eth-json-rpc-infura": "npm:^9.1.0"
"@metamask/eth-json-rpc-middleware": "npm:^13.0.0"
"@metamask/eth-json-rpc-provider": "npm:^4.1.3"
"@metamask/eth-json-rpc-provider": "npm:^4.1.4"
"@metamask/eth-query": "npm:^4.0.0"
"@metamask/json-rpc-engine": "npm:^9.0.2"
"@metamask/json-rpc-engine": "npm:^9.0.3"
"@metamask/rpc-errors": "npm:^6.3.1"
"@metamask/swappable-obj-proxy": "npm:^2.2.0"
"@metamask/utils": "npm:^9.1.0"
Expand All @@ -5810,7 +5810,7 @@ __metadata:
reselect: "npm:^5.1.1"
uri-js: "npm:^4.4.1"
uuid: "npm:^8.3.2"
checksum: 10/b44804720a7338a89edfc4e82c5652d429f6e3589de4fe1ebbba921d1d9af6c82a78c79591c0c8a6cb9b4439dbd77ede5b6aa8a72d24996ccedd8a7854fc7d46
checksum: 10/cff5359167d902226e6dc4bdde3ee751a641ef2c4d82f0c3b04378057d5eb03f75295116875613d4bd9448bd29d21984c73b69350401b9062b25f0b1a46cfdb8
languageName: node
linkType: hard

Expand Down Expand Up @@ -5839,18 +5839,18 @@ __metadata:
languageName: node
linkType: hard

"@metamask/network-controller@patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch":
version: 21.0.0
resolution: "@metamask/network-controller@patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch::version=21.0.0&hash=1a5039"
"@metamask/network-controller@patch:@metamask/network-controller@npm%3A21.0.1#~/.yarn/patches/@metamask-network-controller-npm-21.0.1-55b6d471c0.patch":
version: 21.0.1
resolution: "@metamask/network-controller@patch:@metamask/network-controller@npm%3A21.0.1#~/.yarn/patches/@metamask-network-controller-npm-21.0.1-55b6d471c0.patch::version=21.0.1&hash=5eb093"
dependencies:
"@metamask/base-controller": "npm:^7.0.0"
"@metamask/controller-utils": "npm:^11.2.0"
"@metamask/base-controller": "npm:^7.0.1"
"@metamask/controller-utils": "npm:^11.3.0"
"@metamask/eth-block-tracker": "npm:^10.0.0"
"@metamask/eth-json-rpc-infura": "npm:^9.1.0"
"@metamask/eth-json-rpc-middleware": "npm:^13.0.0"
"@metamask/eth-json-rpc-provider": "npm:^4.1.3"
"@metamask/eth-json-rpc-provider": "npm:^4.1.4"
"@metamask/eth-query": "npm:^4.0.0"
"@metamask/json-rpc-engine": "npm:^9.0.2"
"@metamask/json-rpc-engine": "npm:^9.0.3"
"@metamask/rpc-errors": "npm:^6.3.1"
"@metamask/swappable-obj-proxy": "npm:^2.2.0"
"@metamask/utils": "npm:^9.1.0"
Expand All @@ -5860,7 +5860,7 @@ __metadata:
reselect: "npm:^5.1.1"
uri-js: "npm:^4.4.1"
uuid: "npm:^8.3.2"
checksum: 10/6c3fdf78360df8bf39a0045f7d5e6d0b7fd8984eaee7a3348bd688ee2740669c654803790dbf2429f8559b69d88101de0add0cc76e5c42661cf2eec14b263cb0
checksum: 10/9b2cae1c5d3f78d4795b9dce9ec57d9cb332a5b3d2fff3a087deccef39366158b7ce54fa74cfa5486a76df54aa3465402f389f47173ffdfb3f596b44d04d61c1
languageName: node
linkType: hard

Expand Down Expand Up @@ -26535,7 +26535,7 @@ __metadata:
"@metamask/message-signing-snap": "npm:^0.4.0"
"@metamask/metamask-eth-abis": "npm:^3.1.1"
"@metamask/name-controller": "npm:^8.0.0"
"@metamask/network-controller": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch"
"@metamask/network-controller": "patch:@metamask/network-controller@npm%3A21.0.1#~/.yarn/patches/@metamask-network-controller-npm-21.0.1-55b6d471c0.patch"
"@metamask/notification-services-controller": "npm:^0.14.0"
"@metamask/object-multiplex": "npm:^2.0.0"
"@metamask/obs-store": "npm:^9.0.0"
Expand Down

0 comments on commit 74f1bc1

Please sign in to comment.