Skip to content

Commit

Permalink
Update controller packages to match core v40 (#6124)
Browse files Browse the repository at this point in the history
* Update controller packages to match core v40

The controller packages have been updated to match the versions in the
core monorepo v40 release. The keyring controller update was held back
due to incompatibilities related to BigInt.

The only breaking change was to the network controller state. The state
property `properties` was renamed to `networkDetails`. Luckily there
was only a single direct reference to this property (in a test) so the
number of changes required was minimal, but we did need a state
migration.

* Update assets-controllers patch
  • Loading branch information
Gudahtt authored May 5, 2023
1 parent 14bc696 commit 5a6488a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const initialState = {
NetworkController: {
isCustomNetwork: false,
network: '1',
properties: {},
networkDetails: {},
providerConfig: { chainId: '1', ticker: 'ETH', type: 'mainnet' },
},
AddressBookController: {
Expand Down
9 changes: 8 additions & 1 deletion app/store/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ export const migrations = {
}
return state;
},
16: (state) => {
if (state.engine.backgroundState.NetworkController.properties) {
state.engine.backgroundState.NetworkController.networkDetails =
state.engine.backgroundState.NetworkController.properties;
delete state.engine.backgroundState.NetworkController.properties;
}
},
};

export const version = 15;
export const version = 16;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"@keystonehq/ur-decoder": "^0.6.1",
"@metamask/address-book-controller": "^1.1.0",
"@metamask/approval-controller": "^1.1.0",
"@metamask/assets-controllers": "4.0.0",
"@metamask/assets-controllers": "^4.0.1",
"@metamask/base-controller": "^1.1.2",
"@metamask/composable-controller": "^1.0.2",
"@metamask/contract-metadata": "^2.1.0",
Expand All @@ -155,7 +155,7 @@
"@metamask/gas-fee-controller": "^3.0.0",
"@metamask/keyring-controller": "^1.0.1",
"@metamask/message-manager": "^1.0.2",
"@metamask/network-controller": "^3.0.0",
"@metamask/network-controller": "^4.0.0",
"@metamask/permission-controller": "^2.0.0",
"@metamask/phishing-controller": "^2.0.0",
"@metamask/preferences-controller": "^2.1.0",
Expand Down
24 changes: 19 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3953,10 +3953,10 @@
immer "^9.0.6"
nanoid "^3.1.31"

"@metamask/[email protected].0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@metamask/assets-controllers/-/assets-controllers-4.0.0.tgz#81278619128cf6b22503584eebcd25a529e42386"
integrity sha512-e/ngelUbyo6drDsIm/lzh7qf43Laju/sxDLaEtolRWJDVW8ZiTrWzCAVQ1m7aduVIS7WDUR51uKzsxiTWY19cA==
"@metamask/assets-controllers@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@metamask/assets-controllers/-/assets-controllers-4.0.1.tgz#75a8e20f441809178490c3952f956e71df15b31e"
integrity sha512-ZzZw6o0gD0kjgVjOBzKfuQ1zTIutsgZfwryceRyGgSP24zhCutIFpcClsRzNLgGMShD6JRV0Ul8bjyH1WchKrw==
dependencies:
"@ethersproject/bignumber" "^5.7.0"
"@ethersproject/contracts" "^5.7.0"
Expand All @@ -3966,7 +3966,7 @@
"@metamask/contract-metadata" "^2.1.0"
"@metamask/controller-utils" "^2.0.0"
"@metamask/metamask-eth-abis" "3.0.0"
"@metamask/network-controller" "^3.0.0"
"@metamask/network-controller" "^4.0.0"
"@metamask/preferences-controller" "^1.0.2"
"@metamask/utils" "^3.3.1"
"@types/uuid" "^8.3.0"
Expand Down Expand Up @@ -4226,6 +4226,20 @@
immer "^9.0.6"
web3-provider-engine "^16.0.3"

"@metamask/network-controller@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@metamask/network-controller/-/network-controller-4.0.0.tgz#0b0eeb2c507f5ae0501074118ae81e8d85b6b9c3"
integrity sha512-zu1webUQCurzTAgf03WQJoiKyxmbA+VP4xs08ZwATnXSxDHbbLWtXYC18YGoiwpY7Rw0yfJqZZduNxYLfMPELA==
dependencies:
"@metamask/base-controller" "^1.1.2"
"@metamask/controller-utils" "^2.0.0"
async-mutex "^0.2.6"
babel-runtime "^6.26.0"
eth-json-rpc-infura "^5.1.0"
eth-query "^2.1.2"
immer "^9.0.6"
web3-provider-engine "^16.0.3"

"@metamask/obs-store@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@metamask/obs-store/-/obs-store-7.0.0.tgz#6cae5f28306bb3e83a381bc9ae22682316095bd3"
Expand Down

0 comments on commit 5a6488a

Please sign in to comment.