Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to TypeScript v5.0 and set module{,Resolution} option to Node16 #3645

Merged
merged 61 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
bf479b4
Bump TypeScript to `~5.0.4`
MajorLift Dec 9, 2023
5084b8f
Set tsconfig `module`, `moduleResolution` options to `NodeNext`
MajorLift May 9, 2024
1d77aa8
'yarn build:types' works
mcmire Mar 14, 2024
dd45b15
Apply yarn patches to replace superstruct imports with `@metamask/sup…
MajorLift Jun 27, 2024
6e73a35
Linter fixes
MajorLift Jun 27, 2024
cad9be5
Bump TypeScript to `~5.0.4` in remaining packages
MajorLift May 31, 2024
a014d03
Fix missing yarn patch for `@metamask/keyring-api@^6.1.1`
MajorLift Jun 27, 2024
1d8944a
Replace `multiformats` import with dynamic import, and convert method…
MajorLift May 31, 2024
c509fb4
Apply `--experimental-vm-modules` flag to jest test scripts to enable…
MajorLift May 31, 2024
94ddd59
Update yarn constraints to apply `--experimental-vm-modules` flag to …
MajorLift Jun 27, 2024
c21f3f9
Remove `EthErc4337Method` enum usage due to upstream removal
MajorLift Jun 2, 2024
1b6fec9
Apply yarn patch to new `@metamask/keyring-api` version
MajorLift Jun 27, 2024
8a5c556
Linter fixes
MajorLift Jun 27, 2024
853340d
Linter fixes
MajorLift Jun 3, 2024
aceb333
Bump dependencies requiring new releases to latest
MajorLift Jun 27, 2024
fc9c89f
Apply yarn patch for `@metamask/snaps-sdk` `^4.4.1`
MajorLift Jun 27, 2024
6af5113
Apply yarn patch for `@metamask/snaps-utils` `^7.4.1`
MajorLift Jun 27, 2024
dc29903
Update yarn resolutions for dependencies affected by `superstruct` issue
MajorLift Jun 27, 2024
ac77a7b
Bump `@metamask/utils` from `^8.3.0` to `^8.5.0` in all packages
MajorLift Jun 27, 2024
a8b8a0d
Bump out-of-sync dependencies
MajorLift Jun 25, 2024
b35692d
Force yarn resolution for `@metamask/provider` to `17.1.0` release ca…
MajorLift Jun 26, 2024
4cfe39a
Update resolutions for new releases
MajorLift Jun 27, 2024
468f6d3
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jun 27, 2024
cbf9e38
Remove unused yarn resolution for `superstruct`
MajorLift Jun 27, 2024
55a507e
Remove yarn resolutions for `@metamask/{providers,snaps-registry}`
MajorLift Jun 27, 2024
90962b5
[assets-controllers] Bump `@metamask/abi-utils` from `^2.0.2` to `^2.…
MajorLift Jun 27, 2024
7760b3d
Add yarn patches for `@metamask/snaps-{sdk,utils}` removing `superstr…
MajorLift Jun 27, 2024
cbbd428
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jun 27, 2024
a67c547
Fix subpath imports, which are no longer supported unless specified i…
MajorLift Jun 27, 2024
864ec65
Bump `@metamask/utils` from `^8.5.0` to `^9.0.0`
MajorLift Jun 28, 2024
9bbd37d
Force yarn resolution for `@metamask/utils` to `9.0.0`
MajorLift Jun 29, 2024
bf5d240
Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`
MajorLift Jul 3, 2024
2ca4265
Revert "Force yarn resolution for `@metamask/utils` to `9.0.0`"
MajorLift Jul 3, 2024
cb032c2
Bump `@metamask/chain-api` from `^0.0.1` to `^0.1.0`
MajorLift Jul 3, 2024
07fbffc
Fix lockfile
MajorLift Jul 3, 2024
d9160c6
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 3, 2024
1a1b497
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 5, 2024
9ddd7e6
Replace yarn resolutions for `@metamask/snaps-{sdk,utils}` with wip b…
MajorLift Jul 5, 2024
261638a
Remove unnecessary yarn resolution for `@metamask/eth-snap-keyring`
MajorLift Jul 5, 2024
e0ff883
Remove unused yarn patch files
MajorLift Jul 5, 2024
9226a38
Remove unused entry from .depcheckrc.yml
MajorLift Jul 6, 2024
555ec31
Update jest.config.scripts.js
MajorLift Jul 6, 2024
6defd76
build(tsc): Set `moduleResolution` to `node16`
MajorLift Jul 7, 2024
99abde6
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 8, 2024
0910cea
Dedupe lockfile
MajorLift Jul 8, 2024
f28ecd5
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 10, 2024
67f1484
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 11, 2024
f37057c
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 11, 2024
b0fd3b8
Remove unused `ts-expect-error` directive
MajorLift Jul 11, 2024
b8f8c52
Update yarn resolution for snaps monorepo and fix `@metamask/provider…
MajorLift Jul 14, 2024
87af678
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 14, 2024
f2f7d1f
Remove yarn resolution for `@metamask/providers` `17.0.0`
MajorLift Jul 14, 2024
6f69db3
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 16, 2024
27ba6c5
Bump `@metamask/keyring-api` from `^8.0.0` to `^8.0.1`
MajorLift Jul 17, 2024
b0c81fb
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 17, 2024
09b29ca
Update yarn resolutions for `snaps-{sdk,utils}`
MajorLift Jul 17, 2024
de15ab3
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 17, 2024
59fe394
Bump `@metamask/snaps-sdk` to `^6.1.0`, `@metamask/snaps-utils` to `^…
MajorLift Jul 19, 2024
6b0075d
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 19, 2024
f50b209
Set yarn resolution for `@metamask/[email protected]` dependency `@meta…
MajorLift Jul 19, 2024
5f0b948
Merge branch 'main' into 231208-typescript-module-resolution
MajorLift Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ignores:
- '@metamask/create-release-branch'
- 'depcheck'
- 'eslint-interactive'
- 'rimraf'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only listed as a devDep in the root package.json, where it's used in a build script but not in any modules.

- 'simple-git-hooks'
- 'ts-node'
- 'typedoc'
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,19 @@ gen_enforced_field(WorkspaceCwd, 'scripts.changelog:update', CorrectChangelogUpd
\+ atom_concat(ExpectedPrefix, _, ChangelogUpdateCommand).

% All non-root packages must have the same "test" script.
gen_enforced_field(WorkspaceCwd, 'scripts.test', 'jest --reporters=jest-silent-reporter') :-
gen_enforced_field(WorkspaceCwd, 'scripts.test', 'NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter') :-
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --experimental-vm-modules flag is necessary if there are dynamic imports in the compiled code used by our tests.

WorkspaceCwd \= '.'.

% All non-root packages must have the same "test:clean" script.
gen_enforced_field(WorkspaceCwd, 'scripts.test:clean', 'jest --clearCache') :-
gen_enforced_field(WorkspaceCwd, 'scripts.test:clean', 'NODE_OPTIONS=--experimental-vm-modules jest --clearCache') :-
WorkspaceCwd \= '.'.

% All non-root packages must have the same "test:verbose" script.
gen_enforced_field(WorkspaceCwd, 'scripts.test:verbose', 'jest --verbose') :-
gen_enforced_field(WorkspaceCwd, 'scripts.test:verbose', 'NODE_OPTIONS=--experimental-vm-modules jest --verbose') :-
WorkspaceCwd \= '.'.

% All non-root packages must have the same "test:watch" script.
gen_enforced_field(WorkspaceCwd, 'scripts.test:watch', 'jest --watch') :-
gen_enforced_field(WorkspaceCwd, 'scripts.test:watch', 'NODE_OPTIONS=--experimental-vm-modules jest --watch') :-
WorkspaceCwd \= '.'.

% All dependency ranges must be recognizable (this makes it possible to apply
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"pre-push": "yarn lint"
},
"resolutions": {
"@metamask/[email protected]/@metamask/providers": "17.1.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"tsup@^8.0.2": "patch:tsup@npm%3A8.0.2#./.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch"
},
"devDependencies": {
Expand Down Expand Up @@ -82,10 +83,11 @@
"nock": "^13.3.1",
"prettier": "^2.7.1",
"prettier-plugin-packagejson": "^2.4.5",
"rimraf": "^5.0.5",
"simple-git-hooks": "^2.8.0",
"ts-node": "^10.9.1",
"tsup": "^8.0.2",
"typescript": "~4.9.5",
"typescript": "~5.0.4",
"yargs": "^17.7.2"
},
"packageManager": "[email protected]",
Expand Down
7 changes: 7 additions & 0 deletions packages/accounts-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Uncategorized

- Please hold off on new releases of this package until the yarn resolution for `@metamask/providers` is removed.
- This is blocked by a `@metamask/snaps-sdk` release with `@metamask/providers` bumped to `>=17.1.1`.
- See: [Fix regressions introduced by @metamask/[email protected]](https://github.com/MetaMask/snaps/pull/2579)
- Build error fixed by yarn resolution: [MetaMask/core/actions/runs/10011688901/job/27675682526?pr=3645](https://github.com/MetaMask/core/actions/runs/10011688901/job/27675682526?pr=3645)

Comment on lines +10 to +16
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The packages affected by the yarn resolution are {accounts,chain,profile-sync}-controller. It's safe to temporarily merge the yarn resolution into main, as long as these packages aren't released (and even if they are @metamask/providers is not a direct dependency of any of these packages).

In any case, these three packages will be excluded from the core releases that follow this PR, since they are blocked by a snaps-controllers release as well.

## [17.2.0]

### Added
Expand Down
20 changes: 10 additions & 10 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
"changelog:update": "../../scripts/update-changelog.sh @metamask/accounts-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/accounts-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
"test:clean": "jest --clearCache",
"test:verbose": "jest --verbose",
"test:watch": "jest --watch"
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@ethereumjs/util": "^8.1.0",
"@metamask/base-controller": "^6.0.1",
"@metamask/eth-snap-keyring": "^4.3.1",
"@metamask/keyring-api": "^8.0.0",
"@metamask/keyring-api": "^8.0.1",
"@metamask/keyring-controller": "^17.1.1",
"@metamask/snaps-sdk": "^4.2.0",
"@metamask/snaps-utils": "^7.4.0",
"@metamask/snaps-sdk": "^6.1.0",
"@metamask/snaps-utils": "^7.8.0",
"@metamask/utils": "^9.1.0",
"deepmerge": "^4.2.2",
"ethereum-cryptography": "^2.1.2",
Expand All @@ -56,18 +56,18 @@
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/snaps-controllers": "^8.1.1",
"@metamask/snaps-controllers": "^9.3.0",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
"typescript": "~5.0.4"
},
"peerDependencies": {
"@metamask/keyring-controller": "^17.0.0",
"@metamask/snaps-controllers": "^8.1.1"
"@metamask/snaps-controllers": "^9.3.0"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function createExpectedInternalAccount({
};

const methods =
accountTypeToMethods[type as unknown as keyof typeof accountTypeToMethods];
accountTypeToMethods[type as keyof typeof accountTypeToMethods];

const account = {
id,
Expand Down
3 changes: 2 additions & 1 deletion packages/accounts-controller/src/AccountsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ export class AccountsController extends BaseController<
...account,
metadata: { ...account.metadata, name: accountName },
};
// @ts-expect-error ts(2589)
// Do not remove this comment - This error is flaky: Comment out or restore the `ts-expect-error` directive below as needed.
// // @ts-expect-error Known issue - `Json` causes recursive error in immer `Draft`/`WritableDraft` types
currentState.internalAccounts.accounts[accountId] = internalAccount;
});
}
Expand Down
10 changes: 5 additions & 5 deletions packages/address-book-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"changelog:update": "../../scripts/update-changelog.sh @metamask/address-book-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/address-book-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
"test:clean": "jest --clearCache",
"test:verbose": "jest --verbose",
"test:watch": "jest --watch"
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^6.0.1",
Expand All @@ -53,7 +53,7 @@
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
"typescript": "~5.0.4"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
10 changes: 5 additions & 5 deletions packages/announcement-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"changelog:update": "../../scripts/update-changelog.sh @metamask/announcement-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/announcement-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
"test:clean": "jest --clearCache",
"test:verbose": "jest --verbose",
"test:watch": "jest --watch"
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^6.0.1"
Expand All @@ -51,7 +51,7 @@
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
"typescript": "~5.0.4"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
10 changes: 5 additions & 5 deletions packages/approval-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"changelog:update": "../../scripts/update-changelog.sh @metamask/approval-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/approval-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
"test:clean": "jest --clearCache",
"test:verbose": "jest --verbose",
"test:watch": "jest --watch"
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^6.0.1",
Expand All @@ -55,7 +55,7 @@
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
"typescript": "~5.0.4"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
17 changes: 9 additions & 8 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
"changelog:update": "../../scripts/update-changelog.sh @metamask/assets-controllers",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/assets-controllers",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
"test:clean": "jest --clearCache",
"test:verbose": "jest --verbose",
"test:watch": "jest --watch"
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@ethereumjs/util": "^8.1.0",
"@ethersproject/address": "^5.7.0",
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@metamask/abi-utils": "^2.0.2",
"@metamask/abi-utils": "^2.0.3",
"@metamask/accounts-controller": "^17.2.0",
"@metamask/approval-controller": "^7.0.1",
"@metamask/base-controller": "^6.0.1",
Expand All @@ -65,15 +65,16 @@
"async-mutex": "^0.5.0",
"bn.js": "^5.2.1",
"cockatiel": "^3.1.2",
"immer": "^9.0.6",
"lodash": "^4.17.21",
"multiformats": "^9.5.2",
"multiformats": "^13.1.0",
"single-call-balance-checker-abi": "^1.0.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/ethjs-provider-http": "^0.3.0",
"@metamask/keyring-api": "^8.0.0",
"@metamask/keyring-api": "^8.0.1",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.54",
Expand All @@ -85,7 +86,7 @@
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
"typescript": "~5.0.4"
},
"peerDependencies": {
"@metamask/accounts-controller": "^17.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { ControllerMessenger } from '@metamask/base-controller';
import type {
ExtractAvailableAction,
ExtractAvailableEvent,
} from '@metamask/base-controller/tests/helpers';
import { query, toChecksumHexAddress } from '@metamask/controller-utils';
import type { InternalAccount } from '@metamask/keyring-api';
import {
type NetworkClientId,
type NetworkClientConfiguration,
defaultState as defaultnetworkControllerState,
} from '@metamask/network-controller';
import {
buildCustomNetworkClientConfiguration,
buildMockGetNetworkClientById,
} from '@metamask/network-controller/tests/helpers';
import { getDefaultPreferencesState } from '@metamask/preferences-controller';
import * as sinon from 'sinon';

import { advanceTime } from '../../../tests/helpers';
import { createMockInternalAccount } from '../../accounts-controller/src/tests/mocks';
import type {
ExtractAvailableAction,
ExtractAvailableEvent,
} from '../../base-controller/tests/helpers';
import {
buildCustomNetworkClientConfiguration,
buildMockGetNetworkClientById,
} from '../../network-controller/tests/helpers';
import type {
AccountTrackerControllerMessenger,
AllowedActions,
Expand Down
15 changes: 7 additions & 8 deletions packages/assets-controllers/src/NftController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ const SECOND_OWNER_ADDRESS = '0x500017171kasdfbou081';
const DEPRESSIONIST_CID_V1 =
'bafybeidf7aw7bmnmewwj4ayq3she2jfk5jrdpp24aaucf6fddzb3cfhrvm';

const DEPRESSIONIST_CLOUDFLARE_IPFS_SUBDOMAIN_PATH = getFormattedIpfsUrl(
IPFS_DEFAULT_GATEWAY_URL,
`ipfs://${DEPRESSIONIST_CID_V1}`,
true,
);

const SEPOLIA = {
chainId: toHex(11155111),
type: NetworkType.sepolia,
Expand Down Expand Up @@ -296,7 +290,7 @@ function setupController({
}

describe('NftController', () => {
beforeEach(() => {
beforeEach(async () => {
nock(NFT_API_BASE_URL)
.get(
`/tokens?chainIds=1&tokens=0x01%3A1&includeTopBid=true&includeAttributes=true&includeLastSale=true`,
Expand All @@ -319,7 +313,12 @@ describe('NftController', () => {
},
],
});

const DEPRESSIONIST_CLOUDFLARE_IPFS_SUBDOMAIN_PATH =
await getFormattedIpfsUrl(
IPFS_DEFAULT_GATEWAY_URL,
`ipfs://${DEPRESSIONIST_CID_V1}`,
true,
);
nock(DEPRESSIONIST_CLOUDFLARE_IPFS_SUBDOMAIN_PATH).get('/').reply(200, {
name: 'name',
image: 'image',
Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controllers/src/NftController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ export class NftController extends BaseController<
}

if (hasIpfsTokenURI) {
tokenURI = getFormattedIpfsUrl(
tokenURI = await getFormattedIpfsUrl(
this.#ipfsGateway,
tokenURI,
this.#useIpfsSubdomains,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import {
} from '@metamask/controller-utils';
import type { InternalAccount } from '@metamask/keyring-api';
import type { KeyringControllerState } from '@metamask/keyring-controller';
import { defaultState as defaultNetworkState } from '@metamask/network-controller';
import type {
NetworkState,
NetworkConfiguration,
NetworkController,
NetworkClientId,
AutoManagedNetworkClient,
CustomNetworkClientConfiguration,
} from '@metamask/network-controller';
import { defaultState as defaultNetworkState } from '@metamask/network-controller';
import type { AutoManagedNetworkClient } from '@metamask/network-controller/src/create-auto-managed-network-client';
import type { CustomNetworkClientConfiguration } from '@metamask/network-controller/src/types';
import {
getDefaultPreferencesState,
type PreferencesState,
Expand Down
Loading
Loading