From 5a6488adc8f0917034f758c827abb86e918393ec Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 5 May 2023 20:18:40 -0230 Subject: [PATCH] Update controller packages to match core v40 (#6124) * 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 --- .../Contacts/ContactForm/index.test.tsx | 2 +- app/store/migrations.js | 9 ++++++- package.json | 4 ++-- ... @metamask+assets-controllers+4.0.1.patch} | 0 yarn.lock | 24 +++++++++++++++---- 5 files changed, 30 insertions(+), 9 deletions(-) rename patches/{@metamask+assets-controllers+4.0.0.patch => @metamask+assets-controllers+4.0.1.patch} (100%) diff --git a/app/components/Views/Settings/Contacts/ContactForm/index.test.tsx b/app/components/Views/Settings/Contacts/ContactForm/index.test.tsx index 42af478505c..3aaeb40407e 100644 --- a/app/components/Views/Settings/Contacts/ContactForm/index.test.tsx +++ b/app/components/Views/Settings/Contacts/ContactForm/index.test.tsx @@ -11,7 +11,7 @@ const initialState = { NetworkController: { isCustomNetwork: false, network: '1', - properties: {}, + networkDetails: {}, providerConfig: { chainId: '1', ticker: 'ETH', type: 'mainnet' }, }, AddressBookController: { diff --git a/app/store/migrations.js b/app/store/migrations.js index 3c9ff690cb4..5173797da8c 100644 --- a/app/store/migrations.js +++ b/app/store/migrations.js @@ -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; diff --git a/package.json b/package.json index 939cf1ac249..b78252f4921 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/patches/@metamask+assets-controllers+4.0.0.patch b/patches/@metamask+assets-controllers+4.0.1.patch similarity index 100% rename from patches/@metamask+assets-controllers+4.0.0.patch rename to patches/@metamask+assets-controllers+4.0.1.patch diff --git a/yarn.lock b/yarn.lock index 0f951f52b8a..401e2c07193 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3953,10 +3953,10 @@ immer "^9.0.6" nanoid "^3.1.31" -"@metamask/assets-controllers@4.0.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" @@ -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" @@ -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"