diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 533f31809..1c454164f 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -2109,7 +2109,7 @@ "message": "Το “$1” προστέθηκε με επιτυχία!" }, "newNftAddedMessage": { - "message": "Το Collectible προστέθηκε με επιτυχία!" + "message": "Το Nft προστέθηκε με επιτυχία!" }, "newPassword": { "message": "Νέος Κωδικός Πρόσβασης (ελάχιστο 8 χαρακτήρες)" diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index dcb89dc42..33bea36d2 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -1570,7 +1570,7 @@ "message": "page Importer des NFT" }, "importNFTTokenIdToolTip": { - "message": "L’ID d’un collectible est un identifiant unique puisqu’il n’y a pas deux NFT identiques. Encore une fois, sur OpenSea, ce numéro se trouve dans la section « Détails ». Prenez-en note ou copiez-le dans votre presse-papiers." + "message": "L’ID d’un NFT est un identifiant unique puisqu’il n’y a pas deux NFT identiques. Encore une fois, sur OpenSea, ce numéro se trouve dans la section « Détails ». Prenez-en note ou copiez-le dans votre presse-papiers." }, "importNFTs": { "message": "Importer des NFT" @@ -2109,7 +2109,7 @@ "message": "« $1 » a été ajouté avec succès !" }, "newNftAddedMessage": { - "message": "Le collectible a été ajouté avec succès !" + "message": "Le NFT a été ajouté avec succès !" }, "newPassword": { "message": "Nouveau mot de passe (min 8 caractères)" @@ -4157,7 +4157,7 @@ "description": "Shown when the protocol is unknown by the extension. $1 is the protocol code." }, "unsendableAsset": { - "message": "L’envoi de jetons collectibles (ERC-721) n’est pas pris en charge actuellement", + "message": "L’envoi de jetons NFTs (ERC-721) n’est pas pris en charge actuellement", "description": "This is an error message we show the user if they attempt to send an NFT asset type, for which currently don't support sending" }, "unverifiedContractAddressMessage": { diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 022dc6f1d..898e6c27d 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -1570,7 +1570,7 @@ "message": "I-import ang pahina ng NFT" }, "importNFTTokenIdToolTip": { - "message": "Ang ID ng collectible ay isang natatanging pagkakakilanlan dahil walang dalawang NFT ang magkatulad. Muli, sa OpenSea ang numerong ito ay nasa ilalim ng 'Mga Detalye'. Itala ito, o kopyahin ito sa iyong clipboard." + "message": "Ang ID ng NFT ay isang natatanging pagkakakilanlan dahil walang dalawang NFT ang magkatulad. Muli, sa OpenSea ang numerong ito ay nasa ilalim ng 'Mga Detalye'. Itala ito, o kopyahin ito sa iyong clipboard." }, "importNFTs": { "message": "I-import ang mga NFT" @@ -2109,7 +2109,7 @@ "message": "Ang “$1” matagumpay na naidagdag!" }, "newNftAddedMessage": { - "message": "Ang collectible ay tagumpay na naidagdag!" + "message": "Ang NFT ay tagumpay na naidagdag!" }, "newPassword": { "message": "Bagong password (min na 8 char)" @@ -4157,7 +4157,7 @@ "description": "Shown when the protocol is unknown by the extension. $1 is the protocol code." }, "unsendableAsset": { - "message": "Ang pagpapadala ng collectible (ERC-721) token ay kasalukuyang hindi magagamit", + "message": "Ang pagpapadala ng NFT (ERC-721) token ay kasalukuyang hindi magagamit", "description": "This is an error message we show the user if they attempt to send an NFT asset type, for which currently don't support sending" }, "unverifiedContractAddressMessage": { diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index f1bc0be8a..86438bf02 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -984,7 +984,7 @@ "description": "The next nonce according to MetaMask's internal logic" }, "nftTokenIdPlaceholder": { - "message": "Enter the collectible ID" + "message": "Enter the NFT ID" }, "noAccountsFound": { "message": "指定的搜尋條件找不到帳戶" diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index a6c3b62f1..04034200a 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -38,14 +38,14 @@ export default class AppStateController extends EventEmitter { recoveryPhraseReminderHasBeenShown: false, recoveryPhraseReminderLastShown: new Date().getTime(), outdatedBrowserWarningLastShown: new Date().getTime(), - collectiblesDetectionNoticeDismissed: false, + nftsDetectionNoticeDismissed: false, showTestnetMessageInDropdown: true, showPortfolioTooltip: true, showBetaHeader: isBeta(), trezorModel: null, ...initState, qrHardware: {}, - collectiblesDropdownState: {}, + nftsDropdownState: {}, usedNetworks: { '0x1': true, '0x5': true, @@ -330,13 +330,13 @@ export default class AppStateController extends EventEmitter { } /** - * A setter for the `collectiblesDropdownState` property + * A setter for the `nftsDropdownState` property * - * @param collectiblesDropdownState + * @param nftsDropdownState */ - updateCollectibleDropDownState(collectiblesDropdownState) { + updateNftDropDownState(nftsDropdownState) { this.store.updateState({ - collectiblesDropdownState, + nftsDropdownState, }); } diff --git a/app/scripts/controllers/backup.test.js b/app/scripts/controllers/backup.test.js index b4e740bcf..37c91f87e 100644 --- a/app/scripts/controllers/backup.test.js +++ b/app/scripts/controllers/backup.test.js @@ -31,7 +31,7 @@ function getMockController() { return mcState; } -const jsonData = `{"preferences":{"frequentRpcListDetail":[{"chainId":"0x539","nickname":"Localhost 8545","rpcPrefs":{},"rpcUrl":"http://localhost:8545","ticker":"ETH"},{"chainId":"0x38","nickname":"Binance Smart Chain Mainnet","rpcPrefs":{"blockExplorerUrl":"https://bscscan.com"},"rpcUrl":"https://bsc-dataseed1.binance.org","ticker":"BNB"},{"chainId":"0x61","nickname":"Binance Smart Chain Testnet","rpcPrefs":{"blockExplorerUrl":"https://testnet.bscscan.com"},"rpcUrl":"https://data-seed-prebsc-1-s1.binance.org:8545","ticker":"tBNB"},{"chainId":"0x89","nickname":"Polygon Mainnet","rpcPrefs":{"blockExplorerUrl":"https://polygonscan.com"},"rpcUrl":"https://polygon-rpc.com","ticker":"MATIC"}],"useBlockie":false,"useNonceField":false,"usePhishDetect":true,"dismissSeedBackUpReminder":false,"useTokenDetection":false,"useCollectibleDetection":false,"openSeaEnabled":false,"advancedGasFee":null,"featureFlags":{"sendHexData":true,"showIncomingTransactions":true},"knownMethodData":{},"currentLocale":"en","forgottenPassword":false,"preferences":{"hideZeroBalanceTokens":false,"showFiatInTestnets":false,"showTestNetworks":true,"useNativeCurrencyAsPrimaryCurrency":true},"ipfsGateway":"dweb.link","infuraBlocked":false,"ledgerTransportType":"webhid","theme":"light","customNetworkListEnabled":false,"textDirection":"auto"},"addressBook":{"addressBook":{"0x61":{"0x42EB768f2244C8811C63729A21A3569731535f06":{"address":"0x42EB768f2244C8811C63729A21A3569731535f06","chainId":"0x61","isEns":false,"memo":"","name":""}}}}}`; +const jsonData = `{"preferences":{"frequentRpcListDetail":[{"chainId":"0x539","nickname":"Localhost 8545","rpcPrefs":{},"rpcUrl":"http://localhost:8545","ticker":"ETH"},{"chainId":"0x38","nickname":"Binance Smart Chain Mainnet","rpcPrefs":{"blockExplorerUrl":"https://bscscan.com"},"rpcUrl":"https://bsc-dataseed1.binance.org","ticker":"BNB"},{"chainId":"0x61","nickname":"Binance Smart Chain Testnet","rpcPrefs":{"blockExplorerUrl":"https://testnet.bscscan.com"},"rpcUrl":"https://data-seed-prebsc-1-s1.binance.org:8545","ticker":"tBNB"},{"chainId":"0x89","nickname":"Polygon Mainnet","rpcPrefs":{"blockExplorerUrl":"https://polygonscan.com"},"rpcUrl":"https://polygon-rpc.com","ticker":"MATIC"}],"useBlockie":false,"useNonceField":false,"usePhishDetect":true,"dismissSeedBackUpReminder":false,"useTokenDetection":false,"useNftDetection":false,"openSeaEnabled":false,"advancedGasFee":null,"featureFlags":{"sendHexData":true,"showIncomingTransactions":true},"knownMethodData":{},"currentLocale":"en","forgottenPassword":false,"preferences":{"hideZeroBalanceTokens":false,"showFiatInTestnets":false,"showTestNetworks":true,"useNativeCurrencyAsPrimaryCurrency":true},"ipfsGateway":"dweb.link","infuraBlocked":false,"ledgerTransportType":"webhid","theme":"light","customNetworkListEnabled":false,"textDirection":"auto"},"addressBook":{"addressBook":{"0x61":{"0x42EB768f2244C8811C63729A21A3569731535f06":{"address":"0x42EB768f2244C8811C63729A21A3569731535f06","chainId":"0x61","isEns":false,"memo":"","name":""}}}}}`; describe('BackupController', function () { const getBackupController = () => { diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 3edffbec1..ad237ffbe 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -758,7 +758,7 @@ export default class MetaMetricsController { } /** - * Returns an array of all of the collectibles/NFTs the user + * Returns an array of all of the NFTs the user * possesses across all networks and accounts. * * @param {object} allNfts @@ -771,7 +771,7 @@ export default class MetaMetricsController { }); /** - * Returns the number of unique collectible/NFT addresses the user + * Returns the number of unique NFT addresses the user * possesses across all networks and accounts. * * @param {object} allNfts diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 456f01263..ab51bb0c5 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -151,7 +151,7 @@ export default class PreferencesController { /** * Setter for the `useNftDetection` property * - * @param {boolean} useNftDetection - Whether or not the user prefers to autodetect collectibles. + * @param {boolean} useNftDetection - Whether or not the user prefers to autodetect NFTs. */ setUseNftDetection(useNftDetection) { this.store.updateState({ useNftDetection }); @@ -169,7 +169,7 @@ export default class PreferencesController { /** * Setter for the `openSeaEnabled` property * - * @param {boolean} openSeaEnabled - Whether or not the user prefers to use the OpenSea API for collectibles data. + * @param {boolean} openSeaEnabled - Whether or not the user prefers to use the OpenSea API for NFTs data. */ setOpenSeaEnabled(openSeaEnabled) { this.store.updateState({ diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 570b7d60d..f5ec93dff 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -960,8 +960,8 @@ export default class MetamaskController extends EventEmitter { const { txReceipt } = txMeta; - // if this is a transferFrom method generated from within the app it may be a collectible transfer transaction - // in which case we will want to check and update ownership status of the transferred collectible. + // if this is a transferFrom method generated from within the app it may be an NFT transfer transaction + // in which case we will want to check and update ownership status of the transferred NFT. if ( txMeta.type === TransactionType.tokenMethodTransferFrom && txMeta.txParams !== undefined @@ -982,19 +982,17 @@ export default class MetamaskController extends EventEmitter { const { allNfts } = this.nftController.state; const chainIdAsDecimal = hexToDecimal(chainId); - // check if its a known collectible - const knownCollectible = allNfts?.[userAddress]?.[ - chainIdAsDecimal - ]?.find( + // check if its a known NFT + const knownNft = allNfts?.[userAddress]?.[chainIdAsDecimal]?.find( ({ address, tokenId }) => isEqualCaseInsensitive(address, contractAddress) && tokenId === transactionDataTokenId, ); // if it is we check and update ownership status. - if (knownCollectible) { + if (knownNft) { this.nftController.checkAndUpdateSingleNftOwnershipStatus( - knownCollectible, + knownNft, false, { userAddress, chainId: chainIdAsDecimal }, ); @@ -1904,10 +1902,8 @@ export default class MetamaskController extends EventEmitter { appStateController.setShowPortfolioTooltip.bind(appStateController), setShowBetaHeader: appStateController.setShowBetaHeader.bind(appStateController), - updateCollectibleDropDownState: - appStateController.updateCollectibleDropDownState.bind( - appStateController, - ), + updateNftDropDownState: + appStateController.updateNftDropDownState.bind(appStateController), setFirstTimeUsedNetwork: appStateController.setFirstTimeUsedNetwork.bind(appStateController), // EnsController @@ -2144,7 +2140,7 @@ export default class MetamaskController extends EventEmitter { detectTokensController, ), - // DetectCollectibleController + // DetectNftController detectNfts: process.env.NFTS_V1 ? nftDetectionController.detectNfts.bind(nftDetectionController) : null, diff --git a/app/scripts/migrations/078.js b/app/scripts/migrations/078.js new file mode 100644 index 000000000..b6f451701 --- /dev/null +++ b/app/scripts/migrations/078.js @@ -0,0 +1,31 @@ +import { cloneDeep } from 'lodash'; + +const version = 78; + +/** + * Remove collectiblesDropdownState and collectiblesDetectionNoticeDismissed:. + */ +export default { + version, + async migrate(originalVersionedData) { + const versionedData = cloneDeep(originalVersionedData); + versionedData.meta.version = version; + const state = versionedData.data; + const newState = transformState(state); + versionedData.data = newState; + return versionedData; + }, +}; + +function transformState(state) { + if ( + state?.AppStateController?.collectiblesDetectionNoticeDismissed !== + undefined + ) { + delete state.AppStateController.collectiblesDetectionNoticeDismissed; + } + if (state?.metamask?.collectiblesDropdownState !== undefined) { + delete state.metamask.collectiblesDropdownState; + } + return state; +} diff --git a/app/scripts/migrations/078.test.js b/app/scripts/migrations/078.test.js new file mode 100644 index 000000000..4ae405f5a --- /dev/null +++ b/app/scripts/migrations/078.test.js @@ -0,0 +1,173 @@ +import migration78 from './078'; + +describe('migration #78', () => { + it('should update the version metadata', async () => { + const oldStorage = { + meta: { + version: 77, + }, + }; + + const newStorage = await migration78.migrate(oldStorage); + expect(newStorage.meta).toStrictEqual({ + version: 78, + }); + }); + + it('should remove the "collectiblesDetectionNoticeDismissed"', async () => { + const oldStorage = { + meta: { + version: 77, + }, + data: { + AppStateController: { + collectiblesDetectionNoticeDismissed: false, + bar: 'baz', + }, + }, + }; + + const newStorage = await migration78.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 78, + }, + data: { + AppStateController: { + bar: 'baz', + }, + }, + }); + }); + + it('should remove the "collectiblesDropdownState"', async () => { + const oldStorage = { + meta: { + version: 77, + }, + data: { + metamask: { + isInitialized: true, + isUnlocked: true, + isAccountMenuOpen: false, + identities: { + '0x00000': { + address: '0x00000', + lastSelected: 1675966229118, + name: 'Account 1', + }, + '0x00001': { + address: '0x00001', + name: 'Account 2', + }, + }, + collectiblesDropdownState: {}, + qrHardware: {}, + }, + }, + }; + + const newStorage = await migration78.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 78, + }, + data: { + metamask: { + isInitialized: true, + isUnlocked: true, + isAccountMenuOpen: false, + identities: { + '0x00000': { + address: '0x00000', + lastSelected: 1675966229118, + name: 'Account 1', + }, + '0x00001': { + address: '0x00001', + name: 'Account 2', + }, + }, + qrHardware: {}, + }, + }, + }); + }); + + it('should make no changes if "collectiblesDetectionNoticeDismissed" never existed', async () => { + const oldStorage = { + meta: { + version: 77, + }, + data: { + AppStateController: { + bar: 'baz', + }, + }, + }; + + const newStorage = await migration78.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 78, + }, + data: { + AppStateController: { + bar: 'baz', + }, + }, + }); + }); + it('should make no changes if "collectiblesDropdownState" never existed', async () => { + const oldStorage = { + meta: { + version: 77, + }, + data: { + metamask: { + isInitialized: true, + isUnlocked: true, + isAccountMenuOpen: false, + identities: { + '0x00000': { + address: '0x00000', + lastSelected: 1675966229118, + name: 'Account 1', + }, + '0x00001': { + address: '0x00001', + name: 'Account 2', + }, + }, + qrHardware: {}, + }, + }, + }; + + const newStorage = await migration78.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 78, + }, + data: { + metamask: { + isInitialized: true, + isUnlocked: true, + isAccountMenuOpen: false, + identities: { + '0x00000': { + address: '0x00000', + lastSelected: 1675966229118, + name: 'Account 1', + }, + '0x00001': { + address: '0x00001', + name: 'Account 2', + }, + }, + qrHardware: {}, + }, + }, + }); + }); +}); diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index d39595847..d4928f75e 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -81,6 +81,7 @@ import m074 from './074'; import m075 from './075'; import m076 from './076'; import m077 from './077'; +import m078 from './078'; const migrations = [ m002, @@ -159,6 +160,7 @@ const migrations = [ m075, m076, m077, + m078, ]; export default migrations; diff --git a/development/ts-migration-dashboard/files-to-convert.json b/development/ts-migration-dashboard/files-to-convert.json index babed9348..76555e54f 100644 --- a/development/ts-migration-dashboard/files-to-convert.json +++ b/development/ts-migration-dashboard/files-to-convert.json @@ -1149,7 +1149,7 @@ "ui/hooks/useApproveTransaction.js", "ui/hooks/useAssetDetails.js", "ui/hooks/useAssetDetails.test.js", - "ui/hooks/useCollectiblesCollections.js", + "ui/hooks/useNftsCollections.js", "ui/hooks/useCopyToClipboard.js", "ui/hooks/useCurrencyDisplay.js", "ui/hooks/useCurrencyDisplay.test.js", diff --git a/test/data/mock-state.json b/test/data/mock-state.json index e2eb7d9fd..183ba6ba2 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -261,7 +261,7 @@ "maxBaseFee": "75", "priorityFee": "2" }, - "collectiblesDropdownState": { + "nftsDropdownState": { "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": { "0x5": { "0x495f947276749Ce646f68AC8c248420045cb7b5e": false diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 7f546a12f..76b8a854a 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -115,7 +115,7 @@ function defaultFixture() { }, AppStateController: { browserEnvironment: {}, - collectiblesDropdownState: {}, + nftsDropdownState: {}, connectedStatusPopoverHasBeenShown: true, defaultHomeActiveTabName: null, fullScreenGasPollTokens: [], @@ -281,7 +281,7 @@ function onboardingFixture() { data: { AppStateController: { browserEnvironment: {}, - collectiblesDropdownState: {}, + nftsDropdownState: {}, connectedStatusPopoverHasBeenShown: true, defaultHomeActiveTabName: null, fullScreenGasPollTokens: [], @@ -411,7 +411,7 @@ class FixtureBuilder { return this; } - withCollectiblesController(data) { + withNftsController(data) { merge( this.fixture.data.NftController ? this.fixture.data.NftController diff --git a/test/e2e/nft/import-nft.spec.js b/test/e2e/nft/import-nft.spec.js index 7bafe1d1b..b0985e7dd 100644 --- a/test/e2e/nft/import-nft.spec.js +++ b/test/e2e/nft/import-nft.spec.js @@ -4,7 +4,7 @@ const { SMART_CONTRACTS } = require('../seeder/smart-contracts'); const FixtureBuilder = require('../fixture-builder'); describe('Import NFT', function () { - const smartContract = SMART_CONTRACTS.COLLECTIBLES; + const smartContract = SMART_CONTRACTS.NFTS; const ganacheOptions = { accounts: [ { @@ -54,7 +54,7 @@ describe('Import NFT', function () { text: 'TestDappCollectibles', }); const importedNftImage = await driver.findElement( - '.collectibles-items__item-image', + '.nfts-items__item-image', ); assert.equal(await importedNft.isDisplayed(), true); assert.equal(await importedNftImage.isDisplayed(), true); diff --git a/test/e2e/nft/send-nft.spec.js b/test/e2e/nft/send-nft.spec.js index 66e562675..4b2b0ff66 100644 --- a/test/e2e/nft/send-nft.spec.js +++ b/test/e2e/nft/send-nft.spec.js @@ -4,7 +4,7 @@ const { SMART_CONTRACTS } = require('../seeder/smart-contracts'); const FixtureBuilder = require('../fixture-builder'); describe('Send NFT', function () { - const smartContract = SMART_CONTRACTS.COLLECTIBLES; + const smartContract = SMART_CONTRACTS.NFTS; const ganacheOptions = { accounts: [ { @@ -40,7 +40,7 @@ describe('Send NFT', function () { await driver.clickElement({ text: 'Add', tag: 'button' }); // Fill the send NFT form and confirm the transaction - await driver.clickElement('.collectibles-items__item-image'); + await driver.clickElement('.nfts-items__item-image'); await driver.clickElement({ text: 'Send', tag: 'button' }); await driver.fill( 'input[placeholder="Search, public address (0x), or ENS"]', @@ -49,7 +49,7 @@ describe('Send NFT', function () { await driver.clickElement({ text: 'Next', tag: 'button' }); await driver.clickElement({ text: 'Confirm', tag: 'button' }); - // When transaction complete, check the send nft item is displayed in activity tab + // When transaction complete, check the send NFT is displayed in activity tab await driver.wait(async () => { const confirmedTxes = await driver.findElements( '.transaction-list__completed-transactions .transaction-list-item', diff --git a/test/e2e/seeder/ganache-seeder.js b/test/e2e/seeder/ganache-seeder.js index 8f963640f..62cc1534d 100644 --- a/test/e2e/seeder/ganache-seeder.js +++ b/test/e2e/seeder/ganache-seeder.js @@ -44,7 +44,7 @@ class GanacheSeeder { await contract.deployTransaction.wait(); - if (contractName === SMART_CONTRACTS.COLLECTIBLES) { + if (contractName === SMART_CONTRACTS.NFTS) { const transaction = await contract.mintCollectibles(1, { from: fromAddress, }); diff --git a/test/e2e/seeder/smart-contracts.js b/test/e2e/seeder/smart-contracts.js index 70c60b1c1..247c00350 100644 --- a/test/e2e/seeder/smart-contracts.js +++ b/test/e2e/seeder/smart-contracts.js @@ -20,7 +20,7 @@ const hstFactory = { abi: hstAbi, }; -const collectiblesFactory = { +const nftsFactory = { bytecode: collectiblesBytecode, abi: collectiblesAbi, }; @@ -42,7 +42,7 @@ const multisigFactory = { const SMART_CONTRACTS = { HST: 'hst', - COLLECTIBLES: 'collectibles', + NFTS: 'nfts', PIGGYBANK: 'piggybank', FAILING: 'failing', MULTISIG: 'multisig', @@ -50,7 +50,7 @@ const SMART_CONTRACTS = { const contractConfiguration = { [SMART_CONTRACTS.HST]: hstFactory, - [SMART_CONTRACTS.COLLECTIBLES]: collectiblesFactory, + [SMART_CONTRACTS.NFTS]: nftsFactory, [SMART_CONTRACTS.PIGGYBANK]: piggybankFactory, [SMART_CONTRACTS.FAILING]: failingContract, [SMART_CONTRACTS.MULTISIG]: multisigFactory, diff --git a/test/e2e/tests/nfts.spec.js b/test/e2e/tests/nfts.spec.js index 71fbfa19a..16623644d 100644 --- a/test/e2e/tests/nfts.spec.js +++ b/test/e2e/tests/nfts.spec.js @@ -3,8 +3,8 @@ const { convertToHexValue, withFixtures } = require('../helpers'); const { SMART_CONTRACTS } = require('../seeder/smart-contracts'); const FixtureBuilder = require('../fixture-builder'); -describe('Collectibles', function () { - const smartContract = SMART_CONTRACTS.COLLECTIBLES; +describe('NFTs', function () { + const smartContract = SMART_CONTRACTS.NFTS; const ganacheOptions = { accounts: [ { diff --git a/ui/components/app/modals/contract-details-modal/contract-details-modal.js b/ui/components/app/modals/contract-details-modal/contract-details-modal.js index 71fd19e16..94c110e66 100644 --- a/ui/components/app/modals/contract-details-modal/contract-details-modal.js +++ b/ui/components/app/modals/contract-details-modal/contract-details-modal.js @@ -350,7 +350,7 @@ ContractDetailsModal.propTypes = { */ siteImage: PropTypes.string, /** - * The token id of the collectible + * The token id of the NFT */ tokenId: PropTypes.string, /** diff --git a/ui/components/app/modals/convert-token-to-nft-modal/convert-token-to-nft-modal.js b/ui/components/app/modals/convert-token-to-nft-modal/convert-token-to-nft-modal.js index f9eea46d2..c818c80f1 100644 --- a/ui/components/app/modals/convert-token-to-nft-modal/convert-token-to-nft-modal.js +++ b/ui/components/app/modals/convert-token-to-nft-modal/convert-token-to-nft-modal.js @@ -8,10 +8,10 @@ import { TypographyVariant } from '../../../../helpers/constants/design-system'; import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import { - ADD_COLLECTIBLE_ROUTE, + ADD_NFT_ROUTE, ASSET_ROUTE, } from '../../../../helpers/constants/routes'; -import { getCollectibles } from '../../../../ducks/metamask/metamask'; +import { getNfts } from '../../../../ducks/metamask/metamask'; import { ignoreTokens } from '../../../../store/actions'; import { isEqualCaseInsensitive } from '../../../../../shared/modules/string-utils'; @@ -19,7 +19,7 @@ const ConvertTokenToNFTModal = ({ hideModal, tokenAddress }) => { const history = useHistory(); const t = useI18nContext(); const dispatch = useDispatch(); - const allNfts = useSelector(getCollectibles); + const allNfts = useSelector(getNfts); const tokenAddedAsNFT = allNfts.find(({ address }) => isEqualCaseInsensitive(address, tokenAddress), ); @@ -40,7 +40,7 @@ const ConvertTokenToNFTModal = ({ hideModal, tokenAddress }) => { }); } else { history.push({ - pathname: ADD_COLLECTIBLE_ROUTE, + pathname: ADD_NFT_ROUTE, state: { tokenAddress }, }); } diff --git a/ui/components/app/nft-default-image/__snapshots__/nft-default-image.test.js.snap b/ui/components/app/nft-default-image/__snapshots__/nft-default-image.test.js.snap index e126c04b7..22120e4a4 100644 --- a/ui/components/app/nft-default-image/__snapshots__/nft-default-image.test.js.snap +++ b/ui/components/app/nft-default-image/__snapshots__/nft-default-image.test.js.snap @@ -1,16 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Collectible Default Image should match snapshot with all provided props 1`] = ` +exports[`NFT Default Image should match snapshot with all provided props 1`] = `