Skip to content

Commit 07b3e53

Browse files
amitabh94bergarces
andauthored
feat(assets): bump assets-controllers (#35540)
## **Description** Bump `@metamask/assets-controllers` to 74.3.1 (via Yarn patch). No user-facing changes. Repository updates include LavaMoat policy refresh and a small unit-test adjustment. - Dependency: `@metamask/assets-controllers` → 74.3.1 (`.yarn/patches/@metamask-assets-controllers-npm-74.3.1-*.patch`) - Security: update LavaMoat Browserify policies (`lavamoat/browserify/*/policy.json`) - Tests: update `ui/components/multichain/pages/send/components/recipient-content.test.tsx` ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: - Internal: [ASSETS-1126](https://consensyssoftware.atlassian.net/browse/ASSETS-1126) ## **Manual testing steps** 1. Install and build - `yarn` and `yarn build` 2. Run unit tests - `yarn jest ui/components/multichain/pages/send/components/recipient-content.test.tsx` 3. Smoke run (no functional diffs expected) ## **Screenshots/Recordings** ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [ASSETS-1126]: https://consensyssoftware.atlassian.net/browse/ASSETS-1126?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Bernardo Garces Chapero <bernardo.chapero@consensys.net>
1 parent 5b65fa2 commit 07b3e53

9 files changed

Lines changed: 52 additions & 82 deletions

File tree

.yarn/patches/@metamask-assets-controllers-npm-73.3.0-d10ff27dec.patch

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/dist/assetsUtil.cjs b/dist/assetsUtil.cjs
2+
index 2c759f2ecc76b0a6f467166a2e4d077dc951445e..a29468add0e2c43015be096f3aba3271879d735d 100644
3+
--- a/dist/assetsUtil.cjs
4+
+++ b/dist/assetsUtil.cjs
5+
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6+
return (mod && mod.__esModule) ? mod : { "default": mod };
7+
};
8+
Object.defineProperty(exports, "__esModule", { value: true });
9+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
10+
exports.accountAddressToCaipReference = exports.getKeyByValue = exports.fetchTokenContractExchangeRates = exports.reduceInBatchesSerially = exports.divideIntoBatches = exports.ethersBigNumberToBN = exports.addUrlProtocolPrefix = exports.getFormattedIpfsUrl = exports.getIpfsCIDv1AndPath = exports.removeIpfsProtocolPrefix = exports.isTokenListSupportedForNetwork = exports.isTokenDetectionSupportedForNetwork = exports.SupportedStakedBalanceNetworks = exports.SupportedTokenDetectionNetworks = exports.formatIconUrlWithProxy = exports.formatAggregatorNames = exports.hasNewCollectionFields = exports.compareNftMetadata = exports.TOKEN_PRICES_BATCH_SIZE = void 0;
11+
const controller_utils_1 = require("@metamask/controller-utils");
12+
const utils_1 = require("@metamask/utils");
13+
@@ -237,7 +238,8 @@ async function getIpfsCIDv1AndPath(ipfsUrl) {
14+
const index = url.indexOf('/');
15+
const cid = index !== -1 ? url.substring(0, index) : url;
16+
const path = index !== -1 ? url.substring(index) : undefined;
17+
- const { CID } = await import("multiformats");
18+
+ // Use CJS require to allow Jest to parse without ESM transform
19+
+ const { CID } = _interopRequireWildcard(require("multiformats"));
20+
// We want to ensure that the CID is v1 (https://docs.ipfs.io/concepts/content-addressing/#identifier-formats)
21+
// because most cid v0s appear to be incompatible with IPFS subdomains
22+
return {

lavamoat/browserify/beta/policy.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@
928928
"immer": true,
929929
"lodash": true,
930930
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
931+
"reselect": true,
931932
"single-call-balance-checker-abi": true,
932933
"uuid": true
933934
}

lavamoat/browserify/experimental/policy.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@
928928
"immer": true,
929929
"lodash": true,
930930
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
931+
"reselect": true,
931932
"single-call-balance-checker-abi": true,
932933
"uuid": true
933934
}

lavamoat/browserify/flask/policy.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@
928928
"immer": true,
929929
"lodash": true,
930930
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
931+
"reselect": true,
931932
"single-call-balance-checker-abi": true,
932933
"uuid": true
933934
}

lavamoat/browserify/main/policy.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@
928928
"immer": true,
929929
"lodash": true,
930930
"@ensdomains/content-hash>multicodec>uint8arrays>multiformats": true,
931+
"reselect": true,
931932
"single-call-balance-checker-abi": true,
932933
"uuid": true
933934
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
"@metamask/address-book-controller": "^6.1.0",
272272
"@metamask/announcement-controller": "^7.0.3",
273273
"@metamask/approval-controller": "^7.0.0",
274-
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A73.3.0#~/.yarn/patches/@metamask-assets-controllers-npm-73.3.0-d10ff27dec.patch",
274+
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A74.3.1#~/.yarn/patches/@metamask-assets-controllers-npm-74.3.1-900afb3754.patch",
275275
"@metamask/base-controller": "^8.2.0",
276276
"@metamask/bitcoin-wallet-snap": "^1.0.0",
277277
"@metamask/bridge-controller": "^39.1.0",

ui/components/multichain/pages/send/components/recipient-content.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ import { AssetType } from '../../../../../../shared/constants/transaction';
1717
import { getSendHexDataFeatureFlagState } from '../../../../../ducks/metamask/metamask';
1818
import { SendPageRecipientContent } from './recipient-content';
1919

20-
jest.mock('reselect', () => ({
21-
createSelector: jest.fn(),
22-
}));
20+
jest.mock('reselect', () => {
21+
const createSelector = Object.assign(jest.fn(), {
22+
withTypes: () => jest.fn(),
23+
});
24+
return { createSelector };
25+
});
2326

2427
jest.mock('../../../../../../shared/modules/selectors/util', () => ({
2528
createDeepEqualSelector: jest.fn(),

yarn.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5423,9 +5423,9 @@ __metadata:
54235423
languageName: node
54245424
linkType: hard
54255425

5426-
"@metamask/assets-controllers@npm:73.3.0":
5427-
version: 73.3.0
5428-
resolution: "@metamask/assets-controllers@npm:73.3.0"
5426+
"@metamask/assets-controllers@npm:74.3.1":
5427+
version: 74.3.1
5428+
resolution: "@metamask/assets-controllers@npm:74.3.1"
54295429
dependencies:
54305430
"@ethereumjs/util": "npm:^9.1.0"
54315431
"@ethersproject/abi": "npm:^5.7.0"
@@ -5434,7 +5434,7 @@ __metadata:
54345434
"@ethersproject/contracts": "npm:^5.7.0"
54355435
"@ethersproject/providers": "npm:^5.7.0"
54365436
"@metamask/abi-utils": "npm:^2.0.3"
5437-
"@metamask/base-controller": "npm:^8.1.0"
5437+
"@metamask/base-controller": "npm:^8.2.0"
54385438
"@metamask/contract-metadata": "npm:^2.4.0"
54395439
"@metamask/controller-utils": "npm:^11.12.0"
54405440
"@metamask/eth-query": "npm:^4.0.0"
@@ -5458,24 +5458,24 @@ __metadata:
54585458
uuid: "npm:^8.3.2"
54595459
peerDependencies:
54605460
"@metamask/account-tree-controller": ^0.7.0
5461-
"@metamask/accounts-controller": ^32.0.0
5461+
"@metamask/accounts-controller": ^33.0.0
54625462
"@metamask/approval-controller": ^7.0.0
5463-
"@metamask/keyring-controller": ^22.0.0
5463+
"@metamask/keyring-controller": ^23.0.0
54645464
"@metamask/network-controller": ^24.0.0
54655465
"@metamask/permission-controller": ^11.0.0
54665466
"@metamask/phishing-controller": ^13.0.0
5467-
"@metamask/preferences-controller": ^18.0.0
5467+
"@metamask/preferences-controller": ^19.0.0
54685468
"@metamask/providers": ^22.0.0
54695469
"@metamask/snaps-controllers": ^14.0.0
5470-
"@metamask/transaction-controller": ^59.0.0
5470+
"@metamask/transaction-controller": ^60.0.0
54715471
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
5472-
checksum: 10/06da8680bb294ac0226318ebded9ed305817630b3bde1262c391f7cfd04ce39860237f323e893fe78350da19cdef2b08bc5a8773092f6b65abeed91aed718be8
5472+
checksum: 10/3dc5c114065edc87b81b9b70f374480089d715267bca64d01fe69f4e9e03e1a31161ef2eab509cef9bc8c4bc654e0ca45702038c5560d4c2a8d1bfe6dd89feea
54735473
languageName: node
54745474
linkType: hard
54755475

5476-
"@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A73.3.0#~/.yarn/patches/@metamask-assets-controllers-npm-73.3.0-d10ff27dec.patch":
5477-
version: 73.3.0
5478-
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A73.3.0#~/.yarn/patches/@metamask-assets-controllers-npm-73.3.0-d10ff27dec.patch::version=73.3.0&hash=396bf0"
5476+
"@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A74.3.1#~/.yarn/patches/@metamask-assets-controllers-npm-74.3.1-900afb3754.patch":
5477+
version: 74.3.1
5478+
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A74.3.1#~/.yarn/patches/@metamask-assets-controllers-npm-74.3.1-900afb3754.patch::version=74.3.1&hash=d212d8"
54795479
dependencies:
54805480
"@ethereumjs/util": "npm:^9.1.0"
54815481
"@ethersproject/abi": "npm:^5.7.0"
@@ -5484,7 +5484,7 @@ __metadata:
54845484
"@ethersproject/contracts": "npm:^5.7.0"
54855485
"@ethersproject/providers": "npm:^5.7.0"
54865486
"@metamask/abi-utils": "npm:^2.0.3"
5487-
"@metamask/base-controller": "npm:^8.1.0"
5487+
"@metamask/base-controller": "npm:^8.2.0"
54885488
"@metamask/contract-metadata": "npm:^2.4.0"
54895489
"@metamask/controller-utils": "npm:^11.12.0"
54905490
"@metamask/eth-query": "npm:^4.0.0"
@@ -5508,18 +5508,18 @@ __metadata:
55085508
uuid: "npm:^8.3.2"
55095509
peerDependencies:
55105510
"@metamask/account-tree-controller": ^0.7.0
5511-
"@metamask/accounts-controller": ^32.0.0
5511+
"@metamask/accounts-controller": ^33.0.0
55125512
"@metamask/approval-controller": ^7.0.0
5513-
"@metamask/keyring-controller": ^22.0.0
5513+
"@metamask/keyring-controller": ^23.0.0
55145514
"@metamask/network-controller": ^24.0.0
55155515
"@metamask/permission-controller": ^11.0.0
55165516
"@metamask/phishing-controller": ^13.0.0
5517-
"@metamask/preferences-controller": ^18.0.0
5517+
"@metamask/preferences-controller": ^19.0.0
55185518
"@metamask/providers": ^22.0.0
55195519
"@metamask/snaps-controllers": ^14.0.0
5520-
"@metamask/transaction-controller": ^59.0.0
5520+
"@metamask/transaction-controller": ^60.0.0
55215521
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
5522-
checksum: 10/cc76229f86a76558a403d175e902c233f7398142217563e15481710697d6984cde6581aa700769995bce0b7d193d85831e2726402ce3705a17687563cd58630d
5522+
checksum: 10/a692dc4c20ac59f9ccf232ba2db2dfbd7c175753fbb148c95d124da68104d13746d9e88fa3cea02733354f6cce338e9e7a60016fca8da3ecabde1ca61f84d3b9
55235523
languageName: node
55245524
linkType: hard
55255525

@@ -31730,7 +31730,7 @@ __metadata:
3173031730
"@metamask/announcement-controller": "npm:^7.0.3"
3173131731
"@metamask/api-specs": "npm:^0.13.0"
3173231732
"@metamask/approval-controller": "npm:^7.0.0"
31733-
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A73.3.0#~/.yarn/patches/@metamask-assets-controllers-npm-73.3.0-d10ff27dec.patch"
31733+
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A74.3.1#~/.yarn/patches/@metamask-assets-controllers-npm-74.3.1-900afb3754.patch"
3173431734
"@metamask/auto-changelog": "npm:^2.1.0"
3173531735
"@metamask/base-controller": "npm:^8.2.0"
3173631736
"@metamask/bitcoin-wallet-snap": "npm:^1.0.0"

0 commit comments

Comments
 (0)