Skip to content

Commit

Permalink
Update @metamask/controller-utils to v3.4 (#6884)
Browse files Browse the repository at this point in the history
The `@metamask/controller-utils` package has been updated to v3.4. This
package had previously been held back because v3.1.0 introduced a usage
of the BigInt API, which was a compatibility issue. But that should no
longer be a problem now that React Native has been upgraded.

There were no breaking changes in this range of updates, but there were
a few additions and rearrangements that required substantial patch
updates.

This change was done to simplify PR #6872, which is part of
MetaMask/mobile-planning#798
  • Loading branch information
Gudahtt authored Jul 25, 2023
1 parent abbd9b2 commit 32ea4dd
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 69 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
"react-native-level-fs/**/bl": "^1.2.3",
"react-native-level-fs/**/semver": "^4.3.2",
"@metamask/contract-metadata": "^2.1.0",
"@metamask/controller-utils": "~3.0.0",
"@metamask/approval-controller": "3.4.0",
"@exodus/react-native-payments/validator": "^13.7.0",
"react-devtools-core": "4.22.1",
Expand Down Expand Up @@ -158,7 +157,7 @@
"@metamask/base-controller": "^2.0.0",
"@metamask/composable-controller": "^2.0.0",
"@metamask/contract-metadata": "^2.1.0",
"@metamask/controller-utils": "~3.0.0",
"@metamask/controller-utils": "^3.4.0",
"@metamask/design-tokens": "^1.11.1",
"@metamask/eth-sig-util": "^4.0.1",
"@metamask/etherscan-link": "^2.0.0",
Expand Down
64 changes: 0 additions & 64 deletions patches/@metamask+controller-utils+3.0.0.patch

This file was deleted.

152 changes: 152 additions & 0 deletions patches/@metamask+controller-utils+3.4.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
diff --git a/node_modules/@metamask/controller-utils/dist/constants.d.ts b/node_modules/@metamask/controller-utils/dist/constants.d.ts
index c8e8769..a78401d 100644
--- a/node_modules/@metamask/controller-utils/dist/constants.d.ts
+++ b/node_modules/@metamask/controller-utils/dist/constants.d.ts
@@ -27,6 +27,7 @@ export declare const ASSET_TYPES: {
export declare const TESTNET_TICKER_SYMBOLS: {
GOERLI: string;
SEPOLIA: string;
+ LINEA_GOERLI: string;
};
/**
* Map of all build-in Infura networks to their network, ticker and chain IDs.
@@ -53,6 +54,20 @@ export declare const BUILT_IN_NETWORKS: {
readonly blockExplorerUrl: "https://etherscan.io";
};
};
+ readonly "linea-goerli": {
+ readonly chainId: NetworksChainId["linea-goerli"];
+ readonly ticker: NetworksTicker["linea-goerli"];
+ readonly rpcPrefs: {
+ readonly blockExplorerUrl: "https://explorer.goerli.linea.build";
+ };
+ };
+ readonly "linea-mainnet": {
+ readonly chainId: NetworksChainId["linea-mainnet"];
+ readonly ticker: NetworksTicker["linea-mainnet"];
+ readonly rpcPrefs: {
+ readonly blockExplorerUrl: "https://lineascan.build";
+ };
+ };
readonly localhost: {
readonly chainId: NetworksChainId.localhost;
readonly blockExplorerUrl: undefined;
diff --git a/node_modules/@metamask/controller-utils/dist/constants.js b/node_modules/@metamask/controller-utils/dist/constants.js
index 7bef0e7..07e2249 100644
--- a/node_modules/@metamask/controller-utils/dist/constants.js
+++ b/node_modules/@metamask/controller-utils/dist/constants.js
@@ -36,6 +36,7 @@ exports.ASSET_TYPES = {
exports.TESTNET_TICKER_SYMBOLS = {
GOERLI: 'GoerliETH',
SEPOLIA: 'SepoliaETH',
+ LINEA_GOERLI: 'LineaETH'
};
/**
* Map of all build-in Infura networks to their network, ticker and chain IDs.
@@ -62,6 +63,20 @@ exports.BUILT_IN_NETWORKS = {
blockExplorerUrl: 'https://etherscan.io',
},
},
+ [types_1.NetworkType["linea-goerli"]]: {
+ chainId: types_1.NetworksChainId["linea-goerli"],
+ ticker: types_1.NetworksTicker["linea-goerli"],
+ rpcPrefs: {
+ blockExplorerUrl: 'https://explorer.goerli.linea.build',
+ },
+ },
+ [types_1.NetworkType["linea-mainnet"]]: {
+ chainId: types_1.NetworksChainId["linea-mainnet"],
+ ticker: types_1.NetworksTicker["linea-mainnet"],
+ rpcPrefs: {
+ blockExplorerUrl: 'https://lineascan.build',
+ },
+ },
[types_1.NetworkType.localhost]: {
chainId: types_1.NetworksChainId.localhost,
blockExplorerUrl: undefined,
@@ -107,5 +122,7 @@ exports.NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = {
[types_1.NetworkId.goerli]: types_1.NetworkType.goerli,
[types_1.NetworkId.sepolia]: types_1.NetworkType.sepolia,
[types_1.NetworkId.mainnet]: types_1.NetworkType.mainnet,
+ [types_1.NetworkId["linea-goerli"]]: types_1.NetworkType["linea-goerli"],
+ [types_1.NetworkId["linea-mainnet"]]: types_1.NetworkType["linea-mainnet"],
};
//# sourceMappingURL=constants.js.map
diff --git a/node_modules/@metamask/controller-utils/dist/types.d.ts b/node_modules/@metamask/controller-utils/dist/types.d.ts
index 014dbb9..1d6189b 100644
--- a/node_modules/@metamask/controller-utils/dist/types.d.ts
+++ b/node_modules/@metamask/controller-utils/dist/types.d.ts
@@ -6,6 +6,8 @@ export declare enum NetworkType {
mainnet = "mainnet",
goerli = "goerli",
sepolia = "sepolia",
+ "linea-goerli" = 'linea-goerli',
+ "linea-mainnet" = 'linea-mainnet',
rpc = "rpc"
}
/**
@@ -19,18 +21,24 @@ export declare enum NetworksChainId {
mainnet = "1",
goerli = "5",
sepolia = "11155111",
+ "linea-goerli" = "59140",
+ "linea-mainnet" = "59144",
localhost = "",
rpc = ""
}
export declare enum NetworkId {
mainnet = "1",
goerli = "5",
- sepolia = "11155111"
+ sepolia = "11155111",
+ "linea-goerli" = "59140",
+ "linea-mainnet" = "59144"
}
export declare enum NetworksTicker {
mainnet = "ETH",
goerli = "GoerliETH",
sepolia = "SepoliaETH",
+ "linea-goerli" = 'LineaETH',
+ "linea-mainnet" = 'ETH',
localhost = "",
rpc = ""
}
diff --git a/node_modules/@metamask/controller-utils/dist/types.js b/node_modules/@metamask/controller-utils/dist/types.js
index 398c77b..604bda1 100644
--- a/node_modules/@metamask/controller-utils/dist/types.js
+++ b/node_modules/@metamask/controller-utils/dist/types.js
@@ -10,6 +10,8 @@ var NetworkType;
NetworkType["mainnet"] = "mainnet";
NetworkType["goerli"] = "goerli";
NetworkType["sepolia"] = "sepolia";
+ NetworkType["linea-goerli"] = "linea-goerli";
+ NetworkType["linea-mainnet"] = "linea-mainnet";
NetworkType["rpc"] = "rpc";
})(NetworkType = exports.NetworkType || (exports.NetworkType = {}));
/**
@@ -27,6 +29,8 @@ var NetworksChainId;
NetworksChainId["mainnet"] = "1";
NetworksChainId["goerli"] = "5";
NetworksChainId["sepolia"] = "11155111";
+ NetworksChainId["linea-goerli"] = "59140";
+ NetworksChainId["linea-mainnet"] = "59144";
NetworksChainId["localhost"] = "";
NetworksChainId["rpc"] = "";
})(NetworksChainId = exports.NetworksChainId || (exports.NetworksChainId = {}));
@@ -35,12 +39,16 @@ var NetworkId;
NetworkId["mainnet"] = "1";
NetworkId["goerli"] = "5";
NetworkId["sepolia"] = "11155111";
+ NetworkId["linea-goerli"] = "59140";
+ NetworkId["linea-mainnet"] = "59144";
})(NetworkId = exports.NetworkId || (exports.NetworkId = {}));
var NetworksTicker;
(function (NetworksTicker) {
NetworksTicker["mainnet"] = "ETH";
NetworksTicker["goerli"] = "GoerliETH";
NetworksTicker["sepolia"] = "SepoliaETH";
+ NetworksTicker["linea-goerli"] = "LineaETH";
+ NetworksTicker["linea-mainnet"] = "ETH";
NetworksTicker["localhost"] = "";
NetworksTicker["rpc"] = "";
})(NetworksTicker = exports.NetworksTicker || (exports.NetworksTicker = {}));
69 changes: 66 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5299,7 +5299,19 @@
resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-2.2.0.tgz#277764d0d56e37180ae7644a9d11eb96295b36fc"
integrity sha512-SM6A4C7vXNbVpgMTX67kfW8QWvu3eSXxMZlY5PqZBTkvri1s9zgQ0uwRkK5r2VXNEoVmXCDnnEX/tX5EzzgNUQ==

"@metamask/controller-utils@^1.0.0", "@metamask/controller-utils@^3.0.0", "@metamask/controller-utils@^3.4.0", "@metamask/controller-utils@^4.0.1", "@metamask/controller-utils@~3.0.0":
"@metamask/controller-utils@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-1.0.0.tgz#2e2261b65c3f38ba0c5b893743fca8cce764339c"
integrity sha512-LXIpnmF/C5/vCBX0u2DiUWA55utZy54guUV+A8qUYmz8PvZrXfK7mdq1zlk8z0aq+aO0rHHfSVbTNacEE3TlAQ==
dependencies:
eth-ens-namehash "^2.0.8"
eth-rpc-errors "^4.0.0"
ethereumjs-util "^7.0.10"
ethjs-unit "^0.1.6"
fast-deep-equal "^3.1.3"
isomorphic-fetch "^3.0.0"

"@metamask/controller-utils@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-3.0.0.tgz#e0984cdab14280409297671b5858891527c5e4ee"
integrity sha512-JjFWBZnnh5DSX2tRsw5xtXxaqVkTzaW7mkSZ+lL3LoCAw47Cf8zGP1kGR6VKxcceKi+MpEFvZr7gf1OFnOoEjw==
Expand All @@ -5310,6 +5322,33 @@
ethjs-unit "^0.1.6"
fast-deep-equal "^3.1.3"

"@metamask/controller-utils@^3.4.0":
version "3.4.0"
resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-3.4.0.tgz#3714799a3e2648cd758272612578238749e3e11b"
integrity sha512-/++y7qXUd9+aRzOklypfzmehO87QVKndlJXsbLRk36W5L5DJo4lrR2pd/IBbwbWEhFJWHhlfbMD+T+gEBvIftw==
dependencies:
"@metamask/utils" "^5.0.1"
"@spruceid/siwe-parser" "1.1.3"
eth-ens-namehash "^2.0.8"
eth-rpc-errors "^4.0.2"
ethereumjs-util "^7.0.10"
ethjs-unit "^0.1.6"
fast-deep-equal "^3.1.3"

"@metamask/controller-utils@^4.0.1":
version "4.3.0"
resolved "https://registry.yarnpkg.com/@metamask/controller-utils/-/controller-utils-4.3.0.tgz#63d6fef8ddbdf42ed0b94a0cf929d1898832004c"
integrity sha512-WVbapIpjEJtKxZz/1w5DctnZ0h7V3OWu0X46MHEmV8Brna/nN8x6UZ4zySLD9tZGFaO7p3vxJpl7/EK8nSvf9A==
dependencies:
"@metamask/utils" "^6.2.0"
"@spruceid/siwe-parser" "1.1.3"
eth-ens-namehash "^2.0.8"
eth-query "^2.1.2"
eth-rpc-errors "^4.0.2"
ethereumjs-util "^7.0.10"
ethjs-unit "^0.1.6"
fast-deep-equal "^3.1.3"

"@metamask/controllers@^26.0.0":
version "26.0.0"
resolved "git+https://github.com/MetaMask/controllers.git#d4e9507d9612f2d36c3f848333b33330a19b811b"
Expand Down Expand Up @@ -5607,7 +5646,7 @@
semver "^7.3.8"
superstruct "^1.0.3"

"@metamask/utils@^5.0.2":
"@metamask/utils@^5.0.1", "@metamask/utils@^5.0.2":
version "5.0.2"
resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-5.0.2.tgz#140ba5061d90d9dac0280c19cab101bc18c8857c"
integrity sha512-yfmE79bRQtnMzarnKfX7AEJBwFTxvTyw3nBQlu/5rmGXrjAeAMltoGxO62TFurxrQAFMNa/fEjIHNvungZp0+g==
Expand All @@ -5618,6 +5657,18 @@
semver "^7.3.8"
superstruct "^1.0.3"

"@metamask/utils@^6.2.0":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-6.2.0.tgz#7e63ad2db33117df6fef89449db3a86dcd6b42b5"
integrity sha512-nM5CujDd4STfwx4ic/gim9G1W9oZcWUGKN4WbAT4waEkqNSIluVmZeHgxUKvdajZ7iCFDnjDLajkD4sP7c/ClQ==
dependencies:
"@ethereumjs/tx" "^4.1.2"
"@noble/hashes" "^1.3.1"
"@types/debug" "^4.1.7"
debug "^4.3.4"
semver "^7.3.8"
superstruct "^1.0.3"

"@ngraveio/bc-ur@^1.1.5", "@ngraveio/bc-ur@^1.1.6":
version "1.1.6"
resolved "https://registry.yarnpkg.com/@ngraveio/bc-ur/-/bc-ur-1.1.6.tgz#8f8c75fff22f6a5e4dfbc5a6b540d7fe8f42cd39"
Expand Down Expand Up @@ -5648,7 +5699,7 @@
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1"
integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==

"@noble/hashes@^1.3.0", "@noble/hashes@~1.3.0":
"@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.0":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9"
integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==
Expand Down Expand Up @@ -6387,6 +6438,13 @@
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553"
integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==

"@spruceid/siwe-parser@1.1.3":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@spruceid/siwe-parser/-/siwe-parser-1.1.3.tgz#0eebe8bbd63c6de89cb44c06b6329b00b305df65"
integrity sha512-oQ8PcwDqjGWJvLmvAF2yzd6iniiWxK0Qtz+Dw+gLD/W5zOQJiKIUXwslHOm8VB8OOOKW9vfR3dnPBhHaZDvRsw==
dependencies:
apg-js "^4.1.1"

"@stablelib/aead@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@stablelib/aead/-/aead-1.0.1.tgz#c4b1106df9c23d1b867eb9b276d8f42d5fc4c0c3"
Expand Down Expand Up @@ -9130,6 +9188,11 @@ anymatch@^3.0.3, anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"

apg-js@^4.1.1:
version "4.1.3"
resolved "https://registry.yarnpkg.com/apg-js/-/apg-js-4.1.3.tgz#0cb9dc99f8830740d7a8f9fc0048fa618ae4d199"
integrity sha512-XYyDcoBho8OpnWPRnedMwyL+76ovCtsESerHZEfY39dO4IrEqN97mdEYkOyHa0XTX5+3+U5FmpqPLttK0f7n6g==

appdirsjs@^1.2.4:
version "1.2.6"
resolved "https://registry.yarnpkg.com/appdirsjs/-/appdirsjs-1.2.6.tgz#fccf9ee543315492867cacfcfd4a2b32257d30ac"
Expand Down

0 comments on commit 32ea4dd

Please sign in to comment.