Skip to content

Commit

Permalink
Update controller packages to match core v40
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gudahtt committed May 3, 2023
1 parent a65c126 commit 149b03c
Show file tree
Hide file tree
Showing 4 changed files with 32 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
11 changes: 10 additions & 1 deletion app/store/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,17 @@ export const migrations = {
delete state.engine.backgroundState.NetworkController.provider;
}

return state;
},
15: (state) => {
if (state.engine.backgroundState.NetworkController.properties) {
state.engine.backgroundState.NetworkController.networkDetails =
state.engine.backgroundState.NetworkController.properties;
delete state.engine.backgroundState.NetworkController.properties;
}

return state;
},
};

export const version = 14;
export const version = 15;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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 @@ -154,7 +154,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 149b03c

Please sign in to comment.