diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index e4267f3cdf5d..4363054e2e90 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -376,23 +376,22 @@ export default class MetamaskController extends EventEmitter { if (initState.NetworkController) { initialNetworkControllerState = initState.NetworkController; } else if (process.env.IN_TEST) { + const networkConfig = { + chainId: CHAIN_IDS.LOCALHOST, + nickname: 'Localhost 8545', + rpcPrefs: {}, + rpcUrl: 'http://localhost:8545', + ticker: 'ETH', + id: 'networkConfigurationId', + }; initialNetworkControllerState = { providerConfig: { - chainId: CHAIN_IDS.LOCALHOST, - nickname: 'Localhost 8545', - rpcPrefs: {}, - rpcUrl: 'http://localhost:8545', - ticker: 'ETH', + ...networkConfig, type: 'rpc', }, networkConfigurations: { networkConfigurationId: { - chainId: CHAIN_IDS.LOCALHOST, - nickname: 'Localhost 8545', - rpcPrefs: {}, - rpcUrl: 'http://localhost:8545', - ticker: 'ETH', - networkConfigurationId: 'networkConfigurationId', + ...networkConfig, }, }, }; diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 341df579ca18..a6eca099ed40 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -922,25 +922,39 @@ "setTimeout": true }, "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/eth-json-rpc-middleware>clone": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { "globals": { "TextDecoder": true, - "TextEncoder": true + "crypto": true }, "packages": { - "browserify>buffer": true, - "nock>debug": true, - "semver": true, - "superstruct": true + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "@metamask/eth-json-rpc-middleware>clone": { diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index 8d04d0d8425c..bede398269d4 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -993,25 +993,39 @@ "setTimeout": true }, "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/eth-json-rpc-middleware>clone": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { "globals": { "TextDecoder": true, - "TextEncoder": true + "crypto": true }, "packages": { - "browserify>buffer": true, - "nock>debug": true, - "semver": true, - "superstruct": true + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "@metamask/eth-json-rpc-middleware>clone": { diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 81e2943f55eb..873139ec3333 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -993,25 +993,39 @@ "setTimeout": true }, "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/eth-json-rpc-middleware>clone": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { "globals": { "TextDecoder": true, - "TextEncoder": true + "crypto": true }, "packages": { - "browserify>buffer": true, - "nock>debug": true, - "semver": true, - "superstruct": true + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "@metamask/eth-json-rpc-middleware>clone": { diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 7521f8e3e475..b338c1e8f697 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -922,25 +922,39 @@ "setTimeout": true }, "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/eth-json-rpc-middleware>clone": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { "globals": { "TextDecoder": true, - "TextEncoder": true + "crypto": true }, "packages": { - "browserify>buffer": true, - "nock>debug": true, - "semver": true, - "superstruct": true + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "@metamask/eth-json-rpc-middleware>clone": { diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 3731ba26159f..99beea63a6c4 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -1062,25 +1062,39 @@ "setTimeout": true }, "packages": { - "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/eth-json-rpc-middleware>clone": true, "@metamask/eth-json-rpc-middleware>pify": true, "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, + "@metamask/utils": true, "eth-rpc-errors": true, "json-rpc-engine": true } }, - "@metamask/eth-json-rpc-middleware>@metamask/utils": { + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, + "bn.js": true, + "browserify>buffer": true, + "eth-sig-util>ethereumjs-util>ethjs-util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { "globals": { "TextDecoder": true, - "TextEncoder": true + "crypto": true }, "packages": { - "browserify>buffer": true, - "nock>debug": true, - "semver": true, - "superstruct": true + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "@metamask/eth-json-rpc-middleware>clone": { diff --git a/package.json b/package.json index b9b713992375..0ff9576f0d03 100644 --- a/package.json +++ b/package.json @@ -258,7 +258,7 @@ "@metamask/message-manager": "^7.3.0", "@metamask/metamask-eth-abis": "^3.0.0", "@metamask/name-controller": "^1.0.0", - "@metamask/network-controller": "^12.1.1", + "@metamask/network-controller": "^12.2.0", "@metamask/notification-controller": "^3.0.0", "@metamask/obs-store": "^8.1.0", "@metamask/permission-controller": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index 16e055697f63..46c4d3043733 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4020,20 +4020,20 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-json-rpc-middleware@npm:^11.0.0": - version: 11.0.0 - resolution: "@metamask/eth-json-rpc-middleware@npm:11.0.0" +"@metamask/eth-json-rpc-middleware@npm:^11.0.0, @metamask/eth-json-rpc-middleware@npm:^11.0.2": + version: 11.0.2 + resolution: "@metamask/eth-json-rpc-middleware@npm:11.0.2" dependencies: "@metamask/eth-json-rpc-provider": "npm:^1.0.0" - "@metamask/eth-sig-util": "npm:^5.0.0" - "@metamask/utils": "npm:^3.0.3" + "@metamask/eth-sig-util": "npm:^6.0.0" + "@metamask/utils": "npm:^5.0.1" clone: "npm:^2.1.1" - eth-block-tracker: "npm:^7.0.0" + eth-block-tracker: "npm:^7.0.1" eth-rpc-errors: "npm:^4.0.3" json-rpc-engine: "npm:^6.1.0" pify: "npm:^3.0.0" safe-stable-stringify: "npm:^2.3.2" - checksum: c1bcf11d6e0fc2299e1c807c76a0a2002e18ed9a6d229cd05169d076d2292dcd38f70963676acd29c2797e1960f41effea4f105fb354119a06d3237afcc4eb32 + checksum: 188d98dce78f85fc6364ea78b6f7e14a95cdcf0791a187177a1da8e79b8588d1b08141110b570239d92afeb021c08432d5f10948f4bba983acd1665a013b8a2c languageName: node linkType: hard @@ -4111,7 +4111,7 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-sig-util@npm:^5.0.0, @metamask/eth-sig-util@npm:^5.0.1, @metamask/eth-sig-util@npm:^5.0.2, @metamask/eth-sig-util@npm:^5.1.0": +"@metamask/eth-sig-util@npm:^5.0.1, @metamask/eth-sig-util@npm:^5.0.2, @metamask/eth-sig-util@npm:^5.1.0": version: 5.1.0 resolution: "@metamask/eth-sig-util@npm:5.1.0" dependencies: @@ -4402,14 +4402,14 @@ __metadata: languageName: node linkType: hard -"@metamask/network-controller@npm:^12.1.1, @metamask/network-controller@npm:^12.1.2": - version: 12.1.2 - resolution: "@metamask/network-controller@npm:12.1.2" +"@metamask/network-controller@npm:^12.1.2, @metamask/network-controller@npm:^12.2.0": + version: 12.2.0 + resolution: "@metamask/network-controller@npm:12.2.0" dependencies: "@metamask/base-controller": "npm:^3.2.1" "@metamask/controller-utils": "npm:^4.3.2" "@metamask/eth-json-rpc-infura": "npm:^8.1.1" - "@metamask/eth-json-rpc-middleware": "npm:^11.0.0" + "@metamask/eth-json-rpc-middleware": "npm:^11.0.2" "@metamask/eth-json-rpc-provider": "npm:^1.0.0" "@metamask/eth-query": "npm:^3.0.1" "@metamask/swappable-obj-proxy": "npm:^2.1.0" @@ -4420,7 +4420,7 @@ __metadata: immer: "npm:^9.0.6" json-rpc-engine: "npm:^6.1.0" uuid: "npm:^8.3.2" - checksum: ec0cd25ac7851ed4b08cc6fb10bc66a83200b2d25efbf4de5a89fc5d9c845e403a59a5f226008460177cc7e2d26a35f38ca139b22e46083c5472bd86239638e5 + checksum: e5497f00c8a6ed5f00a9a5dccc6ff98cc15cc83ec31493e1387f654e038e244dff6b7954422f753d07461e2d4ef9c9dde2337a6cc4c013e3fae045592278da04 languageName: node linkType: hard @@ -5122,7 +5122,7 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^3.0.3, @metamask/utils@npm:^3.4.1": +"@metamask/utils@npm:^3.4.1": version: 3.6.0 resolution: "@metamask/utils@npm:3.6.0" dependencies: @@ -15945,7 +15945,7 @@ __metadata: languageName: node linkType: hard -"eth-block-tracker@npm:^7.0.0, eth-block-tracker@npm:^7.0.1": +"eth-block-tracker@npm:^7.0.1": version: 7.0.1 resolution: "eth-block-tracker@npm:7.0.1" dependencies: @@ -24167,7 +24167,7 @@ __metadata: "@metamask/message-manager": "npm:^7.3.0" "@metamask/metamask-eth-abis": "npm:^3.0.0" "@metamask/name-controller": "npm:^1.0.0" - "@metamask/network-controller": "npm:^12.1.1" + "@metamask/network-controller": "npm:^12.2.0" "@metamask/notification-controller": "npm:^3.0.0" "@metamask/obs-store": "npm:^8.1.0" "@metamask/permission-controller": "npm:^4.0.0"