1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 03:12:42 +02:00
metamask-extension/app
Elliot Winkler 89cec5335f
Replace NetworkController w/ core version (#19486)
This commit fulfills a long-standing desire to get the extension using
the same network controller as mobile by removing NetworkController from
this repo and replacing it with NetworkController from the
`@metamask/network-controller` package.

The new version of NetworkController is different the old one in a few
ways:

- The new controller inherits from BaseControllerV2, so the `state`
  property is used to access the state instead of `store.getState()`.
  All references of the latter have been replaced with the former.
- As the new controller no longer has a `store` property, it cannot be
  subscribed to; the controller takes a messenger which can be
  subscribed to instead. There were various places within
  MetamaskController where the old way of subscribing has been replaced
  with the new way. In addition, DetectTokensController has been updated
  to take a messenger object so that it can listen for NetworkController
  state changes.
- The state of the new controller is not updatable from the outside.
  This affected BackupController, which dumps state from
  NetworkController (among other controllers), but also loads the same
  state into NetworkController on import. A method `loadBackup` has been
  added to NetworkController to facilitate this use case, and
  BackupController is now using this method instead of attempting to
  call `update` on NetworkController.
- The new controller does not have a `getCurrentChainId` method;
  instead, the chain ID can be read from the provider config in state.
  This affected MmiController. (MmiController was also updated to read
  custom networks from the new network controller instead of the
  preferences controller).
- The default network that the new controller is set to is always
  Mainnet (previously it could be either localhost or Goerli in test
  mode, depending on environment variables). This has been addressed
  by feeding the NetworkController initial state using the old logic, so
  this should not apply.
2023-06-22 12:46:09 -06:00
..
_locales Fix autolock field to accept decimals in Firefox (#19653) 2023-06-22 10:29:24 -06:00
build-types [MMI] Added code fences for account menu (#17965) 2023-05-17 16:58:00 +02:00
fonts UI-14395: typography v2 (#15408) 2022-08-18 10:51:53 -07:00
images feat(srp): add a quiz to the SRP reveal (#19283) 2023-06-20 14:27:10 -04:00
manifest Update mv3 minimum version to chrome v88 (#19358) 2023-05-31 17:43:26 -02:30
scripts Replace NetworkController w/ core version (#19486) 2023-06-22 12:46:09 -06:00
vendor/trezor
background.html Integrating snow into metamask (#15580) 2022-11-24 02:36:19 +02:00
home.html [MMI] Conditional change title in home if buildType is MMI (#17898) 2023-03-02 10:18:46 -06:00
loading.html
notification.html Integrating snow into metamask (#15580) 2022-11-24 02:36:19 +02:00
popup.html Integrating snow into metamask (#15580) 2022-11-24 02:36:19 +02:00
trezor-usb-permissions.html chore: Adjust trailing whitespace (#15636) 2022-08-24 14:11:49 -05:00