@metamask-previews/network-controller 25.0.0-preview-6b15e01 → 25.0.0-preview-e983f054

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -11,18 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  - **BREAKING:** Use `InternalProvider` instead of `SafeEventEmitterProvider` ([#6796](https://github.com/MetaMask/core/pull/6796))
13
13
  - Providers accessible either via network clients or global proxies no longer emit events (or inherit from EventEmitter, for that matter).
14
- - **BREAKING:** Stop retrying `undefined` results for methods that include a block tag parameter ([#7001](https://github.com/MetaMask/core/pull/7001))
15
- - The network client middleware, via `@metamask/eth-json-rpc-middleware`, will now throw an error if it encounters an
16
- `undefined` result when dispatching a request with a later block number than the originally requested block number.
17
- - In practice, this should happen rarely if ever.
18
14
  - Bump `@metamask/controller-utils` from `^11.14.1` to `^11.15.0` ([#7003](https://github.com/MetaMask/core/pull/7003))
19
15
 
20
- ### Fixed
21
-
22
- - Ensure `networksMetadata` never references old network client IDs ([#7047](https://github.com/MetaMask/core/pull/7047))
23
- - When removing a network configuration, ensure that metadata for all RPC endpoints in the network configuration are also removed from `networksMetadata`
24
- - When initializing the controller, remove metadata for RPC endpoints in `networksMetadata` that are not present in a network configuration
25
-
26
16
  ## [25.0.0]
27
17
 
28
18
  ### Changed
@@ -165,6 +165,7 @@ function getDefaultCustomNetworkConfigurationsByChainId() {
165
165
  // default networks.
166
166
  return {
167
167
  [controller_utils_1.ChainId['megaeth-testnet']]: getCustomNetworkConfiguration(controller_utils_1.CustomNetworkType['megaeth-testnet']),
168
+ [controller_utils_1.ChainId['monad-testnet']]: getCustomNetworkConfiguration(controller_utils_1.CustomNetworkType['monad-testnet']),
168
169
  };
169
170
  }
170
171
  /**
@@ -334,21 +335,14 @@ function validateInitialState(state) {
334
335
  */
335
336
  function correctInitialState(state, messenger) {
336
337
  const networkConfigurationsSortedByChainId = getNetworkConfigurations(state).sort((a, b) => a.chainId.localeCompare(b.chainId));
337
- const availableNetworkClientIds = getAvailableNetworkClientIds(networkConfigurationsSortedByChainId);
338
- const invalidNetworkClientIdsWithMetadata = Object.keys(state.networksMetadata).filter((networkClientId) => !availableNetworkClientIds.includes(networkClientId));
338
+ const networkClientIds = getAvailableNetworkClientIds(networkConfigurationsSortedByChainId);
339
339
  return (0, immer_1.produce)(state, (newState) => {
340
- if (!availableNetworkClientIds.includes(state.selectedNetworkClientId)) {
340
+ if (!networkClientIds.includes(state.selectedNetworkClientId)) {
341
341
  const firstNetworkConfiguration = networkConfigurationsSortedByChainId[0];
342
342
  const newSelectedNetworkClientId = firstNetworkConfiguration.rpcEndpoints[firstNetworkConfiguration.defaultRpcEndpointIndex].networkClientId;
343
343
  messenger.call('ErrorReportingService:captureException', new Error(`\`selectedNetworkClientId\` '${state.selectedNetworkClientId}' does not refer to an RPC endpoint within a network configuration; correcting to '${newSelectedNetworkClientId}'`));
344
344
  newState.selectedNetworkClientId = newSelectedNetworkClientId;
345
345
  }
346
- if (invalidNetworkClientIdsWithMetadata.length > 0) {
347
- for (const invalidNetworkClientId of invalidNetworkClientIdsWithMetadata) {
348
- delete newState.networksMetadata[invalidNetworkClientId];
349
- }
350
- messenger.call('ErrorReportingService:captureException', new Error('`networksMetadata` had invalid network client IDs, which have been removed'));
351
- }
352
346
  });
353
347
  }
354
348
  /**
@@ -968,9 +962,6 @@ class NetworkController extends base_controller_1.BaseController {
968
962
  mode: 'remove',
969
963
  existingNetworkConfiguration,
970
964
  });
971
- for (const rpcEndpoint of existingNetworkConfiguration.rpcEndpoints) {
972
- delete state.networksMetadata[rpcEndpoint.networkClientId];
973
- }
974
965
  });
975
966
  this.messenger.publish('NetworkController:networkRemoved', existingNetworkConfiguration);
976
967
  }