Skip to content

Commit

Permalink
Update controller-utils patch to restore constants
Browse files Browse the repository at this point in the history
The constants `MAINNET` and `TESTNET_TICKER_SYMBOLS` were removed in
v3.1.0, which was accidentally omitted from the changelog and not
considered in the release version (this should have been a breaking
change).

They have been restored until we no longer rely on packages that use
`@metamask/controller-utils` at versions under v3.1.0.
  • Loading branch information
Gudahtt committed Jul 26, 2023
1 parent 772da01 commit 47c3121
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions patches/@metamask+controller-utils+3.4.0.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
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
index c8e8769..00e617f 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: {
@@ -1,4 +1,7 @@
import { NetworkType, NetworksTicker, NetworksChainId, NetworkId } from './types';
+// PATCH: Restore `MAINNET` constant, which was removed in v3.1.0
+// We need this patch until there are no remaining dependencies on <v3.1.0
+export declare const MAINNET = 'mainnet';
export declare const RPC = "rpc";
export declare const FALL_BACK_VS_CURRENCY = "ETH";
export declare const IPFS_DEFAULT_GATEWAY_URL = "https://cloudflare-ipfs.com/ipfs/";
@@ -27,6 +30,13 @@ export declare const ASSET_TYPES: {
export declare const TESTNET_TICKER_SYMBOLS: {
GOERLI: string;
SEPOLIA: string;
+ LINEA_GOERLI: string;
+};
+// PATCH: Restore `TESTNET_NETWORK_TYPE_TO_TICKER_SYMBOL` constant, which was removed in v3.1.0
+// We need this patch until there are no remaining dependencies on <v3.1.0
+export declare const TESTNET_TICKER_SYMBOLS: {
+ GOERLI: string;
+ SEPOLIA: 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: {
@@ -53,6 +63,20 @@ export declare const BUILT_IN_NETWORKS: {
readonly blockExplorerUrl: "https://etherscan.io";
};
};
Expand All @@ -32,18 +46,37 @@ index c8e8769..a78401d 100644
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
index 7bef0e7..92c4143 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 = {
@@ -2,6 +2,9 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = exports.ApprovalType = exports.ORIGIN_METAMASK = exports.OPENSEA_TEST_API_URL = exports.OPENSEA_API_URL = exports.OPENSEA_PROXY_URL = exports.BUILT_IN_NETWORKS = exports.TESTNET_TICKER_SYMBOLS = exports.ASSET_TYPES = exports.GWEI = exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = exports.ERC1155_METADATA_URI_INTERFACE_ID = exports.ERC1155_INTERFACE_ID = exports.ERC721_ENUMERABLE_INTERFACE_ID = exports.ERC721_METADATA_INTERFACE_ID = exports.ERC721_INTERFACE_ID = exports.ERC20 = exports.ERC1155 = exports.ERC721 = exports.MAX_SAFE_CHAIN_ID = exports.GANACHE_CHAIN_ID = exports.IPFS_DEFAULT_GATEWAY_URL = exports.FALL_BACK_VS_CURRENCY = exports.RPC = void 0;
const types_1 = require("./types");
+// PATCH: Restore `MAINNET` constant, which was removed in v3.1.0
+// We need this patch until there are no remaining dependencies on <v3.1.0
+exports.MAINNET = 'mainnet';
exports.RPC = 'rpc';
exports.FALL_BACK_VS_CURRENCY = 'ETH';
exports.IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';
@@ -36,6 +39,16 @@ exports.ASSET_TYPES = {
exports.TESTNET_TICKER_SYMBOLS = {
GOERLI: 'GoerliETH',
SEPOLIA: 'SepoliaETH',
+ LINEA_GOERLI: 'LineaETH'
+};
+// PATCH: Restore `TESTNET_NETWORK_TYPE_TO_TICKER_SYMBOL` constant, which was removed in v3.1.0
+// We need this patch until there are no remaining dependencies on <v3.1.0
+exports.TESTNET_NETWORK_TYPE_TO_TICKER_SYMBOL = {
+ goerli: 'GoerliETH',
+ sepolia: 'SepoliaETH',
+ mainnet: '',
+ rpc: '',
+ localhost: '',
};
/**
* Map of all build-in Infura networks to their network, ticker and chain IDs.
@@ -62,6 +63,20 @@ exports.BUILT_IN_NETWORKS = {
@@ -62,6 +75,20 @@ exports.BUILT_IN_NETWORKS = {
blockExplorerUrl: 'https://etherscan.io',
},
},
Expand All @@ -64,7 +97,7 @@ index 7bef0e7..07e2249 100644
[types_1.NetworkType.localhost]: {
chainId: types_1.NetworksChainId.localhost,
blockExplorerUrl: undefined,
@@ -107,5 +122,7 @@ exports.NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = {
@@ -107,5 +134,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,
Expand All @@ -73,7 +106,7 @@ index 7bef0e7..07e2249 100644
};
//# 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
index 014dbb9..e7f7934 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 {
Expand Down Expand Up @@ -112,7 +145,7 @@ index 014dbb9..1d6189b 100644
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
index 398c77b..accac2c 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;
Expand Down

0 comments on commit 47c3121

Please sign in to comment.