From 508c777f023919f1e9c2e521f871800b7aca2395 Mon Sep 17 00:00:00 2001 From: Mathieu Artu Date: Thu, 9 Jan 2025 09:34:56 +0100 Subject: [PATCH] fix: use NetworkController preview version --- package.json | 2 +- .../@metamask+network-controller+22.1.0.patch | 48 -------- yarn.lock | 116 +++++++++++------- 3 files changed, 75 insertions(+), 91 deletions(-) delete mode 100644 patches/@metamask+network-controller+22.1.0.patch diff --git a/package.json b/package.json index e16c08380f4..90fe9fa64ee 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "@metamask/keyring-controller": "^19.0.1", "@metamask/logging-controller": "^6.0.1", "@metamask/message-signing-snap": "^0.3.3", - "@metamask/network-controller": "^22.1.0", + "@metamask/network-controller": "npm:@metamask-previews/network-controller@22.1.1-preview-ffa69e9", "@metamask/notification-services-controller": "^0.15.0", "@metamask/permission-controller": "^11.0.0", "@metamask/phishing-controller": "^12.0.3", diff --git a/patches/@metamask+network-controller+22.1.0.patch b/patches/@metamask+network-controller+22.1.0.patch deleted file mode 100644 index 112add5aa58..00000000000 --- a/patches/@metamask+network-controller+22.1.0.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/node_modules/@metamask/network-controller/dist/NetworkController.cjs b/node_modules/@metamask/network-controller/dist/NetworkController.cjs -index cc9793f..e7334e4 100644 ---- a/node_modules/@metamask/network-controller/dist/NetworkController.cjs -+++ b/node_modules/@metamask/network-controller/dist/NetworkController.cjs -@@ -525,7 +525,20 @@ class NetworkController extends base_controller_1.BaseController { - let networkChanged = false; - const listener = () => { - networkChanged = true; -- this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener); -+ try { -+ this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener); -+ } catch (error) { -+ if ( -+ typeof error === 'object' && -+ error !== null && -+ 'message' in error && -+ error.message === 'Subscription not found for event: NetworkController:networkDidChange' -+ ) { -+ // The controller may have been destroyed, so don't worry about it -+ } else { -+ throw error; -+ } -+ } - }; - this.messagingSystem.subscribe('NetworkController:networkDidChange', listener); - let updatedNetworkStatus; -@@ -575,7 +588,20 @@ class NetworkController extends base_controller_1.BaseController { - // in the process of being called, so we don't need to go further. - return; - } -- this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener); -+ try { -+ this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener); -+ } catch (error) { -+ if ( -+ typeof error === 'object' && -+ error !== null && -+ 'message' in error && -+ error.message === 'Subscription not found for event: NetworkController:networkDidChange' -+ ) { -+ // The controller may have been destroyed, so don't worry about it -+ } else { -+ throw error; -+ } -+ } - this.update((state) => { - const meta = state.networksMetadata[state.selectedNetworkClientId]; - meta.status = updatedNetworkStatus; diff --git a/yarn.lock b/yarn.lock index f24bb21a2c1..2b25efeb6cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4377,6 +4377,14 @@ "@metamask/superstruct" "^3.1.0" "@metamask/utils" "^9.0.0" +"@metamask/abi-utils@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@metamask/abi-utils/-/abi-utils-3.0.0.tgz#2eab9cb895922b94305364d9111b6dde724f6f9b" + integrity sha512-a/l0DiSIr7+CBYVpHygUa3ztSlYLFCQMsklLna+t6qmNY9+eIO5TedNxhyIyvaJ+4cN7TLy0NQFbp9FV3X2ktg== + dependencies: + "@metamask/superstruct" "^3.1.0" + "@metamask/utils" "^11.0.1" + "@metamask/accounts-controller@^20.0.1": version "20.0.1" resolved "https://registry.yarnpkg.com/@metamask/accounts-controller/-/accounts-controller-20.0.1.tgz#6f3dc905418ad75e44fce830b0363a585cce2ea8" @@ -4444,10 +4452,10 @@ single-call-balance-checker-abi "^1.0.0" uuid "^8.3.2" -"@metamask/base-controller@^7.0.1", "@metamask/base-controller@^7.0.2": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@metamask/base-controller/-/base-controller-7.0.2.tgz#bf908858215cd4f7d072b3b0f7f0946cf886ee49" - integrity sha512-zeZ5QPKedGT/r2M1NsT4lE7z4u9ciSNcOXG2vUdmfA+QT9YLwIm5+t56UGku3ZTjKGxDn9Ukca3BEkRc57Gt0A== +"@metamask/base-controller@^7.0.1", "@metamask/base-controller@^7.0.2", "@metamask/base-controller@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@metamask/base-controller/-/base-controller-7.1.0.tgz#b0dba552cb72a27fb5ac0b801458006a4ab04c42" + integrity sha512-qUZXuyjy51o73QpkfgwvFiyahi0MRE0u33DGnC6eS34eww7JWwzwA+jbPFSWYj2nVGlR/ZQ1uZR7r1yCxcpzvg== dependencies: "@metamask/utils" "^10.0.0" immer "^9.0.6" @@ -4522,14 +4530,14 @@ resolved "https://registry.yarnpkg.com/@metamask/eslint-plugin-design-tokens/-/eslint-plugin-design-tokens-1.1.0.tgz#c9d4471f04f62bfb307aa261d11b7a674eb27961" integrity sha512-33BJTEl96wXrkNdydNgTnfz3C0XP6/FdYbKzNnM8wT3XeVOkF/EOt8oiY8X4stXlNKDJtKyQchxENgZwS8sl9w== -"@metamask/eth-block-tracker@^11.0.3": - version "11.0.3" - resolved "https://registry.yarnpkg.com/@metamask/eth-block-tracker/-/eth-block-tracker-11.0.3.tgz#0e70aaa63f90c2fb18a308a9d67ca750641cde28" - integrity sha512-Lvm6oZcL5vRGnyulFVde5kbS5/IQ2hwmolYUiyZVqTPQGoKX5AdGAIJvAwXnXVgMMhNw177tYu//jBy78M13hA== +"@metamask/eth-block-tracker@^11.0.3", "@metamask/eth-block-tracker@^11.0.4": + version "11.0.4" + resolved "https://registry.yarnpkg.com/@metamask/eth-block-tracker/-/eth-block-tracker-11.0.4.tgz#20fc468c9ed6d8d61da514184e546a9faee5fa64" + integrity sha512-t/em7d7lmV6FqU/4bPRaImhYQPp7ZXy2mYzh/3FocYGAhSOqjL107uqLb5lds8EdIp1rqO4Hm+NgNhgKI8yhIw== dependencies: "@metamask/eth-json-rpc-provider" "^4.1.5" "@metamask/safe-event-emitter" "^3.1.1" - "@metamask/utils" "^9.1.0" + "@metamask/utils" "^11.0.1" json-rpc-random-id "^1.0.1" pify "^5.0.0" @@ -4577,32 +4585,32 @@ "@metamask/rpc-errors" "^7.0.0" "@metamask/utils" "^9.1.0" -"@metamask/eth-json-rpc-middleware@^15.0.0": - version "15.0.0" - resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-15.0.0.tgz#167288ad4618438af9d1bda75d238cb0facfde3f" - integrity sha512-RkmaPQPWGH1qggaq0sStwVIeamiJOjf/2jBJfbX78r/nDCai8ddY/zHpATJr42SvtRYD0JrCPjo6v356IDzjQw== - dependencies: - "@metamask/eth-block-tracker" "^11.0.3" - "@metamask/eth-json-rpc-provider" "^4.1.5" - "@metamask/eth-sig-util" "^7.0.3" - "@metamask/json-rpc-engine" "^10.0.0" - "@metamask/rpc-errors" "^7.0.0" - "@metamask/utils" "^9.1.0" +"@metamask/eth-json-rpc-middleware@^15.0.0", "@metamask/eth-json-rpc-middleware@^15.0.1": + version "15.1.2" + resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-15.1.2.tgz#1e9e8b91cf7d33665122ced669a3db15757a3e2a" + integrity sha512-36Mk+aL2SlQpd8GGLb5aT1aKl9LqgYzwOf2lyMsTPMTN2pgZvguReQJ/g76XSFh0quUgSrEUzjI862x+sd8ygw== + dependencies: + "@metamask/eth-block-tracker" "^11.0.4" + "@metamask/eth-json-rpc-provider" "^4.1.7" + "@metamask/eth-sig-util" "^8.1.2" + "@metamask/json-rpc-engine" "^10.0.2" + "@metamask/rpc-errors" "^7.0.2" + "@metamask/utils" "^11.0.1" "@types/bn.js" "^5.1.5" bn.js "^5.2.1" klona "^2.0.6" pify "^5.0.0" safe-stable-stringify "^2.4.3" -"@metamask/eth-json-rpc-provider@^4.1.5", "@metamask/eth-json-rpc-provider@^4.1.6": - version "4.1.6" - resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-provider/-/eth-json-rpc-provider-4.1.6.tgz#5d86ee7db6ff94b0abe1f00ef02aeffa60536497" - integrity sha512-32gz41C416E0P+b6YpG/2Ne1UoyqxHRGT9xBh1LTFaWvZXfGQxjSTdK+AEVG01pZ8Mf8Bgp8z2SpEsWcE9ZCng== +"@metamask/eth-json-rpc-provider@^4.1.5", "@metamask/eth-json-rpc-provider@^4.1.6", "@metamask/eth-json-rpc-provider@^4.1.7": + version "4.1.7" + resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-provider/-/eth-json-rpc-provider-4.1.7.tgz#f15f5b429eafd4fa3b7ab7b9d7317cb6ea8cde25" + integrity sha512-h69LbbnB8ZcOOND2XHd2FVz1ny7XWq+UMJEDPGKtLsjVd4FL57reuA9JxC711audWGffBxfx9Sfdi0l7SfRJrg== dependencies: - "@metamask/json-rpc-engine" "^10.0.1" - "@metamask/rpc-errors" "^7.0.1" + "@metamask/json-rpc-engine" "^10.0.2" + "@metamask/rpc-errors" "^7.0.2" "@metamask/safe-event-emitter" "^3.0.0" - "@metamask/utils" "^10.0.0" + "@metamask/utils" "^11.0.1" uuid "^8.3.2" "@metamask/eth-ledger-bridge-keyring@^8.0.0": @@ -4637,14 +4645,14 @@ ethereum-cryptography "^2.1.2" tweetnacl "^1.0.3" -"@metamask/eth-sig-util@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-8.0.0.tgz#6310d93cd1101cab3cc6bc2a1ff526290ed2695b" - integrity sha512-IwE6aoxUL39IhmsAgE4nk+OZbNo+ThFZRNsUjE1pjdEa4MFpWzm1Rue4zJ5DMy1oUyZBi/aiCLMhdMnjl2bh2Q== +"@metamask/eth-sig-util@^8.0.0", "@metamask/eth-sig-util@^8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-8.1.2.tgz#8869bd9cdc989af7402812d5fa4d9a0f6cc30b98" + integrity sha512-+M7TKF8+RwqmfmDCfhgn7jDLtWfbpPCuBfkYPBpk9ptuqINu7+QzthNlU0Rn7jiJ//buyg2pModXVtpRBmgAeA== dependencies: "@ethereumjs/util" "^8.1.0" - "@metamask/abi-utils" "^2.0.4" - "@metamask/utils" "^9.0.0" + "@metamask/abi-utils" "^3.0.0" + "@metamask/utils" "^11.0.1" "@scure/base" "~1.1.3" ethereum-cryptography "^2.1.2" tweetnacl "^1.0.3" @@ -4756,14 +4764,14 @@ bn.js "^5.2.1" uuid "^8.3.2" -"@metamask/json-rpc-engine@^10.0.0", "@metamask/json-rpc-engine@^10.0.1": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-10.0.1.tgz#432e4b42770ecd4da8a89f94b52cdeac982bdca3" - integrity sha512-RmoKubUhK7BtZrllJjqMiSkW0p5QIKiO8ohJoa7/pewJIgPWzPFid/5EahQ4f/sPtTH9O9ypDQF9r7DFCPFSVQ== +"@metamask/json-rpc-engine@^10.0.0", "@metamask/json-rpc-engine@^10.0.1", "@metamask/json-rpc-engine@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-10.0.2.tgz#9173f90ebb16054fe20d5d73a910729a014750ce" + integrity sha512-UZKKvgEGVZyBOTKe0NrERv6J4QtR1X4a3Ppa10FZ2tY+nNvwQg3gFpWPRsYNQdPDFxtIsUdrMrqKvbkYSuHZkw== dependencies: - "@metamask/rpc-errors" "^7.0.1" + "@metamask/rpc-errors" "^7.0.2" "@metamask/safe-event-emitter" "^3.0.0" - "@metamask/utils" "^10.0.0" + "@metamask/utils" "^11.0.1" "@metamask/json-rpc-engine@^8.0.1": version "8.0.2" @@ -4922,7 +4930,7 @@ resolved "https://registry.yarnpkg.com/@metamask/mobile-provider/-/mobile-provider-3.0.0.tgz#8a6a5a0874c8cbe4b468f63dfc57117d207f9595" integrity sha512-XwFJk0rd9lAZR5xS3VC7ypEhD7DvZR2gi2Ch6PHnODIqeS9Te3OdVKK5+jHI4his8v/zs6LWdFdlRtx5/jL96w== -"@metamask/network-controller@^22.1.0", "@metamask/network-controller@^22.1.1": +"@metamask/network-controller@^22.1.1": version "22.1.1" resolved "https://registry.yarnpkg.com/@metamask/network-controller/-/network-controller-22.1.1.tgz#6c3b5aef07ae66ae4cec44a62dbbd7df4421f971" integrity sha512-NTIZjRuPqOynPfPDqy/tPc8ZeKnD2ys8i2ihxq1ODHwSAHBwQ0gogNHBda7PMLaKjuuPkfmh2EzkALiH07MKSg== @@ -4946,6 +4954,30 @@ uri-js "^4.4.1" uuid "^8.3.2" +"@metamask/network-controller@npm:@metamask-previews/network-controller@22.1.1-preview-ffa69e9": + version "22.1.1-preview-ffa69e9" + resolved "https://registry.yarnpkg.com/@metamask-previews/network-controller/-/network-controller-22.1.1-preview-ffa69e9.tgz#d72a8931d787029ccd5c777658466f965f23ae66" + integrity sha512-s0TEJgI8hrWVm3IZ5vRvAGv9udRUCIo08DpkGHU2euzCZJj2Y6t8S9u2kpHVbiG2Wn++qwItl3HvmNO60giBjA== + dependencies: + "@metamask/base-controller" "^7.1.0" + "@metamask/controller-utils" "^11.4.4" + "@metamask/eth-block-tracker" "^11.0.3" + "@metamask/eth-json-rpc-infura" "^10.0.0" + "@metamask/eth-json-rpc-middleware" "^15.0.1" + "@metamask/eth-json-rpc-provider" "^4.1.7" + "@metamask/eth-query" "^4.0.0" + "@metamask/json-rpc-engine" "^10.0.2" + "@metamask/rpc-errors" "^7.0.2" + "@metamask/swappable-obj-proxy" "^2.3.0" + "@metamask/utils" "^11.0.1" + async-mutex "^0.5.0" + fast-deep-equal "^3.1.3" + immer "^9.0.6" + loglevel "^1.8.1" + reselect "^5.1.1" + uri-js "^4.4.1" + uuid "^8.3.2" + "@metamask/nonce-tracker@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@metamask/nonce-tracker/-/nonce-tracker-6.0.0.tgz#ada64bdfd469acac5f5f83b914b470025c065ae3" @@ -5175,7 +5207,7 @@ "@metamask/utils" "^10.0.0" cockatiel "^3.1.2" -"@metamask/rpc-errors@7.0.1", "@metamask/rpc-errors@^6.2.1", "@metamask/rpc-errors@^7.0.0", "@metamask/rpc-errors@^7.0.1": +"@metamask/rpc-errors@7.0.1", "@metamask/rpc-errors@^6.2.1", "@metamask/rpc-errors@^7.0.0", "@metamask/rpc-errors@^7.0.1", "@metamask/rpc-errors@^7.0.2": version "7.0.1" resolved "https://registry.yarnpkg.com/@metamask/rpc-errors/-/rpc-errors-7.0.1.tgz#0eb2231a1d5e6bb102df5ac07f365c695bf70055" integrity sha512-EeQGYioq845w2iBmiR9LHYqHhYIaeDTmxprHpPE3BTlkLB74P0xLv/TivOn4snNLowiC5ekOXfcUzCQszTDmSg== @@ -5444,7 +5476,7 @@ lodash "^4.17.21" uuid "^8.3.2" -"@metamask/utils@^10.0.0", "@metamask/utils@^10.0.1", "@metamask/utils@^8.2.0", "@metamask/utils@^8.3.0", "@metamask/utils@^9.0.0", "@metamask/utils@^9.1.0", "@metamask/utils@^9.2.1": +"@metamask/utils@^10.0.0", "@metamask/utils@^10.0.1", "@metamask/utils@^11.0.1", "@metamask/utils@^8.2.0", "@metamask/utils@^8.3.0", "@metamask/utils@^9.0.0", "@metamask/utils@^9.1.0", "@metamask/utils@^9.2.1", "@metamask/utils@^9.3.0": version "10.0.1" resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-10.0.1.tgz#a765f96c20e35fc51c068fb9f88a3332b40b215e" integrity sha512-zHgAitJtRwviVVFnRUA2PLRMaAwatr3jiHgiH7mPicJaeSK4ma01aGR4fHy0iy5tlVo1ZiioTmJ1Hbp8FZ6pSg==