From 0eded43d4a99273c43cb2be1c43211227b12992c Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 20 Sep 2022 14:46:25 +0200 Subject: [PATCH 01/17] [FLASK] Fix an issue with installing and updating snaps with 0 permissions (#15796) * Fix an issue with installing snaps with 0 permissions * Fix some issues * Fix lint * Fix code fencing * UI improvements for no permission use-case * Fix redirect * Delay BIP44 test slightly * Add more delay * Fix update UI --- app/_locales/en/messages.json | 3 + .../@metamask+snap-controllers+0.20.0.patch | 62 +++++++++++++++++++ test/e2e/snaps/test-snap-bip-44.spec.js | 1 + test/e2e/snaps/test-snap-confirm.spec.js | 1 + test/e2e/snaps/test-snap-error.spec.js | 1 + test/e2e/snaps/test-snap-managestate.spec.js | 1 + test/e2e/snaps/test-snap-notification.spec.js | 1 + ui/pages/home/home.container.js | 4 +- .../flask/snap-install/snap-install.js | 35 ++++++----- .../flask/snap-update/snap-update.js | 43 ++++++++----- .../permissions-connect.component.js | 35 ++++++++--- .../permissions-connect.container.js | 14 ++++- ui/selectors/permissions.js | 11 ++-- 13 files changed, 165 insertions(+), 47 deletions(-) create mode 100644 patches/@metamask+snap-controllers+0.20.0.patch diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index f69cebb57f1c..e8852f869cab 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1695,6 +1695,9 @@ "initialTransactionConfirmed": { "message": "Your initial transaction was confirmed by the network. Click OK to go back." }, + "install": { + "message": "Install" + }, "insufficientBalance": { "message": "Insufficient balance." }, diff --git a/patches/@metamask+snap-controllers+0.20.0.patch b/patches/@metamask+snap-controllers+0.20.0.patch new file mode 100644 index 000000000000..6e1df558ce0c --- /dev/null +++ b/patches/@metamask+snap-controllers+0.20.0.patch @@ -0,0 +1,62 @@ +diff --git a/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js b/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js +index ad84417..158e8e6 100644 +--- a/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js ++++ b/node_modules/@metamask/snap-controllers/dist/snaps/SnapController.js +@@ -30,6 +30,7 @@ const RequestQueue_1 = require("./RequestQueue"); + const utils_3 = require("./utils"); + const Timer_1 = require("./Timer"); + exports.controllerName = 'SnapController'; ++exports.SNAP_APPROVAL_INSTALL = 'wallet_installSnap'; + exports.SNAP_APPROVAL_UPDATE = 'wallet_updateSnap'; + const TRUNCATED_SNAP_PROPERTIES = new Set([ + 'initialPermissions', +@@ -738,7 +739,7 @@ class SnapController extends controllers_1.BaseControllerV2 { + id: snapId, + versionRange, + }); +- await this.authorize(snapId); ++ await this.authorize(origin, snapId); + await this._startSnap({ + snapId, + sourceCode, +@@ -1073,18 +1074,34 @@ class SnapController extends controllers_1.BaseControllerV2 { + * @param snapId - The id of the Snap. + * @returns The snap's approvedPermissions. + */ +- async authorize(snapId) { ++ async authorize(origin, snapId) { + console.info(`Authorizing snap: ${snapId}`); + const snapsState = this.state.snaps; + const snap = snapsState[snapId]; + const { initialPermissions } = snap; + try { +- if ((0, utils_1.isNonEmptyArray)(Object.keys(initialPermissions))) { +- const processedPermissions = this.processSnapPermissions(initialPermissions); +- const [approvedPermissions] = await this.messagingSystem.call('PermissionController:requestPermissions', { origin: snapId }, processedPermissions); +- return Object.values(approvedPermissions).map((perm) => perm.parentCapability); ++ const processedPermissions = this.processSnapPermissions(initialPermissions); ++ const id = (0, nanoid_1.nanoid)(); ++ const isApproved = await this.messagingSystem.call('ApprovalController:addRequest', { ++ origin, ++ id, ++ type: exports.SNAP_APPROVAL_INSTALL, ++ requestData: { ++ // Mirror previous installation metadata ++ metadata: { id, origin: snapId, dappOrigin: origin }, ++ permissions: processedPermissions, ++ snapId, ++ }, ++ }, true); ++ if (!isApproved) { ++ throw eth_rpc_errors_1.ethErrors.provider.userRejectedRequest(); ++ } ++ if ((0, utils_1.isNonEmptyArray)(Object.keys(processedPermissions))) { ++ await this.messagingSystem.call('PermissionController:grantPermissions', { ++ approvedPermissions: processedPermissions, ++ subject: { origin: snapId }, ++ }); + } +- return []; + } + finally { + const runtime = this.getRuntimeExpect(snapId); diff --git a/test/e2e/snaps/test-snap-bip-44.spec.js b/test/e2e/snaps/test-snap-bip-44.spec.js index 5795fa777710..1db055b3a979 100644 --- a/test/e2e/snaps/test-snap-bip-44.spec.js +++ b/test/e2e/snaps/test-snap-bip-44.spec.js @@ -79,6 +79,7 @@ describe('Test Snap bip-44', function () { await driver.waitUntilXWindowHandles(1, 5000, 10000); windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.delay(1000); await driver.clickElement('#sendBip44'); // check the results of the public key test diff --git a/test/e2e/snaps/test-snap-confirm.spec.js b/test/e2e/snaps/test-snap-confirm.spec.js index f4dcfa99d8e3..c6a35657a403 100644 --- a/test/e2e/snaps/test-snap-confirm.spec.js +++ b/test/e2e/snaps/test-snap-confirm.spec.js @@ -64,6 +64,7 @@ describe('Test Snap Confirm', function () { await driver.waitUntilXWindowHandles(1, 5000, 10000); windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.delay(1000); await driver.clickElement('#sendConfirmButton'); // hit 'approve' on the custom confirm diff --git a/test/e2e/snaps/test-snap-error.spec.js b/test/e2e/snaps/test-snap-error.spec.js index bb4fc251a8ec..177184727617 100644 --- a/test/e2e/snaps/test-snap-error.spec.js +++ b/test/e2e/snaps/test-snap-error.spec.js @@ -64,6 +64,7 @@ describe('Test Snap Error', function () { await driver.waitUntilXWindowHandles(1, 5000, 10000); windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.delay(1000); await driver.clickElement('#sendError'); await driver.navigate(PAGES.HOME); diff --git a/test/e2e/snaps/test-snap-managestate.spec.js b/test/e2e/snaps/test-snap-managestate.spec.js index 03e481e89999..06fddda59528 100644 --- a/test/e2e/snaps/test-snap-managestate.spec.js +++ b/test/e2e/snaps/test-snap-managestate.spec.js @@ -73,6 +73,7 @@ describe('Test Snap manageState', function () { windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); await driver.fill('#dataManageState', '23'); + await driver.delay(1000); await driver.clickElement('#sendManageState'); // check the results of the public key test diff --git a/test/e2e/snaps/test-snap-notification.spec.js b/test/e2e/snaps/test-snap-notification.spec.js index 0a303bc9cdeb..25f7cbe3435d 100644 --- a/test/e2e/snaps/test-snap-notification.spec.js +++ b/test/e2e/snaps/test-snap-notification.spec.js @@ -72,6 +72,7 @@ describe('Test Snap Notification', function () { await driver.waitUntilXWindowHandles(1, 5000, 10000); windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.delay(1000); await driver.clickElement('#sendInAppNotification'); // try to go to the MM pages diff --git a/ui/pages/home/home.container.js b/ui/pages/home/home.container.js index cfca56bad4ef..1417ec97ac15 100644 --- a/ui/pages/home/home.container.js +++ b/ui/pages/home/home.container.js @@ -5,7 +5,7 @@ import { activeTabHasPermissions, getFirstPermissionRequest, ///: BEGIN:ONLY_INCLUDE_IN(flask) - getFirstSnapUpdateRequest, + getFirstSnapInstallOrUpdateRequest, ///: END:ONLY_INCLUDE_IN getIsMainnet, getOriginOfCurrentTab, @@ -98,7 +98,7 @@ const mapStateToProps = (state) => { ///: BEGIN:ONLY_INCLUDE_IN(flask) if (!firstPermissionsRequest) { - firstPermissionsRequest = getFirstSnapUpdateRequest(state); + firstPermissionsRequest = getFirstSnapInstallOrUpdateRequest(state); firstPermissionsRequestId = firstPermissionsRequest?.metadata.id || null; } ///: END:ONLY_INCLUDE_IN diff --git a/ui/pages/permissions-connect/flask/snap-install/snap-install.js b/ui/pages/permissions-connect/flask/snap-install/snap-install.js index 231e45a3909d..2a12340d8ade 100644 --- a/ui/pages/permissions-connect/flask/snap-install/snap-install.js +++ b/ui/pages/permissions-connect/flask/snap-install/snap-install.js @@ -35,10 +35,13 @@ export default function SnapInstall({ ); const onSubmit = useCallback( - () => approveSnapInstall(request), + () => approveSnapInstall(request.metadata.id), [request, approveSnapInstall], ); + const hasPermissions = + request?.permissions && Object.keys(request.permissions).length > 0; + const bip44LegacyEntropyPermissions = request.permissions && Object.keys(request.permissions).filter((v) => @@ -88,18 +91,22 @@ export default function SnapInstall({ snapVersion={targetSubjectMetadata.version} boxProps={{ alignItems: ALIGN_ITEMS.CENTER }} /> - - {t('snapRequestsPermission')} - - + {hasPermissions && ( + <> + + {t('snapRequestsPermission')} + + + + )} setIsShowingWarning(true) : onSubmit } - submitText={t('approveAndInstall')} + submitText={t(hasPermissions ? 'approveAndInstall' : 'install')} /> {isShowingWarning && ( diff --git a/ui/pages/permissions-connect/flask/snap-update/snap-update.js b/ui/pages/permissions-connect/flask/snap-update/snap-update.js index d3f7d52fb1ff..5127646d518c 100644 --- a/ui/pages/permissions-connect/flask/snap-update/snap-update.js +++ b/ui/pages/permissions-connect/flask/snap-update/snap-update.js @@ -33,7 +33,7 @@ export default function SnapUpdate({ ); const onSubmit = useCallback( - () => approveSnapUpdate(request), + () => approveSnapUpdate(request.metadata.id), [request, approveSnapUpdate], ); @@ -48,6 +48,15 @@ export default function SnapUpdate({ [request.permissions], ); + const approvedPermissions = request.approvedPermissions ?? {}; + const revokedPermissions = request.unusedPermissions ?? {}; + const newPermissions = request.newPermissions ?? {}; + const hasPermissions = + Object.keys(approvedPermissions).length + + Object.keys(revokedPermissions).length + + Object.keys(newPermissions).length > + 0; + return ( {t('snapUpdateExplanation', [`${request.metadata.dappOrigin}`])} - - {t('snapRequestsPermission')} - - + {hasPermissions && ( + <> + + {t('snapRequestsPermission')} + + + + )} ( { - approvePermissionsRequest(...args); + approveSnapInstall={(requestId) => { + approvePendingApproval(requestId, true); this.redirect(true); }} - rejectSnapInstall={(requestId) => - this.cancelPermissionsRequest(requestId) - } + rejectSnapInstall={(requestId) => { + rejectPendingApproval( + requestId, + serializeError(ethErrors.provider.userRejectedRequest()), + ); + this.redirect(false); + }} targetSubjectMetadata={targetSubjectMetadata} /> )} @@ -328,13 +339,17 @@ export default class PermissionConnect extends Component { render={() => ( { - approvePermissionsRequest(...args); + approveSnapUpdate={(requestId) => { + approvePendingApproval(requestId, true); this.redirect(true); }} - rejectSnapUpdate={(requestId) => - this.cancelPermissionsRequest(requestId) - } + rejectSnapUpdate={(requestId) => { + rejectPendingApproval( + requestId, + serializeError(ethErrors.provider.userRejectedRequest()), + ); + this.redirect(false); + }} targetSubjectMetadata={targetSubjectMetadata} /> )} diff --git a/ui/pages/permissions-connect/permissions-connect.container.js b/ui/pages/permissions-connect/permissions-connect.container.js index c30a440d9ef3..d99ed279c232 100644 --- a/ui/pages/permissions-connect/permissions-connect.container.js +++ b/ui/pages/permissions-connect/permissions-connect.container.js @@ -6,7 +6,7 @@ import { getPermissionsRequests, getSelectedAddress, ///: BEGIN:ONLY_INCLUDE_IN(flask) - getSnapUpdateRequests, + getSnapInstallOrUpdateRequests, ///: END:ONLY_INCLUDE_IN getTargetSubjectMetadata, } from '../../selectors'; @@ -19,6 +19,10 @@ import { showModal, getCurrentWindowTab, getRequestAccountTabIds, + ///: BEGIN:ONLY_INCLUDE_IN(flask) + resolvePendingApproval, + rejectPendingApproval, + ///: END:ONLY_INCLUDE_IN } from '../../store/actions'; import { CONNECT_ROUTE, @@ -42,7 +46,7 @@ const mapStateToProps = (state, ownProps) => { ///: BEGIN:ONLY_INCLUDE_IN(flask) permissionsRequests = [ ...permissionsRequests, - ...getSnapUpdateRequests(state), + ...getSnapInstallOrUpdateRequests(state), ]; ///: END:ONLY_INCLUDE_IN const currentAddress = getSelectedAddress(state); @@ -139,6 +143,12 @@ const mapDispatchToProps = (dispatch) => { dispatch(approvePermissionsRequest(request)), rejectPermissionsRequest: (requestId) => dispatch(rejectPermissionsRequest(requestId)), + ///: BEGIN:ONLY_INCLUDE_IN(flask) + approvePendingApproval: (id, value) => + dispatch(resolvePendingApproval(id, value)), + rejectPendingApproval: (id, error) => + dispatch(rejectPendingApproval(id, error)), + ///: END:ONLY_INCLUDE_IN showNewAccountModal: ({ onCreateNewAccount, newAccountNumber }) => { return dispatch( showModal({ diff --git a/ui/selectors/permissions.js b/ui/selectors/permissions.js index ea1fc5d6d880..272b18681ed4 100644 --- a/ui/selectors/permissions.js +++ b/ui/selectors/permissions.js @@ -281,14 +281,17 @@ export function getLastConnectedInfo(state) { } ///: BEGIN:ONLY_INCLUDE_IN(flask) -export function getSnapUpdateRequests(state) { +export function getSnapInstallOrUpdateRequests(state) { return Object.values(state.metamask.pendingApprovals) - .filter(({ type }) => type === 'wallet_updateSnap') + .filter( + ({ type }) => + type === 'wallet_installSnap' || type === 'wallet_updateSnap', + ) .map(({ requestData }) => requestData); } -export function getFirstSnapUpdateRequest(state) { - const requests = getSnapUpdateRequests(state); +export function getFirstSnapInstallOrUpdateRequest(state) { + const requests = getSnapInstallOrUpdateRequests(state); return requests && requests[0] ? requests[0] : null; } ///: END:ONLY_INCLUDE_IN From b16606156ffc7d21673d46e0eadf3a109bd4ab53 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 12 Sep 2022 18:36:40 +0200 Subject: [PATCH 02/17] [FLASK] Fix crash with certain permissions on the snap settings page (#15797) --- ui/pages/settings/flask/view-snap/view-snap.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/pages/settings/flask/view-snap/view-snap.js b/ui/pages/settings/flask/view-snap/view-snap.js index 0fa9964c16c4..cff1a34cdc4d 100644 --- a/ui/pages/settings/flask/view-snap/view-snap.js +++ b/ui/pages/settings/flask/view-snap/view-snap.js @@ -24,7 +24,11 @@ import { removeSnap, removePermissionsFor, } from '../../../../store/actions'; -import { getSnaps, getSubjectsWithPermission } from '../../../../selectors'; +import { + getSnaps, + getSubjectsWithPermission, + getPermissions, +} from '../../../../selectors'; import { formatDate } from '../../../../helpers/utils/util'; function ViewSnap() { @@ -50,6 +54,7 @@ function ViewSnap() { const connectedSubjects = useSelector((state) => getSubjectsWithPermission(state, snap?.permissionName), ); + const permissions = useSelector((state) => getPermissions(state, snap?.id)); const dispatch = useDispatch(); const onDisconnect = (connectedOrigin, snapPermissionName) => { dispatch( @@ -137,9 +142,7 @@ function ViewSnap() { {t('snapAccess', [snap.manifest.proposedName])} - +
From 82263222444978a18a1d23a92134eda813903845 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 13 Sep 2022 12:41:29 +0200 Subject: [PATCH 03/17] [FLASK] Fix crash when uninstalling snap (#15799) * Fix crash when uninstalling snap * Run lint --- ui/pages/settings/flask/view-snap/view-snap.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/pages/settings/flask/view-snap/view-snap.js b/ui/pages/settings/flask/view-snap/view-snap.js index cff1a34cdc4d..e5c9e51f9249 100644 --- a/ui/pages/settings/flask/view-snap/view-snap.js +++ b/ui/pages/settings/flask/view-snap/view-snap.js @@ -54,7 +54,9 @@ function ViewSnap() { const connectedSubjects = useSelector((state) => getSubjectsWithPermission(state, snap?.permissionName), ); - const permissions = useSelector((state) => getPermissions(state, snap?.id)); + const permissions = useSelector( + (state) => snap && getPermissions(state, snap.id), + ); const dispatch = useDispatch(); const onDisconnect = (connectedOrigin, snapPermissionName) => { dispatch( @@ -142,7 +144,9 @@ function ViewSnap() { {t('snapAccess', [snap.manifest.proposedName])} - +
From eed06dae1fff5d38857e219a596cab4266a1d406 Mon Sep 17 00:00:00 2001 From: seaona Date: Wed, 28 Sep 2022 11:16:20 +0200 Subject: [PATCH 04/17] RC cut with Snaps fixes --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65868d4cfe4a..d98a2ba9bdbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.19.0", + "version": "10.20.0", "private": true, "repository": { "type": "git", From 5a42dfd76db2435903c13e339a512ed8f1985084 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 28 Sep 2022 09:08:22 -0230 Subject: [PATCH 05/17] Simplfy _buildEventFragmentProperties so that necessary objects and data are defined when it is called during onBootCleanup (#16001) --- app/scripts/controllers/transactions/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 8e7a2d62f9d6..a95c4d6d8772 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -2070,7 +2070,6 @@ export default class TransactionController extends EventEmitter { async _buildEventFragmentProperties(txMeta, extraParams) { const { - id, type, time, status, @@ -2088,8 +2087,14 @@ export default class TransactionController extends EventEmitter { originalType, replacedById, metamaskNetworkId: network, + customTokenAmount, + dappProposedTokenAmount, + currentTokenBalance, + originalApprovalAmount, + finalApprovalAmount, + contractMethodName, } = txMeta; - const { transactions } = this.store.getState(); + const source = referrer === ORIGIN_METAMASK ? 'user' : 'dapp'; const { assetType, tokenStandard } = await determineTransactionAssetType( @@ -2181,11 +2186,6 @@ export default class TransactionController extends EventEmitter { APPROVE: 'Approve', }; - const customTokenAmount = transactions[id]?.customTokenAmount; - const dappProposedTokenAmount = transactions[id]?.dappProposedTokenAmount; - const currentTokenBalance = transactions[id]?.currentTokenBalance; - const originalApprovalAmount = transactions[id]?.originalApprovalAmount; - const finalApprovalAmount = transactions[id]?.finalApprovalAmount; let transactionApprovalAmountType; let transactionContractMethod; let transactionApprovalAmountVsProposedRatio; @@ -2199,7 +2199,7 @@ export default class TransactionController extends EventEmitter { transactionType = TRANSACTION_TYPES.DEPLOY_CONTRACT; } else if (contractInteractionTypes) { transactionType = TRANSACTION_TYPES.CONTRACT_INTERACTION; - transactionContractMethod = transactions[id]?.contractMethodName; + transactionContractMethod = contractMethodName; if ( transactionContractMethod === contractMethodNames.APPROVE && tokenStandard === TOKEN_STANDARDS.ERC20 From d7a812f42fddc39d4673a9fe18307e46ac3d2899 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 29 Sep 2022 10:39:35 -0600 Subject: [PATCH 06/17] Add remaining tests for createInfuraClient (#15717) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add tests for the `block-tracker-inspector` middleware — which makes sure that the block tracker never has a reference to the latest block which is less than a block number that shows up in an RPC method's response — and the Infura middleware — which takes care of sending the request to Infura, and will retry the request up to 5 times if Infura sends back a certain type of error. Note that the `retry-on-empty` middleware is not tested because it currently has a [bug][1] which is making it ineffective. [1]: https://github.com/MetaMask/eth-json-rpc-middleware/issues/139 --- .../network/createInfuraClient.test.js | 71 +- .../network/provider-api-tests/helpers.js | 114 ++- .../provider-api-tests/shared-tests.js | 865 +++++++++++++++++- jest.config.js | 2 +- lavamoat/browserify/beta/policy.json | 138 +-- lavamoat/browserify/flask/policy.json | 142 +-- lavamoat/browserify/main/policy.json | 138 +-- lavamoat/build-system/policy-override.json | 3 +- lavamoat/build-system/policy.json | 97 +- package.json | 2 +- patches/eth-query+2.1.2.patch | 5 +- test/helpers/setup-helper.js | 6 + test/jest/setup.js | 7 + ui/pages/swaps/swaps.util.test.js | 8 +- yarn.lock | 61 +- 15 files changed, 1274 insertions(+), 385 deletions(-) diff --git a/app/scripts/controllers/network/createInfuraClient.test.js b/app/scripts/controllers/network/createInfuraClient.test.js index 4e5fb32b6cb8..404489ece544 100644 --- a/app/scripts/controllers/network/createInfuraClient.test.js +++ b/app/scripts/controllers/network/createInfuraClient.test.js @@ -2,7 +2,10 @@ * @jest-environment node */ -import { withInfuraClient } from './provider-api-tests/helpers'; +import { + withMockedInfuraCommunications, + withInfuraClient, +} from './provider-api-tests/helpers'; import { testsForRpcMethodNotHandledByMiddleware, testsForRpcMethodAssumingNoBlockParam, @@ -141,9 +144,36 @@ describe('createInfuraClient', () => { }); describe('eth_getTransactionByHash', () => { - testsForRpcMethodsThatCheckForBlockHashInResponse( - 'eth_getTransactionByHash', - ); + const method = 'eth_getTransactionByHash'; + + testsForRpcMethodsThatCheckForBlockHashInResponse(method); + + it("refreshes the block tracker's current block if it is less than the block number that comes back in the response", async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest + // block number is retrieved through the block tracker first. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // This is our request. + comms.mockInfuraRpcCall({ + request, + response: { + result: { + blockNumber: '0x200', + }, + }, + }); + // The block-tracker-inspector middleware will request the latest + // block through the block tracker again. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x300' }); + + await withInfuraClient(async ({ makeRpcCall, blockTracker }) => { + await makeRpcCall(request); + expect(blockTracker.getCurrentBlock()).toStrictEqual('0x300'); + }); + }); + }); }); describe('eth_getTransactionCount', () => { @@ -153,9 +183,36 @@ describe('createInfuraClient', () => { }); describe('eth_getTransactionReceipt', () => { - testsForRpcMethodsThatCheckForBlockHashInResponse( - 'eth_getTransactionReceipt', - ); + const method = 'eth_getTransactionReceipt'; + + testsForRpcMethodsThatCheckForBlockHashInResponse(method); + + it("refreshes the block tracker's current block if it is less than the block number that comes back in the response", async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest + // block number is retrieved through the block tracker first. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // This is our request. + comms.mockInfuraRpcCall({ + request, + response: { + result: { + blockNumber: '0x200', + }, + }, + }); + // The block-tracker-inspector middleware will request the latest + // block through the block tracker again. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x300' }); + + await withInfuraClient(async ({ makeRpcCall, blockTracker }) => { + await makeRpcCall(request); + expect(blockTracker.getCurrentBlock()).toStrictEqual('0x300'); + }); + }); + }); }); describe('eth_getUncleByBlockHashAndIndex', () => { diff --git a/app/scripts/controllers/network/provider-api-tests/helpers.js b/app/scripts/controllers/network/provider-api-tests/helpers.js index 9b4c22460777..d49cdb7c2072 100644 --- a/app/scripts/controllers/network/provider-api-tests/helpers.js +++ b/app/scripts/controllers/network/provider-api-tests/helpers.js @@ -38,37 +38,37 @@ import createInfuraClient from '../createInfuraClient'; */ /** - * @typedef {{ nockScope: NockScope, blockNumber: string }} MockNextBlockTrackerRequestOptions + * @typedef {{ nockScope: NockScope, blockNumber: string }} MockBlockTrackerRequestOptions * - * The options to `mockNextBlockTrackerRequest`. + * The options to `mockNextBlockTrackerRequest` and `mockAllBlockTrackerRequests`. */ /** - * @typedef {{ nockScope: NockScope, request: object, response: object, delay?: number }} MockSuccessfulInfuraRpcCallOptions + * @typedef {{ nockScope: NockScope, request: object, response: object, delay?: number }} MockInfuraRpcCallOptions * - * The options to `mockSuccessfulInfuraRpcCall`. + * The options to `mockInfuraRpcCall`. */ /** - * @typedef {{mockNextBlockTrackerRequest: (options: Omit) => void, mockSuccessfulInfuraRpcCall: (options: Omit) => NockScope}} InfuraCommunications + * @typedef {{mockNextBlockTrackerRequest: (options: Omit) => void, mockAllBlockTrackerRequests: (options: Omit) => void, mockInfuraRpcCall: (options: Omit) => NockScope}} InfuraCommunications * * Provides methods to mock different kinds of requests to Infura. */ /** - * @typedef {{network: string}} MockingInfuraCommunicationsOptions + * @typedef {{network: string}} WithMockedInfuraCommunicationsOptions * * The options bag that `mockingInfuraCommunications` takes. */ /** - * @typedef {(comms: InfuraCommunications) => Promise} MockingInfuraCommunicationsCallback + * @typedef {(comms: InfuraCommunications) => Promise} WithMockedInfuraCommunicationsCallback * * The callback that `mockingInfuraCommunications` takes. */ /** - * @typedef {[MockingInfuraCommunicationsOptions, MockingInfuraCommunicationsCallback] | [MockingInfuraCommunicationsCallback]} MockingInfuraCommunicationsArgs + * @typedef {[WithMockedInfuraCommunicationsOptions, WithMockedInfuraCommunicationsCallback] | [WithMockedInfuraCommunicationsCallback]} WithMockedInfuraCommunicationsArgs * * The arguments to `mockingInfuraCommunications`. */ @@ -111,7 +111,7 @@ function buildScopeForMockingInfuraRequests({ network = 'mainnet' } = {}) { /** * Mocks the next request for the latest block that the block tracker will make. * - * @param {MockNextBlockTrackerRequestOptions} args - The arguments. + * @param {MockBlockTrackerRequestOptions} args - The arguments. * @param {NockScope} args.nockScope - A nock scope (a set of mocked requests * scoped to a certain base URL). * @param {string} args.blockNumber - The block number that the block tracker @@ -121,35 +121,80 @@ async function mockNextBlockTrackerRequest({ nockScope, blockNumber = DEFAULT_LATEST_BLOCK_NUMBER, }) { - await mockSuccessfulInfuraRpcCall({ + await mockInfuraRpcCall({ nockScope, request: { method: 'eth_blockNumber', params: [] }, response: { result: blockNumber }, }); } +/** + * Mocks all requests for the latest block that the block tracker will make. + * + * @param {MockBlockTrackerRequestOptions} args - The arguments. + * @param {NockScope} args.nockScope - A nock scope (a set of mocked requests + * scoped to a certain base URL). + * @param {string} args.blockNumber - The block number that the block tracker + * should report, as a 0x-prefixed hex string. + */ +async function mockAllBlockTrackerRequests({ + nockScope, + blockNumber = DEFAULT_LATEST_BLOCK_NUMBER, +}) { + await mockInfuraRpcCall({ + nockScope, + request: { method: 'eth_blockNumber', params: [] }, + response: { result: blockNumber }, + }).persist(); +} + /** * Mocks a JSON-RPC request sent to Infura with the given response. * - * @param {MockSuccessfulInfuraRpcCallOptions} args - The arguments. + * @param {MockInfuraRpcCallOptions} args - The arguments. * @param {NockScope} args.nockScope - A nock scope (a set of mocked requests * scoped to a certain base URL). * @param {object} args.request - The request data. - * @param {object} args.response - The response that the request should have. - * @param {number} args.delay - The amount of time that should pass before the + * @param {{body: string} | {httpStatus?: number; id?: number; method?: string; params?: string[]}} [args.response] - Information + * concerning the response that the request should have. If a `body` property is + * present, this is taken as the complete response body. If an `httpStatus` + * property is present, then it is taken as the HTTP status code to respond + * with. Properties other than these two are used to build a complete response + * body (including `id` and `jsonrpc` properties). + * @param {Error | string} [args.error] - An error to throw while making the + * request. Takes precedence over `response`. + * @param {number} [args.delay] - The amount of time that should pass before the * request resolves with the response. + * @param {number} [args.times] - The number of times that the request is + * expected to be made. * @returns {NockScope} The nock scope. */ -function mockSuccessfulInfuraRpcCall({ nockScope, request, response, delay }) { - // eth-query always passes `params`, so even if we don't supply this property +function mockInfuraRpcCall({ + nockScope, + request, + response, + error, + delay, + times, +}) { + // eth-query always passes `params`, so even if we don't supply this property, // for consistency with makeRpcCall, assume that the `body` contains it const { method, params = [], ...rest } = request; - const completeResponse = { - id: 1, - jsonrpc: '2.0', - ...response, - }; - const nockRequest = nockScope.post(`/v3/${INFURA_PROJECT_ID}`, { + const httpStatus = response?.httpStatus ?? 200; + let completeResponse; + if (response !== undefined) { + if (response.body === undefined) { + completeResponse = { id: 1, jsonrpc: '2.0' }; + ['id', 'jsonrpc', 'result', 'error'].forEach((prop) => { + if (response[prop] !== undefined) { + completeResponse[prop] = response[prop]; + } + }); + } else { + completeResponse = response.body; + } + } + let nockRequest = nockScope.post(`/v3/${INFURA_PROJECT_ID}`, { jsonrpc: '2.0', method, params, @@ -157,10 +202,19 @@ function mockSuccessfulInfuraRpcCall({ nockScope, request, response, delay }) { }); if (delay !== undefined) { - nockRequest.delay(delay); + nockRequest = nockRequest.delay(delay); + } + + if (times !== undefined) { + nockRequest = nockRequest.times(times); } - return nockRequest.reply(200, completeResponse); + if (error !== undefined) { + return nockRequest.replyWithError(error); + } else if (completeResponse !== undefined) { + return nockRequest.reply(httpStatus, completeResponse); + } + return nockRequest; } /** @@ -189,7 +243,7 @@ function makeRpcCall(ethQuery, request) { /** * Sets up request mocks for requests to Infura. * - * @param {MockingInfuraCommunicationsArgs} args - Either an options bag + a + * @param {WithMockedInfuraCommunicationsArgs} args - Either an options bag + a * function, or just a function. The options bag, at the moment, may contain * `network` (that is, the Infura network; defaults to "mainnet"). The function * is called with an object that allows you to mock different kinds of requests. @@ -202,11 +256,14 @@ export async function withMockedInfuraCommunications(...args) { const nockScope = buildScopeForMockingInfuraRequests({ network }); const curriedMockNextBlockTrackerRequest = (localOptions) => mockNextBlockTrackerRequest({ nockScope, ...localOptions }); - const curriedMockSuccessfulInfuraRpcCall = (localOptions) => - mockSuccessfulInfuraRpcCall({ nockScope, ...localOptions }); + const curriedMockAllBlockTrackerRequests = (localOptions) => + mockAllBlockTrackerRequests({ nockScope, ...localOptions }); + const curriedMockInfuraRpcCall = (localOptions) => + mockInfuraRpcCall({ nockScope, ...localOptions }); const comms = { mockNextBlockTrackerRequest: curriedMockNextBlockTrackerRequest, - mockSuccessfulInfuraRpcCall: curriedMockSuccessfulInfuraRpcCall, + mockAllBlockTrackerRequests: curriedMockAllBlockTrackerRequests, + mockInfuraRpcCall: curriedMockInfuraRpcCall, }; try { @@ -258,9 +315,10 @@ export async function withInfuraClient(...args) { // depends on `setTimeout`) const clock = sinon.useFakeTimers(); const client = { + blockTracker, + clock, makeRpcCall: curriedMakeRpcCall, makeRpcCallsInSeries, - clock, }; try { diff --git a/app/scripts/controllers/network/provider-api-tests/shared-tests.js b/app/scripts/controllers/network/provider-api-tests/shared-tests.js index aafa2155a9b1..c28855435a55 100644 --- a/app/scripts/controllers/network/provider-api-tests/shared-tests.js +++ b/app/scripts/controllers/network/provider-api-tests/shared-tests.js @@ -9,6 +9,57 @@ import { buildRequestWithReplacedBlockParam, } from './helpers'; +const originalSetTimeout = setTimeout; + +/** + * Some middleware contain logic which retries the request if some condition + * applies. This retrying always happens out of band via `setTimeout`, and + * because we are stubbing time via Jest's fake timers, we have to manually + * advance the clock so that the `setTimeout` handlers get fired. We don't know + * when these timers will get created, however, so we have to keep advancing + * timers until the request has been made an appropriate number of times. + * Unfortunately we don't have a good way to know how many times a request has + * been retried, but the good news is that the middleware won't end, and thus + * the promise which the RPC call returns won't get fulfilled, until all retries + * have been made. + * + * @param promise - The promise which is returned by the RPC call. + * @param clock - A Sinon clock object which can be used to advance to the next + * `setTimeout` handler. + */ +async function waitForPromiseToBeFulfilledAfterRunningAllTimers( + promise, + clock, +) { + let hasPromiseBeenFulfilled = false; + let numTimesClockHasBeenAdvanced = 0; + + promise + .catch(() => { + // This is used to silence Node.js warnings about the rejection + // being handled asynchronously. The error is handled later when + // `promise` is awaited. + }) + .finally(() => { + hasPromiseBeenFulfilled = true; + }); + + // `isPromiseFulfilled` is modified asynchronously. + /* eslint-disable-next-line no-unmodified-loop-condition */ + while (!hasPromiseBeenFulfilled && numTimesClockHasBeenAdvanced < 15) { + clock.runAll(); + await new Promise((resolve) => originalSetTimeout(resolve, 10)); + numTimesClockHasBeenAdvanced += 1; + } + + return promise; +} + +/** + * Defines tests which exercise the behavior exhibited by an RPC method that + * does not support params (which affects how the method is cached). + */ +/* eslint-disable-next-line jest/no-export */ export function testsForRpcMethodNotHandledByMiddleware( method, { numberOfParameters }, @@ -25,7 +76,7 @@ export function testsForRpcMethodNotHandledByMiddleware( // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request, response: { result: expectedResult }, }); @@ -55,7 +106,7 @@ export function testsForRpcMethodAssumingNoBlockParam(method) { // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); @@ -78,12 +129,12 @@ export function testsForRpcMethodAssumingNoBlockParam(method) { // the second RPC request, but rather because we call `clock.runAll()` // below. comms.mockNextBlockTrackerRequest({ blockNumber: '0x1' }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); comms.mockNextBlockTrackerRequest({ blockNumber: '0x2' }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -112,11 +163,11 @@ export function testsForRpcMethodAssumingNoBlockParam(method) { // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -129,6 +180,265 @@ export function testsForRpcMethodAssumingNoBlockParam(method) { }); }, ); + + it('queues requests while a previous identical call is still pending, then runs the queue when it finishes, reusing the result from the first request', async () => { + const requests = [{ method }, { method }, { method }]; + const mockResults = ['first result', 'second result', 'third result']; + + await withMockedInfuraCommunications(async (comms) => { + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + comms.mockInfuraRpcCall({ + request: requests[0], + response: { result: mockResults[0] }, + delay: 100, + }); + comms.mockInfuraRpcCall({ + request: requests[1], + response: { result: mockResults[1] }, + }); + comms.mockInfuraRpcCall({ + request: requests[2], + response: { result: mockResults[2] }, + }); + + const results = await withInfuraClient(async (client) => { + const resultPromises = [ + client.makeRpcCall(requests[0]), + client.makeRpcCall(requests[1]), + client.makeRpcCall(requests[2]), + ]; + const firstResult = await resultPromises[0]; + // The inflight cache middleware uses setTimeout to run the handlers, + // so run them now + client.clock.runAll(); + const remainingResults = await Promise.all(resultPromises.slice(1)); + return [firstResult, ...remainingResults]; + }); + + expect(results).toStrictEqual([ + mockResults[0], + mockResults[0], + mockResults[0], + ]); + }); + }); + + it('throws a custom error if the request to Infura returns a 405 response', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + comms.mockInfuraRpcCall({ + request, + response: { + httpStatus: 405, + }, + }); + const promiseForResult = withInfuraClient(async ({ makeRpcCall }) => + makeRpcCall(request), + ); + + await expect(promiseForResult).rejects.toThrow( + 'The method does not exist / is not available', + ); + }); + }); + + it('throws a custom error if the request to Infura returns a 429 response', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + comms.mockInfuraRpcCall({ + request, + response: { + httpStatus: 429, + }, + }); + const promiseForResult = withInfuraClient(async ({ makeRpcCall }) => + makeRpcCall(request), + ); + + await expect(promiseForResult).rejects.toThrow( + 'Request is being rate limited', + ); + }); + }); + + it('throws a custom error if the request to Infura returns a response that is not 405, 429, 503, or 504', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + comms.mockInfuraRpcCall({ + request, + response: { + id: 12345, + jsonrpc: '2.0', + error: 'some error', + httpStatus: 420, + }, + }); + const promiseForResult = withInfuraClient(async ({ makeRpcCall }) => + makeRpcCall(request), + ); + + await expect(promiseForResult).rejects.toThrow( + '{"id":12345,"jsonrpc":"2.0","error":"some error"}', + ); + }); + }); + + [503, 504].forEach((httpStatus) => { + it(`retries the request to Infura up to 5 times if it returns a ${httpStatus} response, returning the successful result if there is one on the 5th try`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + // Here we have the request fail for the first 4 tries, then succeed + // on the 5th try. + comms.mockInfuraRpcCall({ + request, + response: { + error: 'Some error', + httpStatus, + }, + times: 4, + }); + comms.mockInfuraRpcCall({ + request, + response: { + result: 'the result', + httpStatus: 200, + }, + }); + const result = await withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + expect(result).toStrictEqual('the result'); + }); + }); + + it(`causes a request to fail with a custom error if the request to Infura returns a ${httpStatus} response 5 times in a row`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + comms.mockInfuraRpcCall({ + request, + response: { + error: 'Some error', + httpStatus, + }, + times: 5, + }); + const promiseForResult = withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + await expect(promiseForResult).rejects.toThrow( + /^InfuraProvider - cannot complete request\. All retries exhausted\..+Gateway timeout/su, + ); + }); + }); + }); + + ['ETIMEDOUT', 'ECONNRESET', 'SyntaxError'].forEach((errorMessagePrefix) => { + it(`retries the request to Infura up to 5 times if an "${errorMessagePrefix}" error is thrown while making the request, returning the successful result if there is one on the 5th try`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + // Here we have the request fail for the first 4 tries, then succeed + // on the 5th try. + comms.mockInfuraRpcCall({ + request, + error: `${errorMessagePrefix}: Some message`, + times: 4, + }); + comms.mockInfuraRpcCall({ + request, + response: { + result: 'the result', + httpStatus: 200, + }, + }); + const result = await withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + expect(result).toStrictEqual('the result'); + }); + }); + + it(`causes a request to fail with a custom error if an "${errorMessagePrefix}" error is thrown while making the request to Infura 5 times in a row`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the latest block + // number is retrieved through the block tracker first. It doesn't + // matter what this is — it's just used as a cache key. + comms.mockNextBlockTrackerRequest(); + comms.mockInfuraRpcCall({ + request, + error: `${errorMessagePrefix}: Some message`, + times: 5, + }); + const promiseForResult = withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + await expect(promiseForResult).rejects.toThrow( + new RegExp( + `^InfuraProvider - cannot complete request\\. All retries exhausted\\..+${errorMessagePrefix}: Some message`, + 'su', + ), + ); + }); + }); + }); } /** @@ -148,7 +458,7 @@ export function testsForRpcMethodsThatCheckForBlockHashInResponse(method) { // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); @@ -172,12 +482,12 @@ export function testsForRpcMethodsThatCheckForBlockHashInResponse(method) { // because of the second RPC request, but rather because we call // `clock.runAll()` below. comms.mockNextBlockTrackerRequest({ blockNumber: '0x1' }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); comms.mockNextBlockTrackerRequest({ blockNumber: '0x2' }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -206,11 +516,11 @@ export function testsForRpcMethodsThatCheckForBlockHashInResponse(method) { // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -219,6 +529,7 @@ export function testsForRpcMethodsThatCheckForBlockHashInResponse(method) { makeRpcCallsInSeries(requests), ); + // TODO: Does this work? expect(results).toStrictEqual(mockResults); }); }, @@ -236,11 +547,11 @@ export function testsForRpcMethodsThatCheckForBlockHashInResponse(method) { // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -265,11 +576,11 @@ export function testsForRpcMethodsThatCheckForBlockHashInResponse(method) { // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -298,11 +609,11 @@ export function testsForRpcMethodsThatCheckForBlockHashInResponse(method) { // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -354,7 +665,7 @@ export function testsForRpcMethodSupportingBlockParam( // The block-ref middleware will make the request as specified // except that the block param is replaced with the latest block // number. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: buildRequestWithReplacedBlockParam( requests[0], blockParamIndex, @@ -364,7 +675,7 @@ export function testsForRpcMethodSupportingBlockParam( }); // Note that the block-ref middleware will still allow the original // request to go through. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); @@ -394,7 +705,7 @@ export function testsForRpcMethodSupportingBlockParam( // The block-ref middleware will make the request as specified // except that the block param is replaced with the latest block // number. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: buildRequestWithReplacedBlockParam( requests[0], blockParamIndex, @@ -404,18 +715,18 @@ export function testsForRpcMethodSupportingBlockParam( }); // Note that the block-ref middleware will still allow the original // request to go through. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); comms.mockNextBlockTrackerRequest({ blockNumber: '0x200' }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); // The previous two requests will happen again, with a different block // number, in the same order. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: buildRequestWithReplacedBlockParam( requests[0], blockParamIndex, @@ -423,7 +734,7 @@ export function testsForRpcMethodSupportingBlockParam( ), response: { result: mockResults[1] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[1] }, }); @@ -461,7 +772,7 @@ export function testsForRpcMethodSupportingBlockParam( // The block-ref middleware will make the request as specified // except that the block param is replaced with the latest block // number. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: buildRequestWithReplacedBlockParam( requests[0], blockParamIndex, @@ -471,12 +782,12 @@ export function testsForRpcMethodSupportingBlockParam( }); // Note that the block-ref middleware will still allow the original // request to go through. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); // The previous two requests will happen again, in the same order. - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: buildRequestWithReplacedBlockParam( requests[0], blockParamIndex, @@ -484,7 +795,7 @@ export function testsForRpcMethodSupportingBlockParam( ), response: { result: mockResults[1] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[1] }, }); @@ -497,6 +808,420 @@ export function testsForRpcMethodSupportingBlockParam( }); }, ); + + it('queues requests while a previous identical call is still pending, then runs the queue when it finishes, reusing the result from the first request', async () => { + const requests = [{ method }, { method }, { method }]; + const mockResults = ['first result', 'second result', 'third result']; + + await withMockedInfuraCommunications(async (comms) => { + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + requests[0], + blockParamIndex, + '0x100', + ), + response: { result: mockResults[0] }, + }); + // This is the original request as below, which the block-ref + // middleware will allow through, except that we delay it. + comms.mockInfuraRpcCall({ + request: requests[0], + response: { result: mockResults[0] }, + delay: 100, + }); + // The previous two requests will happen again, in the same order. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + requests[1], + blockParamIndex, + '0x100', + ), + response: { result: mockResults[1] }, + }); + comms.mockInfuraRpcCall({ + request: requests[1], + response: { result: mockResults[1] }, + }); + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + requests[2], + blockParamIndex, + '0x100', + ), + response: { result: mockResults[2] }, + }); + comms.mockInfuraRpcCall({ + request: requests[2], + response: { result: mockResults[2] }, + }); + + const results = await withInfuraClient(async (client) => { + const resultPromises = [ + client.makeRpcCall(requests[0]), + client.makeRpcCall(requests[1]), + client.makeRpcCall(requests[2]), + ]; + const firstResult = await resultPromises[0]; + // The inflight cache middleware uses setTimeout to run the + // handlers, so run them now + client.clock.runAll(); + const remainingResults = await Promise.all(resultPromises.slice(1)); + return [firstResult, ...remainingResults]; + }); + + expect(results).toStrictEqual([ + mockResults[0], + mockResults[0], + mockResults[0], + ]); + }); + }); + + if (blockParamType === 'none') { + it('throws a custom error if the request to Infura returns a 405 response', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + // + // Note, however, that the block-ref middleware doesn't run the + // original request, as it fails before it gets to that point, so + // there is no need to mock the request again. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + response: { + httpStatus: 405, + }, + }); + const promiseForResult = withInfuraClient(async ({ makeRpcCall }) => + makeRpcCall(request), + ); + + await expect(promiseForResult).rejects.toThrow( + 'The method does not exist / is not available', + ); + }); + }); + + it('throws a custom error if the request to Infura returns a 429 response', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + // + // Note, however, that the block-ref middleware doesn't run the + // original request, as it fails before it gets to that point, so + // there is no need to mock the request again. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + response: { + httpStatus: 429, + }, + }); + const promiseForResult = withInfuraClient(async ({ makeRpcCall }) => + makeRpcCall(request), + ); + + await expect(promiseForResult).rejects.toThrow( + 'Request is being rate limited', + ); + }); + }); + + it('throws a custom error if the request to Infura returns a response that is not 405, 429, 503, or 504', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + // + // Note, however, that the block-ref middleware doesn't run the + // original request, as it fails before it gets to that point, so + // there is no need to mock the request again. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + response: { + id: 12345, + jsonrpc: '2.0', + error: 'some error', + httpStatus: 420, + }, + }); + const promiseForResult = withInfuraClient(async ({ makeRpcCall }) => + makeRpcCall(request), + ); + + await expect(promiseForResult).rejects.toThrow( + '{"id":12345,"jsonrpc":"2.0","error":"some error"}', + ); + }); + }); + + [503, 504].forEach((httpStatus) => { + it(`retries the request to Infura up to 5 times if it returns a ${httpStatus} response, returning the successful result if there is one on the 5th try`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + // + // Here we have the request fail for the first 4 tries, then succeed + // on the 5th try. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + response: { + error: 'some error', + httpStatus, + }, + times: 4, + }); + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + response: { + result: 'the result', + httpStatus: 200, + }, + }); + // Note that the block-ref middleware will still allow the original + // request to go through. + comms.mockInfuraRpcCall({ + request, + response: { + result: 'the result', + httpStatus: 200, + }, + }); + const result = await withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + expect(result).toStrictEqual('the result'); + }); + }); + + it(`causes a request to fail with a custom error if the request to Infura returns a ${httpStatus} response 5 times in a row`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + // + // Note, however, that the block-ref middleware doesn't run the + // original request, as it fails before it gets to that point, so + // there is no need to mock the request again. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + response: { + error: 'Some error', + httpStatus, + }, + times: 5, + }); + const promiseForResult = withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + await expect(promiseForResult).rejects.toThrow( + /^InfuraProvider - cannot complete request\. All retries exhausted\..+Gateway timeout/su, + ); + }); + }); + }); + + ['ETIMEDOUT', 'ECONNRESET', 'SyntaxError'].forEach( + (errorMessagePrefix) => { + it(`retries the request to Infura up to 5 times if an "${errorMessagePrefix}" error is thrown while making the request, returning the successful result if there is one on the 5th try`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + // + // Here we have the request fail for the first 4 tries, then + // succeed on the 5th try. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + error: `${errorMessagePrefix}: Some message`, + times: 4, + }); + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + response: { + result: 'the result', + httpStatus: 200, + }, + }); + // Note that the block-ref middleware will still allow the + // original request to go through. + comms.mockInfuraRpcCall({ + request, + response: { + result: 'the result', + httpStatus: 200, + }, + }); + const result = await withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + expect(result).toStrictEqual('the result'); + }); + }); + + it(`causes a request to fail with a custom error if an "${errorMessagePrefix}" error is thrown while making the request to Infura 5 times in a row`, async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { method }; + + // The first time a block-cacheable request is made, the + // block-cache middleware will request the latest block number + // through the block tracker to determine the cache key. Later, + // the block-ref middleware will request the latest block number + // again to resolve the value of "latest", but the block number is + // cached once made, so we only need to mock the request once. + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The block-ref middleware will make the request as specified + // except that the block param is replaced with the latest block + // number. + // + // Note, however, that the block-ref middleware doesn't run the + // original request, as it fails before it gets to that point, so + // there is no need to mock the request again. + comms.mockInfuraRpcCall({ + request: buildRequestWithReplacedBlockParam( + request, + blockParamIndex, + '0x100', + ), + error: `${errorMessagePrefix}: Some message`, + times: 5, + }); + const promiseForResult = withInfuraClient( + async ({ makeRpcCall, clock }) => { + return await waitForPromiseToBeFulfilledAfterRunningAllTimers( + makeRpcCall(request), + clock, + ); + }, + ); + + await expect(promiseForResult).rejects.toThrow( + new RegExp( + `^InfuraProvider - cannot complete request\\. All retries exhausted\\..+${errorMessagePrefix}: Some message`, + 'su', + ), + ); + }); + }); + }, + ); + } }); describe.each([ @@ -518,7 +1243,7 @@ export function testsForRpcMethodSupportingBlockParam( // tracker to determine the cache key. This block number doesn't // matter. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); @@ -545,12 +1270,12 @@ export function testsForRpcMethodSupportingBlockParam( // occur because of the second RPC request, but rather because we // call `clock.runAll()` below. comms.mockNextBlockTrackerRequest({ blockNumber: '0x1' }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); comms.mockNextBlockTrackerRequest({ blockNumber: '0x2' }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -582,11 +1307,11 @@ export function testsForRpcMethodSupportingBlockParam( // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); @@ -622,7 +1347,7 @@ export function testsForRpcMethodSupportingBlockParam( // block number is retrieved through the block tracker first. It // doesn't matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); @@ -654,11 +1379,11 @@ export function testsForRpcMethodSupportingBlockParam( // number is retrieved through the block tracker first. It doesn't // matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: 'first result' }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: 'second result' }, }); @@ -670,6 +1395,70 @@ export function testsForRpcMethodSupportingBlockParam( expect(results).toStrictEqual(['first result', 'second result']); }); }); + + it('makes an additional request to Infura if the given block number matches the latest block number', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { + method, + params: buildMockParamsWithBlockParamAt(blockParamIndex, '0x100'), + }; + + // The first time a block-cacheable request is made, the latest + // block number is retrieved through the block tracker first. This + // also happens within the retry-on-empty middleware (although the + // latest block is cached by now). + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The retry-on-empty middleware will make an explicit request. + comms.mockInfuraRpcCall({ + request, + response: { result: 'this result gets overwritten' }, + }); + // Note that the retry-on-empty middleware will still allow the + // original request to go through. + comms.mockInfuraRpcCall({ + request, + response: { result: 'the actual result' }, + }); + + const result = await withInfuraClient(({ makeRpcCall }) => + makeRpcCall(request), + ); + + expect(result).toStrictEqual('the actual result'); + }); + }); + + it('makes an additional request to Infura if the given block number is less than the latest block number', async () => { + await withMockedInfuraCommunications(async (comms) => { + const request = { + method, + params: buildMockParamsWithBlockParamAt(blockParamIndex, '0x50'), + }; + + // The first time a block-cacheable request is made, the latest + // block number is retrieved through the block tracker first. This + // also happens within the retry-on-empty middleware (although the + // latest block is cached by now). + comms.mockNextBlockTrackerRequest({ blockNumber: '0x100' }); + // The retry-on-empty middleware will make an explicit request. + comms.mockInfuraRpcCall({ + request, + response: { result: 'this result gets overwritten' }, + }); + // Note that the retry-on-empty middleware will still allow the + // original request to go through. + comms.mockInfuraRpcCall({ + request, + response: { result: 'the actual result' }, + }); + + const result = await withInfuraClient(({ makeRpcCall }) => + makeRpcCall(request), + ); + + expect(result).toStrictEqual('the actual result'); + }); + }); } }); @@ -688,11 +1477,11 @@ export function testsForRpcMethodSupportingBlockParam( // block number is retrieved through the block tracker first. It // doesn't matter what this is — it's just used as a cache key. comms.mockNextBlockTrackerRequest(); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[0], response: { result: mockResults[0] }, }); - comms.mockSuccessfulInfuraRpcCall({ + comms.mockInfuraRpcCall({ request: requests[1], response: { result: mockResults[1] }, }); diff --git a/jest.config.js b/jest.config.js index 04b26dfe6519..1c8cfe7ff033 100644 --- a/jest.config.js +++ b/jest.config.js @@ -49,7 +49,7 @@ module.exports = { '/app/scripts/lib/**/*.test.js', '/app/scripts/migrations/*.test.js', '/app/scripts/platforms/*.test.js', - 'app/scripts/controllers/network/**/*.test.js', + '/app/scripts/controllers/network/**/*.test.js', '/app/scripts/controllers/permissions/**/*.test.js', '/app/scripts/flask/**/*.test.js', '/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js', diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index fc15ef26bab5..2e9433adf656 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -288,7 +288,7 @@ "browserify>insert-module-globals>is-buffer": true, "browserify>timers-browserify": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs-mini": { @@ -388,7 +388,7 @@ "3box>ipfs>multibase": true, "browserify>assert": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>dlv": { @@ -450,7 +450,7 @@ "browserify>assert": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-bitswap>bignumber.js": { @@ -520,7 +520,7 @@ "browserify>assert": true, "browserify>browser-resolve": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-mfs>hamt-sharding": { @@ -567,7 +567,7 @@ "browserify>path-browserify": true, "browserify>timers-browserify": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-repo>bignumber.js": { @@ -811,7 +811,7 @@ "3box>ipfs>protons": true, "base32-encode": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>is-ipfs": { @@ -850,7 +850,7 @@ "browserify>insert-module-globals>is-buffer": true, "browserify>process": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -866,7 +866,7 @@ "3box>ipfs>peer-info": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p-crypto": { @@ -979,7 +979,7 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "promise-to-callback": true } }, @@ -1102,7 +1102,7 @@ "browserify>assert": true, "browserify>buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1161,7 +1161,7 @@ "3box>ipfs>stream-to-pull-stream": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1177,7 +1177,7 @@ "3box>ipfs>libp2p-webrtc-star>simple-peer>readable-stream": true, "browserify>buffer": true, "ethereumjs-wallet>randombytes": true, - "madge>debug": true, + "nock>debug": true, "pumpify>inherits": true } }, @@ -1377,7 +1377,7 @@ "3box>ipfs>multiaddr": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1399,7 +1399,7 @@ "browserify>buffer": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true, "uuid": true } @@ -1449,7 +1449,7 @@ "3box>ipfs>multiaddr-to-uri": true, "3box>ipfs>pull-mplex>interface-connection": true, "browserify>os-browserify": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p-websockets>pull-ws": { @@ -1478,7 +1478,7 @@ "packages": { "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": true, "browserify>events": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": { @@ -1518,7 +1518,7 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": { @@ -1535,7 +1535,7 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub>time-cache": { @@ -1555,7 +1555,7 @@ "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-switch": { @@ -1578,7 +1578,7 @@ "browserify>assert": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1601,7 +1601,7 @@ "3box>ipfs>pull-stream": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1631,7 +1631,7 @@ "browserify>assert": true, "browserify>buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1806,7 +1806,7 @@ "browserify>buffer": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>pull-mplex>interface-connection": { @@ -3102,7 +3102,7 @@ "packages": { "@metamask/eth-json-rpc-infura>@metamask/utils>superstruct": true, "eslint>fast-deep-equal": true, - "madge>debug": true + "nock>debug": true } }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": { @@ -3231,15 +3231,36 @@ }, "packages": { "@babel/runtime": true, + "@metamask/eth-token-tracker>deep-equal": true, "@metamask/eth-token-tracker>eth-block-tracker": true, "@metamask/eth-token-tracker>ethjs": true, "@metamask/eth-token-tracker>human-standard-token-abi": true, "ethjs-contract": true, "ethjs-query": true, - "nock>deep-equal": true, "safe-event-emitter": true } }, + "@metamask/eth-token-tracker>deep-equal": { + "packages": { + "@metamask/eth-token-tracker>deep-equal>is-arguments": true, + "@metamask/eth-token-tracker>deep-equal>is-date-object": true, + "enzyme>is-regex": true, + "enzyme>object-is": true, + "mocha>object.assign>object-keys": true, + "string.prototype.matchall>regexp.prototype.flags": true + } + }, + "@metamask/eth-token-tracker>deep-equal>is-arguments": { + "packages": { + "koa>is-generator-function>has-tostringtag": true, + "string.prototype.matchall>call-bind": true + } + }, + "@metamask/eth-token-tracker>deep-equal>is-date-object": { + "packages": { + "koa>is-generator-function>has-tostringtag": true + } + }, "@metamask/eth-token-tracker>eth-block-tracker": { "globals": { "clearTimeout": true, @@ -3670,6 +3691,11 @@ "localStorage": true } }, + "@storybook/components>qs": { + "packages": { + "string.prototype.matchall>side-channel": true + } + }, "@storybook/react>@storybook/store>stable": { "globals": { "define": true @@ -3690,7 +3716,7 @@ "browserify>buffer": true, "browserify>util": true, "gulp-dart-sass>lodash.clonedeep": true, - "madge>debug": true, + "nock>debug": true, "semver": true } }, @@ -3913,7 +3939,7 @@ "@truffle/codec>web3-utils": true, "@truffle/decoder>@truffle/source-map-utils": true, "@truffle/decoder>bn.js": true, - "madge>debug": true + "nock>debug": true } }, "@truffle/decoder>@truffle/source-map-utils": { @@ -3923,7 +3949,7 @@ "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": true, "@truffle/decoder>@truffle/source-map-utils>json-pointer": true, "@truffle/decoder>@truffle/source-map-utils>node-interval-tree": true, - "madge>debug": true + "nock>debug": true } }, "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": { @@ -4516,7 +4542,7 @@ "packages": { "eslint>fast-deep-equal": true, "eth-block-tracker>@metamask/utils>superstruct": true, - "madge>debug": true + "nock>debug": true } }, "eth-ens-namehash": { @@ -4586,7 +4612,7 @@ "packages": { "eslint>fast-deep-equal": true, "eth-json-rpc-middleware>@metamask/utils>superstruct": true, - "madge>debug": true + "nock>debug": true } }, "eth-json-rpc-middleware>eth-sig-util": { @@ -4918,10 +4944,10 @@ "setTimeout": true }, "packages": { + "@storybook/components>qs": true, "browserify>browser-resolve": true, "browserify>process": true, "eth-rpc-errors>fast-safe-stringify": true, - "nock>qs": true, "pubnub>superagent>component-emitter": true } }, @@ -4943,7 +4969,7 @@ "eth-query": { "packages": { "eth-query>json-rpc-random-id": true, - "madge>debug": true, + "nock>debug": true, "watchify>xtend": true } }, @@ -6683,7 +6709,7 @@ "globalthis>define-properties": { "packages": { "globalthis>define-properties>has-property-descriptors": true, - "nock>deep-equal>object-keys": true + "mocha>object.assign>object-keys": true } }, "globalthis>define-properties>has-property-descriptors": { @@ -6774,19 +6800,6 @@ "Intl": true } }, - "madge>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "madge>debug>ms": true - } - }, "madge>rc>deep-extend": { "packages": { "browserify>buffer": true @@ -6822,30 +6835,17 @@ "navigator": true } }, - "nock>deep-equal": { - "packages": { - "enzyme>is-regex": true, - "enzyme>object-is": true, - "nock>deep-equal>is-arguments": true, - "nock>deep-equal>is-date-object": true, - "nock>deep-equal>object-keys": true, - "string.prototype.matchall>regexp.prototype.flags": true - } - }, - "nock>deep-equal>is-arguments": { - "packages": { - "koa>is-generator-function>has-tostringtag": true, - "string.prototype.matchall>call-bind": true - } - }, - "nock>deep-equal>is-date-object": { - "packages": { - "koa>is-generator-function>has-tostringtag": true - } - }, - "nock>qs": { + "nock>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, "packages": { - "string.prototype.matchall>side-channel": true + "browserify>process": true, + "nock>debug>ms": true } }, "node-fetch": { diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 8a8c07847d6a..3613d9de2cc2 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -288,7 +288,7 @@ "browserify>insert-module-globals>is-buffer": true, "browserify>timers-browserify": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs-mini": { @@ -388,7 +388,7 @@ "3box>ipfs>multibase": true, "browserify>assert": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>dlv": { @@ -450,7 +450,7 @@ "browserify>assert": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-bitswap>bignumber.js": { @@ -520,7 +520,7 @@ "browserify>assert": true, "browserify>browser-resolve": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-mfs>hamt-sharding": { @@ -567,7 +567,7 @@ "browserify>path-browserify": true, "browserify>timers-browserify": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-repo>bignumber.js": { @@ -811,7 +811,7 @@ "3box>ipfs>protons": true, "base32-encode": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>is-ipfs": { @@ -850,7 +850,7 @@ "browserify>insert-module-globals>is-buffer": true, "browserify>process": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -866,7 +866,7 @@ "3box>ipfs>peer-info": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p-crypto": { @@ -979,7 +979,7 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "promise-to-callback": true } }, @@ -1102,7 +1102,7 @@ "browserify>assert": true, "browserify>buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1161,7 +1161,7 @@ "3box>ipfs>stream-to-pull-stream": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1177,7 +1177,7 @@ "3box>ipfs>libp2p-webrtc-star>simple-peer>readable-stream": true, "browserify>buffer": true, "ethereumjs-wallet>randombytes": true, - "madge>debug": true, + "nock>debug": true, "pumpify>inherits": true } }, @@ -1377,7 +1377,7 @@ "3box>ipfs>multiaddr": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1399,7 +1399,7 @@ "browserify>buffer": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true, "uuid": true } @@ -1449,7 +1449,7 @@ "3box>ipfs>multiaddr-to-uri": true, "3box>ipfs>pull-mplex>interface-connection": true, "browserify>os-browserify": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p-websockets>pull-ws": { @@ -1478,7 +1478,7 @@ "packages": { "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": true, "browserify>events": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": { @@ -1518,7 +1518,7 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": { @@ -1535,7 +1535,7 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub>time-cache": { @@ -1555,7 +1555,7 @@ "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-switch": { @@ -1578,7 +1578,7 @@ "browserify>assert": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1601,7 +1601,7 @@ "3box>ipfs>pull-stream": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1631,7 +1631,7 @@ "browserify>assert": true, "browserify>buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1806,7 +1806,7 @@ "browserify>buffer": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>pull-mplex>interface-connection": { @@ -2218,7 +2218,7 @@ "browserify>path-browserify": true, "browserify>process": true, "depcheck>@babel/traverse": true, - "madge>debug": true, + "nock>debug": true, "nyc>convert-source-map": true } }, @@ -3263,7 +3263,7 @@ "packages": { "@metamask/eth-json-rpc-infura>@metamask/utils>superstruct": true, "eslint>fast-deep-equal": true, - "madge>debug": true + "nock>debug": true } }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": { @@ -3392,15 +3392,36 @@ }, "packages": { "@babel/runtime": true, + "@metamask/eth-token-tracker>deep-equal": true, "@metamask/eth-token-tracker>eth-block-tracker": true, "@metamask/eth-token-tracker>ethjs": true, "@metamask/eth-token-tracker>human-standard-token-abi": true, "ethjs-contract": true, "ethjs-query": true, - "nock>deep-equal": true, "safe-event-emitter": true } }, + "@metamask/eth-token-tracker>deep-equal": { + "packages": { + "@metamask/eth-token-tracker>deep-equal>is-arguments": true, + "@metamask/eth-token-tracker>deep-equal>is-date-object": true, + "enzyme>is-regex": true, + "enzyme>object-is": true, + "mocha>object.assign>object-keys": true, + "string.prototype.matchall>regexp.prototype.flags": true + } + }, + "@metamask/eth-token-tracker>deep-equal>is-arguments": { + "packages": { + "koa>is-generator-function>has-tostringtag": true, + "string.prototype.matchall>call-bind": true + } + }, + "@metamask/eth-token-tracker>deep-equal>is-date-object": { + "packages": { + "koa>is-generator-function>has-tostringtag": true + } + }, "@metamask/eth-token-tracker>eth-block-tracker": { "globals": { "clearTimeout": true, @@ -4448,6 +4469,11 @@ "localStorage": true } }, + "@storybook/components>qs": { + "packages": { + "string.prototype.matchall>side-channel": true + } + }, "@storybook/react>@storybook/store>stable": { "globals": { "define": true @@ -4468,7 +4494,7 @@ "browserify>buffer": true, "browserify>util": true, "gulp-dart-sass>lodash.clonedeep": true, - "madge>debug": true, + "nock>debug": true, "semver": true } }, @@ -4691,7 +4717,7 @@ "@truffle/codec>web3-utils": true, "@truffle/decoder>@truffle/source-map-utils": true, "@truffle/decoder>bn.js": true, - "madge>debug": true + "nock>debug": true } }, "@truffle/decoder>@truffle/source-map-utils": { @@ -4701,7 +4727,7 @@ "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": true, "@truffle/decoder>@truffle/source-map-utils>json-pointer": true, "@truffle/decoder>@truffle/source-map-utils>node-interval-tree": true, - "madge>debug": true + "nock>debug": true } }, "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": { @@ -5240,7 +5266,7 @@ "depcheck>@babel/traverse>@babel/helper-hoist-variables": true, "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, "depcheck>@babel/traverse>globals": true, - "madge>debug": true + "nock>debug": true } }, "depcheck>@babel/traverse>@babel/helper-function-name": { @@ -5328,7 +5354,7 @@ "packages": { "eslint>fast-deep-equal": true, "eth-block-tracker>@metamask/utils>superstruct": true, - "madge>debug": true + "nock>debug": true } }, "eth-ens-namehash": { @@ -5398,7 +5424,7 @@ "packages": { "eslint>fast-deep-equal": true, "eth-json-rpc-middleware>@metamask/utils>superstruct": true, - "madge>debug": true + "nock>debug": true } }, "eth-json-rpc-middleware>eth-sig-util": { @@ -5730,10 +5756,10 @@ "setTimeout": true }, "packages": { + "@storybook/components>qs": true, "browserify>browser-resolve": true, "browserify>process": true, "eth-rpc-errors>fast-safe-stringify": true, - "nock>qs": true, "pubnub>superagent>component-emitter": true } }, @@ -5755,7 +5781,7 @@ "eth-query": { "packages": { "eth-query>json-rpc-random-id": true, - "madge>debug": true, + "nock>debug": true, "watchify>xtend": true } }, @@ -7495,7 +7521,7 @@ "globalthis>define-properties": { "packages": { "globalthis>define-properties>has-property-descriptors": true, - "nock>deep-equal>object-keys": true + "mocha>object.assign>object-keys": true } }, "globalthis>define-properties>has-property-descriptors": { @@ -7606,19 +7632,6 @@ "Intl": true } }, - "madge>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "madge>debug>ms": true - } - }, "madge>rc>deep-extend": { "packages": { "browserify>buffer": true @@ -7654,30 +7667,17 @@ "navigator": true } }, - "nock>deep-equal": { - "packages": { - "enzyme>is-regex": true, - "enzyme>object-is": true, - "nock>deep-equal>is-arguments": true, - "nock>deep-equal>is-date-object": true, - "nock>deep-equal>object-keys": true, - "string.prototype.matchall>regexp.prototype.flags": true - } - }, - "nock>deep-equal>is-arguments": { - "packages": { - "koa>is-generator-function>has-tostringtag": true, - "string.prototype.matchall>call-bind": true - } - }, - "nock>deep-equal>is-date-object": { - "packages": { - "koa>is-generator-function>has-tostringtag": true - } - }, - "nock>qs": { + "nock>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, "packages": { - "string.prototype.matchall>side-channel": true + "browserify>process": true, + "nock>debug>ms": true } }, "node-fetch": { diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index fc15ef26bab5..2e9433adf656 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -288,7 +288,7 @@ "browserify>insert-module-globals>is-buffer": true, "browserify>timers-browserify": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs-mini": { @@ -388,7 +388,7 @@ "3box>ipfs>multibase": true, "browserify>assert": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>dlv": { @@ -450,7 +450,7 @@ "browserify>assert": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-bitswap>bignumber.js": { @@ -520,7 +520,7 @@ "browserify>assert": true, "browserify>browser-resolve": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-mfs>hamt-sharding": { @@ -567,7 +567,7 @@ "browserify>path-browserify": true, "browserify>timers-browserify": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>ipfs-repo>bignumber.js": { @@ -811,7 +811,7 @@ "3box>ipfs>protons": true, "base32-encode": true, "browserify>buffer": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>is-ipfs": { @@ -850,7 +850,7 @@ "browserify>insert-module-globals>is-buffer": true, "browserify>process": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -866,7 +866,7 @@ "3box>ipfs>peer-info": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p-crypto": { @@ -979,7 +979,7 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "promise-to-callback": true } }, @@ -1102,7 +1102,7 @@ "browserify>assert": true, "browserify>buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1161,7 +1161,7 @@ "3box>ipfs>stream-to-pull-stream": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1177,7 +1177,7 @@ "3box>ipfs>libp2p-webrtc-star>simple-peer>readable-stream": true, "browserify>buffer": true, "ethereumjs-wallet>randombytes": true, - "madge>debug": true, + "nock>debug": true, "pumpify>inherits": true } }, @@ -1377,7 +1377,7 @@ "3box>ipfs>multiaddr": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1399,7 +1399,7 @@ "browserify>buffer": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true, "uuid": true } @@ -1449,7 +1449,7 @@ "3box>ipfs>multiaddr-to-uri": true, "3box>ipfs>pull-mplex>interface-connection": true, "browserify>os-browserify": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p-websockets>pull-ws": { @@ -1478,7 +1478,7 @@ "packages": { "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": true, "browserify>events": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": { @@ -1518,7 +1518,7 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": { @@ -1535,7 +1535,7 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub>time-cache": { @@ -1555,7 +1555,7 @@ "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>libp2p>libp2p-switch": { @@ -1578,7 +1578,7 @@ "browserify>assert": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1601,7 +1601,7 @@ "3box>ipfs>pull-stream": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1631,7 +1631,7 @@ "browserify>assert": true, "browserify>buffer": true, "gh-pages>async": true, - "madge>debug": true, + "nock>debug": true, "pump>once": true } }, @@ -1806,7 +1806,7 @@ "browserify>buffer": true, "browserify>events": true, "gh-pages>async": true, - "madge>debug": true + "nock>debug": true } }, "3box>ipfs>pull-mplex>interface-connection": { @@ -3102,7 +3102,7 @@ "packages": { "@metamask/eth-json-rpc-infura>@metamask/utils>superstruct": true, "eslint>fast-deep-equal": true, - "madge>debug": true + "nock>debug": true } }, "@metamask/eth-json-rpc-infura>eth-json-rpc-middleware": { @@ -3231,15 +3231,36 @@ }, "packages": { "@babel/runtime": true, + "@metamask/eth-token-tracker>deep-equal": true, "@metamask/eth-token-tracker>eth-block-tracker": true, "@metamask/eth-token-tracker>ethjs": true, "@metamask/eth-token-tracker>human-standard-token-abi": true, "ethjs-contract": true, "ethjs-query": true, - "nock>deep-equal": true, "safe-event-emitter": true } }, + "@metamask/eth-token-tracker>deep-equal": { + "packages": { + "@metamask/eth-token-tracker>deep-equal>is-arguments": true, + "@metamask/eth-token-tracker>deep-equal>is-date-object": true, + "enzyme>is-regex": true, + "enzyme>object-is": true, + "mocha>object.assign>object-keys": true, + "string.prototype.matchall>regexp.prototype.flags": true + } + }, + "@metamask/eth-token-tracker>deep-equal>is-arguments": { + "packages": { + "koa>is-generator-function>has-tostringtag": true, + "string.prototype.matchall>call-bind": true + } + }, + "@metamask/eth-token-tracker>deep-equal>is-date-object": { + "packages": { + "koa>is-generator-function>has-tostringtag": true + } + }, "@metamask/eth-token-tracker>eth-block-tracker": { "globals": { "clearTimeout": true, @@ -3670,6 +3691,11 @@ "localStorage": true } }, + "@storybook/components>qs": { + "packages": { + "string.prototype.matchall>side-channel": true + } + }, "@storybook/react>@storybook/store>stable": { "globals": { "define": true @@ -3690,7 +3716,7 @@ "browserify>buffer": true, "browserify>util": true, "gulp-dart-sass>lodash.clonedeep": true, - "madge>debug": true, + "nock>debug": true, "semver": true } }, @@ -3913,7 +3939,7 @@ "@truffle/codec>web3-utils": true, "@truffle/decoder>@truffle/source-map-utils": true, "@truffle/decoder>bn.js": true, - "madge>debug": true + "nock>debug": true } }, "@truffle/decoder>@truffle/source-map-utils": { @@ -3923,7 +3949,7 @@ "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": true, "@truffle/decoder>@truffle/source-map-utils>json-pointer": true, "@truffle/decoder>@truffle/source-map-utils>node-interval-tree": true, - "madge>debug": true + "nock>debug": true } }, "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": { @@ -4516,7 +4542,7 @@ "packages": { "eslint>fast-deep-equal": true, "eth-block-tracker>@metamask/utils>superstruct": true, - "madge>debug": true + "nock>debug": true } }, "eth-ens-namehash": { @@ -4586,7 +4612,7 @@ "packages": { "eslint>fast-deep-equal": true, "eth-json-rpc-middleware>@metamask/utils>superstruct": true, - "madge>debug": true + "nock>debug": true } }, "eth-json-rpc-middleware>eth-sig-util": { @@ -4918,10 +4944,10 @@ "setTimeout": true }, "packages": { + "@storybook/components>qs": true, "browserify>browser-resolve": true, "browserify>process": true, "eth-rpc-errors>fast-safe-stringify": true, - "nock>qs": true, "pubnub>superagent>component-emitter": true } }, @@ -4943,7 +4969,7 @@ "eth-query": { "packages": { "eth-query>json-rpc-random-id": true, - "madge>debug": true, + "nock>debug": true, "watchify>xtend": true } }, @@ -6683,7 +6709,7 @@ "globalthis>define-properties": { "packages": { "globalthis>define-properties>has-property-descriptors": true, - "nock>deep-equal>object-keys": true + "mocha>object.assign>object-keys": true } }, "globalthis>define-properties>has-property-descriptors": { @@ -6774,19 +6800,6 @@ "Intl": true } }, - "madge>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "madge>debug>ms": true - } - }, "madge>rc>deep-extend": { "packages": { "browserify>buffer": true @@ -6822,30 +6835,17 @@ "navigator": true } }, - "nock>deep-equal": { - "packages": { - "enzyme>is-regex": true, - "enzyme>object-is": true, - "nock>deep-equal>is-arguments": true, - "nock>deep-equal>is-date-object": true, - "nock>deep-equal>object-keys": true, - "string.prototype.matchall>regexp.prototype.flags": true - } - }, - "nock>deep-equal>is-arguments": { - "packages": { - "koa>is-generator-function>has-tostringtag": true, - "string.prototype.matchall>call-bind": true - } - }, - "nock>deep-equal>is-date-object": { - "packages": { - "koa>is-generator-function>has-tostringtag": true - } - }, - "nock>qs": { + "nock>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, "packages": { - "string.prototype.matchall>side-channel": true + "browserify>process": true, + "nock>debug>ms": true } }, "node-fetch": { diff --git a/lavamoat/build-system/policy-override.json b/lavamoat/build-system/policy-override.json index 499e683e2df1..39640ea8d7aa 100644 --- a/lavamoat/build-system/policy-override.json +++ b/lavamoat/build-system/policy-override.json @@ -158,7 +158,8 @@ "eslint-plugin-jest>@typescript-eslint/utils": true, "eslint>debug": true, "madge>debug": true, - "typescript": true + "typescript": true, + "nock>debug": true } }, "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug": { diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 2cad4ca0eebb..d83c594a851a 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -52,7 +52,7 @@ "@babel/preset-typescript": true, "depcheck>@babel/traverse": true, "depcheck>json5": true, - "madge>debug": true, + "nock>debug": true, "nyc>convert-source-map": true } }, @@ -1046,6 +1046,11 @@ "pumpify>inherits": true } }, + "@metamask/eth-token-tracker>deep-equal>is-date-object": { + "packages": { + "koa>is-generator-function>has-tostringtag": true + } + }, "@metamask/jazzicon>color>color-convert": { "packages": { "@metamask/jazzicon>color>color-convert>color-name": true @@ -1076,6 +1081,11 @@ "util.deprecate": true } }, + "@storybook/components>qs": { + "packages": { + "string.prototype.matchall>side-channel": true + } + }, "@storybook/react>acorn-walk": { "globals": { "define": true @@ -1109,6 +1119,7 @@ "eslint-plugin-jest>@typescript-eslint/utils": true, "eslint>debug": true, "madge>debug": true, + "nock>debug": true, "typescript": true } }, @@ -1144,7 +1155,7 @@ "packages": { "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, "@typescript-eslint/parser>@typescript-eslint/typescript-estree": true, - "madge>debug": true, + "nock>debug": true, "typescript": true } }, @@ -1177,7 +1188,7 @@ "@typescript-eslint/parser>@typescript-eslint/types": true, "eslint>is-glob": true, "globby": true, - "madge>debug": true, + "nock>debug": true, "semver": true, "typescript": true } @@ -2004,7 +2015,7 @@ "depcheck>@babel/traverse>@babel/helper-hoist-variables": true, "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, "depcheck>@babel/traverse>globals": true, - "madge>debug": true + "nock>debug": true } }, "depcheck>@babel/traverse>@babel/helper-function-name": { @@ -2176,7 +2187,7 @@ "enzyme>object.assign": { "packages": { "globalthis>define-properties": true, - "nock>deep-equal>object-keys": true, + "mocha>object.assign>object-keys": true, "string.prototype.matchall>call-bind": true, "string.prototype.matchall>has-symbols": true } @@ -2243,7 +2254,7 @@ "eslint>natural-compare": true, "eslint>regexpp": true, "globby>ignore": true, - "madge>debug": true + "nock>debug": true } }, "eslint-config-prettier": { @@ -2291,7 +2302,7 @@ "brfs>resolve": true, "eslint-plugin-import>tsconfig-paths": true, "eslint>is-glob": true, - "madge>debug": true, + "nock>debug": true, "nyc>glob": true } }, @@ -2537,7 +2548,7 @@ "eslint-plugin-jsdoc>escape-string-regexp": true, "eslint-plugin-jsdoc>spdx-expression-parse": true, "eslint>esquery": true, - "madge>debug": true, + "nock>debug": true, "semver": true } }, @@ -2764,7 +2775,7 @@ "eslint>minimatch": true, "eslint>strip-json-comments": true, "globby>ignore": true, - "madge>debug": true + "nock>debug": true } }, "eslint>@humanwhocodes/config-array": { @@ -2774,7 +2785,7 @@ "packages": { "eslint>@humanwhocodes/config-array>@humanwhocodes/object-schema": true, "eslint>minimatch": true, - "madge>debug": true + "nock>debug": true } }, "eslint>ajv": { @@ -3122,7 +3133,7 @@ "globalthis>define-properties": { "packages": { "globalthis>define-properties>has-property-descriptors": true, - "nock>deep-equal>object-keys": true + "mocha>object.assign>object-keys": true } }, "globalthis>define-properties>has-property-descriptors": { @@ -3510,10 +3521,10 @@ "console.error": true }, "packages": { + "@storybook/components>qs": true, "gulp-livereload>tiny-lr>body": true, "gulp-livereload>tiny-lr>debug": true, "gulp-livereload>tiny-lr>faye-websocket": true, - "nock>qs": true, "react>object-assign": true } }, @@ -6452,25 +6463,6 @@ "loose-envify>js-tokens": true } }, - "madge>debug": { - "builtin": { - "tty.isatty": true, - "util.deprecate": true, - "util.format": true, - "util.inspect": true - }, - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "madge>debug>ms": true, - "sinon>supports-color": true - } - }, "madge>detective-scss>gonzales-pe": { "globals": { "console.error": true, @@ -6498,6 +6490,13 @@ "stylelint>balanced-match": true } }, + "mocha>mkdirp": { + "builtin": { + "fs": true, + "path.dirname": true, + "path.resolve": true + } + }, "mocha>supports-color>has-flag": { "globals": { "process.argv": true @@ -6530,21 +6529,23 @@ "process.platform": true } }, - "nock>deep-equal>is-date-object": { - "packages": { - "koa>is-generator-function>has-tostringtag": true - } - }, - "nock>mkdirp": { + "nock>debug": { "builtin": { - "fs": true, - "path.dirname": true, - "path.resolve": true - } - }, - "nock>qs": { + "tty.isatty": true, + "util.deprecate": true, + "util.format": true, + "util.inspect": true + }, + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, "packages": { - "string.prototype.matchall>side-channel": true + "nock>debug>ms": true, + "sinon>supports-color": true } }, "node-sass": { @@ -6960,9 +6961,9 @@ }, "string.prototype.matchall>es-abstract>es-to-primitive": { "packages": { + "@metamask/eth-token-tracker>deep-equal>is-date-object": true, "@storybook/api>telejson>is-symbol": true, - "enzyme>is-callable": true, - "nock>deep-equal>is-date-object": true + "enzyme>is-callable": true } }, "string.prototype.matchall>get-intrinsic": { @@ -7029,7 +7030,7 @@ "globby>ignore": true, "globby>slash": true, "lodash": true, - "madge>debug": true, + "nock>debug": true, "nyc>resolve-from": true, "stylelint>@stylelint/postcss-css-in-js": true, "stylelint>@stylelint/postcss-markdown": true, @@ -7343,7 +7344,7 @@ "path.dirname": true }, "packages": { - "nock>mkdirp": true + "mocha>mkdirp": true } }, "stylelint>global-modules": { diff --git a/package.json b/package.json index 3d9fbb4c841e..ec8962ecffc2 100644 --- a/package.json +++ b/package.json @@ -363,7 +363,7 @@ "madge": "^5.0.1", "mocha": "^7.2.0", "mockttp": "^2.6.0", - "nock": "^9.0.14", + "nock": "^13.2.9", "node-fetch": "^2.6.1", "nyc": "^15.0.0", "patch-package": "^6.4.7", diff --git a/patches/eth-query+2.1.2.patch b/patches/eth-query+2.1.2.patch index ea405d5f8f03..5ab82b6d5202 100644 --- a/patches/eth-query+2.1.2.patch +++ b/patches/eth-query+2.1.2.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/eth-query/index.js b/node_modules/eth-query/index.js -index 13e9f3c..303d703 100644 +index 13e9f3c..d714bb7 100644 --- a/node_modules/eth-query/index.js +++ b/node_modules/eth-query/index.js @@ -1,5 +1,6 @@ @@ -9,7 +9,7 @@ index 13e9f3c..303d703 100644 module.exports = EthQuery -@@ -63,7 +64,9 @@ EthQuery.prototype.submitHashrate = generateFnFor('eth_subm +@@ -63,7 +64,10 @@ EthQuery.prototype.submitHashrate = generateFnFor('eth_subm EthQuery.prototype.sendAsync = function(opts, cb){ const self = this @@ -17,6 +17,7 @@ index 13e9f3c..303d703 100644 + const payload = createPayload(opts) + debug('making request %o', payload) + self.currentProvider.sendAsync(payload, function(err, response){ ++ debug('got err = %o, response = %o', err, response) if (!err && response.error) err = new Error('EthQuery - RPC Error - '+response.error.message) if (err) return cb(err) cb(null, response.result) diff --git a/test/helpers/setup-helper.js b/test/helpers/setup-helper.js index 2c7a8299fe50..cb627c805cdc 100644 --- a/test/helpers/setup-helper.js +++ b/test/helpers/setup-helper.js @@ -12,6 +12,12 @@ global.chrome = { nock.disableNetConnect(); nock.enableNetConnect('localhost'); +if (typeof beforeEach === 'function') { + /* eslint-disable-next-line jest/require-top-level-describe */ + beforeEach(() => { + nock.cleanAll(); + }); +} // catch rejections that are still unhandled when tests exit const unhandledRejections = new Map(); diff --git a/test/jest/setup.js b/test/jest/setup.js index ae49888e5e9a..c0852092041c 100644 --- a/test/jest/setup.js +++ b/test/jest/setup.js @@ -1,4 +1,6 @@ // This file is for Jest-specific setup only and runs before our Jest tests. + +import nock from 'nock'; import '@testing-library/jest-dom'; jest.mock('webextension-polyfill', () => { @@ -8,3 +10,8 @@ jest.mock('webextension-polyfill', () => { }, }; }); + +/* eslint-disable-next-line jest/require-top-level-describe */ +beforeEach(() => { + nock.cleanAll(); +}); diff --git a/ui/pages/swaps/swaps.util.test.js b/ui/pages/swaps/swaps.util.test.js index d263f55c22b1..e1e1038748ff 100644 --- a/ui/pages/swaps/swaps.util.test.js +++ b/ui/pages/swaps/swaps.util.test.js @@ -42,7 +42,7 @@ jest.mock('../../../shared/lib/storage-helpers', () => ({ })); describe('Swaps Util', () => { - afterAll(() => { + afterEach(() => { nock.cleanAll(); }); @@ -112,7 +112,7 @@ describe('Swaps Util', () => { }); describe('fetchTokens', () => { - beforeAll(() => { + beforeEach(() => { nock('https://swap.metaswap.codefi.network') .persist() .get('/networks/1/tokens') @@ -131,7 +131,7 @@ describe('Swaps Util', () => { }); describe('fetchAggregatorMetadata', () => { - beforeAll(() => { + beforeEach(() => { nock('https://swap.metaswap.codefi.network') .persist() .get('/networks/1/aggregatorMetadata') @@ -150,7 +150,7 @@ describe('Swaps Util', () => { }); describe('fetchTopAssets', () => { - beforeAll(() => { + beforeEach(() => { nock('https://swap.metaswap.codefi.network') .persist() .get('/networks/1/topAssets') diff --git a/yarn.lock b/yarn.lock index 32b18cf97b55..701ee0bffb97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7114,7 +7114,7 @@ assert@^2.0.0: object-is "^1.0.1" util "^0.12.0" -assertion-error@^1.0.1, assertion-error@^1.1.0: +assertion-error@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== @@ -8778,15 +8778,6 @@ chai-checkmark@^1.0.1: resolved "https://registry.yarnpkg.com/chai-checkmark/-/chai-checkmark-1.0.1.tgz#9fbb3c9ad9101f097ef288328d30f4227d74fffb" integrity sha1-n7s8mtkQHwl+8ogyjTD0In10//s= -"chai@>=1.9.2 <4.0.0": - version "3.5.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" - integrity sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc= - dependencies: - assertion-error "^1.0.1" - deep-eql "^0.1.3" - type-detect "^1.0.0" - chai@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" @@ -10341,13 +10332,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-eql@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" - integrity sha1-71WKyrjeJSBs1xOQbXTlaTDrafI= - dependencies: - type-detect "0.1.1" - deep-eql@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" @@ -10355,7 +10339,7 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" -deep-equal@^1.0.0, deep-equal@^1.1.0: +deep-equal@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== @@ -19241,7 +19225,7 @@ lodash.uniqby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= -lodash@=3.10.1, lodash@^4.13.1, lodash@^4.16.4, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@~4.17.2: +lodash@=3.10.1, lodash@^4.13.1, lodash@^4.16.4, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -20100,7 +20084,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== -mkdirp@0.5.5, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.1: +mkdirp@0.5.5, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -20678,20 +20662,15 @@ no-case@^3.0.3, no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -nock@^9.0.14: - version "9.1.5" - resolved "https://registry.yarnpkg.com/nock/-/nock-9.1.5.tgz#9e4878e0e1c050bdd93ae1e326e89461ea15618b" - integrity sha512-ukkBUhGU73CmSKTpTl6N/Qjvb7Hev4rCEjgOuEBKvHmsOqz7jGh2vUXL3dPnX3ndfcmVjsFBPfKpNuJbK94SKg== +nock@^13.2.9: + version "13.2.9" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.9.tgz#4faf6c28175d36044da4cfa68e33e5a15086ad4c" + integrity sha512-1+XfJNYF1cjGB+TKMWi29eZ0b82QOvQs2YoLNzbpWGqFMtRQHTa57osqdGj4FrFPgkO4D4AZinzUJR9VvW3QUA== dependencies: - chai ">=1.9.2 <4.0.0" - debug "^2.2.0" - deep-equal "^1.0.0" + debug "^4.1.0" json-stringify-safe "^5.0.1" - lodash "~4.17.2" - mkdirp "^0.5.0" - propagate "0.4.0" - qs "^6.5.1" - semver "^5.3.0" + lodash "^4.17.21" + propagate "^2.0.0" node-abi@^2.18.0, node-abi@^2.21.0, node-abi@^2.7.0: version "2.30.1" @@ -23126,10 +23105,10 @@ prop-types@^15.0.0, prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.7, object-assign "^4.1.1" react-is "^16.13.1" -propagate@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/propagate/-/propagate-0.4.0.tgz#f3fcca0a6fe06736a7ba572966069617c130b481" - integrity sha1-8/zKCm/gZzanulcpZgaWF8EwtIE= +propagate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" + integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== proper-lockfile@^4.0.0: version "4.1.1" @@ -27592,21 +27571,11 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" - integrity sha1-C6XsKohWQORw6k6FBZcZANrFiCI= - type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-detect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" - integrity sha1-diIXzAbbJY7EiQihKY6LlRIejqI= - type-fest@^0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" From b11f6c1bf9f021098ae7fed1ae34392c0d565b9c Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Thu, 29 Sep 2022 21:58:37 +0200 Subject: [PATCH 07/17] Changelog for 10.20.0 (#16011) * Run update changelog script * Rinkeby, Ropsten and Kovan deprecation * Fix Changelog lint --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30e7dbb987f6..f4697e9b8193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.20.0] +### Changed +- Deprecate Rinkeby, Ropsten and Kovan test networks and define Goerli as the default network in test mode ([#15989](https://github.com/MetaMask/metamask-extension/pull/15989)) + +### Fixed +- [FLASK] Fix crash when uninstalling snap ([#15799](https://github.com/MetaMask/metamask-extension/pull/15799)) +- [FLASK] Fix crash with certain permissions on the snap settings page ([#15797](https://github.com/MetaMask/metamask-extension/pull/15797)) +- [FLASK] Fix an issue with installing and updating snaps with 0 permissions ([#15796](https://github.com/MetaMask/metamask-extension/pull/15796)) + ## [10.19.0] ### Added - Add ENS wildcard and secure offchain resolution (ENSIP-10 & EIP3668) ([#14675](https://github.com/MetaMask/metamask-extension/pull/14675)) @@ -3189,7 +3198,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.19.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.20.0...HEAD +[10.20.0]: https://github.com/MetaMask/metamask-extension/compare/v10.19.0...v10.20.0 [10.19.0]: https://github.com/MetaMask/metamask-extension/compare/v10.18.4...v10.19.0 [10.18.4]: https://github.com/MetaMask/metamask-extension/compare/v10.18.3...v10.18.4 [10.18.3]: https://github.com/MetaMask/metamask-extension/compare/v10.18.2...v10.18.3 From 6a0dcf41b6be67383d7b1a437985fca1378c0ed5 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Fri, 30 Sep 2022 16:10:01 +0200 Subject: [PATCH 08/17] Fix `@hapi/hoek` audit failure (#16034) --- package.json | 1 + yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index ec8962ecffc2..47ed82802ddf 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "3box/**/libp2p-crypto/node-forge": "^1.3.0", "3box/**/libp2p-keychain/node-forge": "^1.3.0", "3box/ipfs/libp2p-webrtc-star/socket.io/engine.io": "^4.0.0", + "3box/**/@hapi/hoek": "^8.5.1", "analytics-node/axios": "^0.21.2", "ganache-core/lodash": "^4.17.21", "netmask": "^2.0.1", diff --git a/yarn.lock b/yarn.lock index 701ee0bffb97..032905d61a02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2265,15 +2265,10 @@ "@hapi/hoek" "6.x.x" "@hapi/joi" "15.x.x" -"@hapi/hoek@6.x.x", "@hapi/hoek@^6.2.0": - version "6.2.4" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-6.2.4.tgz#4b95fbaccbfba90185690890bdf1a2fbbda10595" - integrity sha512-HOJ20Kc93DkDVvjwHyHawPwPkX44sIrbXazAUDiUXaY2R9JwQGo2PhFfnQtdrsIe4igjG2fPgMra7NYw7qhy0A== - -"@hapi/hoek@8.x.x": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.1.0.tgz#8f7627b23ed9bf67088fc7f9669e48c63ad421bd" - integrity sha512-b1J4jxYnW+n6lC91V6Pqg9imP9BZq0HNCeM+3sbXg05rQsE9cGYrKFpZjyztVesGmNRE6R+QaEoWGATeIiUVjA== +"@hapi/hoek@6.x.x", "@hapi/hoek@8.x.x", "@hapi/hoek@^6.2.0", "@hapi/hoek@^8.5.1": + version "8.5.1" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" + integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== "@hapi/inert@^5.2.0": version "5.2.1" From 300cb6e7c5effbce3f5fb401d1b035552d75c85c Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Fri, 30 Sep 2022 20:00:59 +0530 Subject: [PATCH 09/17] Revert "Fix permissions in MV3 manifest (#15980)" (#16021) This reverts commit 67eb2f9f27ad1c6fb9a02407c7e8b1ab41597f7b. --- app/manifest/v3/_base.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/manifest/v3/_base.json b/app/manifest/v3/_base.json index 59cb72718377..1b9456fd8d93 100644 --- a/app/manifest/v3/_base.json +++ b/app/manifest/v3/_base.json @@ -49,10 +49,9 @@ "description": "__MSG_appDescription__", "host_permissions": [ "http://localhost:8545/", - "https://*.infura.io/", - "https://chainid.network/chains.json", - "https://lattice.gridplus.io/*", - "*://*.eth/" + "file://*/*", + "http://*/*", + "https://*/*" ], "icons": { "16": "images/icon-16.png", From 67aeb645813938a049888cf0d8a078455aaf81cc Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 28 Sep 2022 20:26:01 -0700 Subject: [PATCH 10/17] Deprecating the Rinkeby, Ropsten, and Kovan test networks (#15989) * Deprecating Rinkeby, setting default debug network to Goerli * Deprecating Ropsten and Kovan * Conflict fix * Remove unused localization, test fixes * Add migration for moving used deprecated testnets to custom networks * Fix migrator test * Add more unit tests * Migration updates provider type to rpc if deprecated network is selected * Migration fully and correctly updates the provider if selected network is a deprecated testnet * Continue to show deprecation warning on each of rinkeby, ropsten and kovan * Add rpcUrl deprecation message to loading screen * Removing mayBeFauceting prop Co-authored-by: Dan Miller --- .storybook/initial-states/transactions.js | 66 +- .storybook/test-data.js | 68 +- app/_locales/am/messages.json | 18 - app/_locales/ar/messages.json | 18 - app/_locales/bg/messages.json | 18 - app/_locales/bn/messages.json | 18 - app/_locales/ca/messages.json | 18 - app/_locales/cs/messages.json | 9 - app/_locales/da/messages.json | 18 - app/_locales/de/messages.json | 26 +- app/_locales/el/messages.json | 20 +- app/_locales/en/messages.json | 21 +- app/_locales/es/messages.json | 20 +- app/_locales/es_419/messages.json | 18 - app/_locales/et/messages.json | 18 - app/_locales/fa/messages.json | 18 - app/_locales/fi/messages.json | 18 - app/_locales/fil/messages.json | 9 - app/_locales/fr/messages.json | 20 +- app/_locales/he/messages.json | 15 - app/_locales/hi/messages.json | 20 +- app/_locales/hn/messages.json | 9 - app/_locales/hr/messages.json | 18 - app/_locales/ht/messages.json | 18 - app/_locales/hu/messages.json | 18 - app/_locales/id/messages.json | 20 +- app/_locales/it/messages.json | 18 - app/_locales/ja/messages.json | 20 +- app/_locales/kn/messages.json | 18 - app/_locales/ko/messages.json | 20 +- app/_locales/lt/messages.json | 18 - app/_locales/lv/messages.json | 18 - app/_locales/ms/messages.json | 18 - app/_locales/nl/messages.json | 9 - app/_locales/no/messages.json | 15 - app/_locales/ph/messages.json | 18 - app/_locales/pl/messages.json | 18 - app/_locales/pt/messages.json | 20 +- app/_locales/pt_BR/messages.json | 18 - app/_locales/ro/messages.json | 18 - app/_locales/ru/messages.json | 20 +- app/_locales/sk/messages.json | 9 - app/_locales/sl/messages.json | 18 - app/_locales/sr/messages.json | 18 - app/_locales/sv/messages.json | 18 - app/_locales/sw/messages.json | 18 - app/_locales/ta/messages.json | 18 - app/_locales/th/messages.json | 12 - app/_locales/tl/messages.json | 20 +- app/_locales/tr/messages.json | 20 +- app/_locales/uk/messages.json | 18 - app/_locales/vi/messages.json | 20 +- app/_locales/zh/messages.json | 18 - app/_locales/zh_CN/messages.json | 19 +- app/_locales/zh_TW/messages.json | 18 - app/scripts/constants/contracts.js | 6 - app/scripts/controllers/app-state.js | 3 - .../controllers/cached-balances.test.js | 18 +- app/scripts/controllers/detect-tokens.test.js | 10 +- app/scripts/controllers/ens/index.test.js | 2 +- .../controllers/incoming-transactions.js | 9 - .../controllers/incoming-transactions.test.js | 148 ++- app/scripts/controllers/metametrics.test.js | 24 +- .../network/network-controller.test.js | 36 - app/scripts/controllers/network/network.js | 10 +- .../network/pending-middleware.test.js | 2 +- app/scripts/controllers/network/util.test.js | 8 +- app/scripts/controllers/swaps.test.js | 6 +- .../controllers/transactions/index.test.js | 36 +- .../transactions/tx-gas-utils.test.js | 6 +- .../transactions/tx-state-manager.test.js | 11 +- app/scripts/lib/account-tracker.js | 27 - app/scripts/lib/buy-url.js | 13 - app/scripts/lib/buy-url.test.js | 27 - app/scripts/lib/ens-ipfs/resolver.js | 2 +- app/scripts/metamask-controller.js | 1 - app/scripts/metamask-controller.test.js | 2 +- app/scripts/migrations/052.js | 39 +- app/scripts/migrations/052.test.js | 60 +- app/scripts/migrations/054.test.js | 21 +- app/scripts/migrations/055.js | 18 + app/scripts/migrations/055.test.js | 18 +- app/scripts/migrations/059.test.js | 16 +- app/scripts/migrations/074.js | 132 +++ app/scripts/migrations/074.test.js | 561 +++++++++++ app/scripts/migrations/index.js | 2 + app/scripts/migrations/migrations.test.js | 5 - development/states/navigate-txs.json | 7 +- shared/constants/network.ts | 930 ++++++++++++++++++ test/data/mock-pending-transaction-data.json | 24 +- test/data/mock-state.json | 9 +- test/data/mock-tx-history.json | 342 +++---- test/data/transaction-data.json | 18 +- test/e2e/fixtures/address-entry/state.json | 8 +- test/e2e/fixtures/connected-state/state.json | 6 +- test/e2e/fixtures/custom-rpc/state.json | 8 +- test/e2e/fixtures/custom-token/state.json | 11 +- test/e2e/fixtures/eip-1559-v2-dapp/state.json | 8 +- test/e2e/fixtures/eip-1559-v2/state.json | 8 +- test/e2e/fixtures/imported-account/state.json | 8 +- test/e2e/fixtures/localization/state.json | 8 +- test/e2e/fixtures/metrics-enabled/state.json | 6 +- .../fixtures/navigate-transactions/state.json | 8 +- test/e2e/fixtures/send-edit-v2/state.json | 8 +- test/e2e/fixtures/send-edit/state.json | 8 +- test/e2e/fixtures/special-settings/state.json | 8 +- test/e2e/fixtures/threebox-enabled/state.json | 9 +- test/e2e/mock-e2e.js | 3 - test/stub/tx-meta-stub.js | 8 +- test/test-results/junit.xml | 23 + .../unconnected-account-alert.test.js | 5 +- .../collectible-details.js | 6 - .../collectibles-tab/collectibles-tab.test.js | 2 +- ...m-page-container-content.component.test.js | 6 +- .../app/dropdowns/network-dropdown.js | 9 - .../app/dropdowns/network-dropdown.test.js | 22 +- .../import-token-link.test.js.snap | 4 +- .../import-token-link.test.js | 8 +- .../loading-network-screen.component.js | 49 +- .../loading-network-screen.container.js | 9 + ui/components/app/menu-bar/menu-bar.test.js | 4 +- .../network-display.stories.js | 2 +- .../transaction-activity-log.util.test.js | 56 +- .../avatar-network/avatar-network.stories.js | 21 - .../avatar-token/avatar-token.stories.js | 21 - .../base-avatar/base-avatar.stories.js | 23 - ui/css/design-system/colors.scss | 3 - ui/css/itcss/components/network.scss | 12 - ui/css/utilities/colors.scss | 3 - .../confirm-transaction.duck.test.js | 12 +- ui/ducks/metamask/metamask.test.js | 18 +- ui/ducks/send/send.test.js | 40 +- ui/ducks/swaps/swaps.test.js | 3 +- ui/helpers/constants/design-system.js | 9 - ui/helpers/constants/settings.js | 21 - ui/helpers/utils/settings-search.test.js | 8 +- ui/helpers/utils/util.js | 6 - ui/hooks/useAddressDetails.test.js | 6 +- ui/hooks/useAssetDetails.test.js | 2 +- ui/hooks/useCurrencyDisplay.js | 2 +- .../transaction-alerts.test.js | 6 +- ui/pages/routes/routes.component.js | 6 - ui/pages/send/send.test.js | 8 +- .../custom-content-search.test.js | 4 +- .../networks-list-item.test.js | 8 +- .../networks-list/networks-list.test.js | 9 +- .../networks-tab-content.test.js | 3 - .../networks-tab/networks-tab.constants.js | 33 - .../networks-tab/networks-tab.test.js | 3 - ui/pages/swaps/fee-card/fee-card.js | 3 +- ui/pages/swaps/swaps.util.js | 11 +- ui/pages/swaps/swaps.util.test.js | 31 +- ui/selectors/confirm-transaction.test.js | 13 +- ui/selectors/permissions.test.js | 4 +- ui/selectors/selectors.test.js | 2 +- ui/selectors/transactions.test.js | 11 +- ui/store/actions.test.js | 2 +- 157 files changed, 2393 insertions(+), 1978 deletions(-) create mode 100644 app/scripts/migrations/074.js create mode 100644 app/scripts/migrations/074.test.js create mode 100644 shared/constants/network.ts create mode 100644 test/test-results/junit.xml diff --git a/.storybook/initial-states/transactions.js b/.storybook/initial-states/transactions.js index 34b848712231..fefafefc4bf5 100644 --- a/.storybook/initial-states/transactions.js +++ b/.storybook/initial-states/transactions.js @@ -24,10 +24,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 643368596521636, time: 1653527035634, status: 'submitted', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '5208', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: null, sendFlowHistory: [], @@ -50,10 +50,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 643368596521636, time: 1653527035634, status: 'approved', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '5208', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: null, sendFlowHistory: [], @@ -204,7 +204,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { submittedTime: 1653527035924, }, [MOCK_TX_TYPE.CONTRACT_INTERACTION]: { - chainId: '0x4', + chainId: '0x5', dappSuggestedGasFees: { gas: '0x118f4', maxFeePerGas: '0x9502f91a', @@ -212,7 +212,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { }, id: 7694052085150913, loadingDefaults: true, - metamaskNetworkId: '4', + metamaskNetworkId: '5', origin: 'https://remix.ethereum.org', originalGasEstimate: '0x118f4', sendFlowHistory: [], @@ -235,7 +235,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { [MOCK_TX_TYPE.DEPLOY_CONTRACT]: { blockNumber: '6195527', id: 4243712234858468, - metamaskNetworkId: '4', + metamaskNetworkId: '5', status: 'confirmed', time: 1585088013000, txParams: { @@ -292,7 +292,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { [MOCK_TX_TYPE.INCOMING]: { blockNumber: '6477257', id: 4243712234858505, - metamaskNetworkId: '4', + metamaskNetworkId: '5', status: 'confirmed', time: 1589314295000, txParams: { @@ -346,10 +346,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 3938342322880462, time: 1653459456297, status: 'failed', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '14609', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: null, sendFlowHistory: [], @@ -376,10 +376,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 3938342322880462, time: 1653459456297, status: 'approved', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '14609', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: null, sendFlowHistory: [], @@ -589,7 +589,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 4243712234858512, time: 1589314601567, status: 'confirmed', - metamaskNetworkId: '4', + metamaskNetworkId: '5', loadingDefaults: false, txParams: { from: '0xabca64466f257793eaa52fcfff5066894b76a149', @@ -605,7 +605,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { [MOCK_TX_TYPE.SMART]: { blockNumber: '6195527', id: 4243712234858468, - metamaskNetworkId: '4', + metamaskNetworkId: '5', status: 'confirmed', time: 1585088013000, txParams: { @@ -625,7 +625,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { [MOCK_TX_TYPE.SWAP]: { blockNumber: '6195527', id: 4243712234858467, - metamaskNetworkId: '4', + metamaskNetworkId: '5', status: 'confirmed', time: 1585088013000, txParams: { @@ -644,7 +644,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { [MOCK_TX_TYPE.SWAP_APPROVAL]: { blockNumber: '6195527', id: 4243712234858467, - metamaskNetworkId: '4', + metamaskNetworkId: '5', status: 'confirmed', time: 1585088013000, txParams: { @@ -664,10 +664,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 5177046356058729, time: 1653457101080, status: 'submitted', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '0xb427', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: { gasPrice: '0x4a817c800', @@ -692,10 +692,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 5177046356058729, time: 1653457101080, status: 'unapproved', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '0xb427', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: true, dappSuggestedGasFees: { gasPrice: '0x4a817c800', @@ -918,10 +918,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 1441203963845330, time: 1652206763566, status: 'confirmed', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '0x118e0', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: { maxPriorityFeePerGas: '0x3B9ACA00', @@ -939,7 +939,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { maxFeePerGas: '0x7be830aec', maxPriorityFeePerGas: '0x3B9ACA00', }, - origin: 'https://rinkeby.etherscan.io', + origin: 'https://goerli.etherscan.io', type: 'safetransferfrom', userFeeLevel: 'dappSuggested', defaultGasEstimates: { @@ -1042,10 +1042,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 5177046356058725, time: 1653457077370, status: 'confirmed', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '0xea60', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: { gasPrice: '0x4a817c800', @@ -1055,7 +1055,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { txParams: { from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', - nonce: '0x4', + nonce: '0x5', value: '0x0', data: '0xa9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98', @@ -1070,10 +1070,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 5177046356058725, time: 1653457077370, status: 'unapproved', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '0xea60', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: true, dappSuggestedGasFees: { gasPrice: '0x4a817c800', @@ -1152,7 +1152,7 @@ export const MOCK_TRANSACTION_BY_TYPE = { { op: 'add', path: '/txParams/nonce', - value: '0x4', + value: '0x5', note: 'transactions#approveTransaction', timestamp: 1653457091939, }, @@ -1446,10 +1446,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 5177046356058754, time: 1653457323504, status: 'confirmed', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '0x10896', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: false, dappSuggestedGasFees: null, sendFlowHistory: [ @@ -1496,10 +1496,10 @@ export const MOCK_TRANSACTION_BY_TYPE = { id: 5177046356058754, time: 1653457323504, status: 'unapproved', - metamaskNetworkId: '4', + metamaskNetworkId: '5', originalGasEstimate: '0x10896', userEditedGasLimit: false, - chainId: '0x4', + chainId: '0x5', loadingDefaults: true, dappSuggestedGasFees: null, sendFlowHistory: [ diff --git a/.storybook/test-data.js b/.storybook/test-data.js index e087b6990241..1a2b4b9a67c2 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -26,28 +26,6 @@ const state = { ticker: 'ETH', viewOnly: true, }, - { - blockExplorerUrl: 'https://ropsten.etherscan.io', - chainId: '0x3', - iconColor: 'var(--ropsten)', - isATestNetwork: true, - labelKey: 'ropsten', - providerType: 'ropsten', - rpcUrl: 'https://ropsten.infura.io/v3/', - ticker: 'ETH', - viewOnly: true, - }, - { - blockExplorerUrl: 'https://rinkeby.etherscan.io', - chainId: '0x4', - iconColor: 'var(--rinkeby)', - isATestNetwork: true, - labelKey: 'rinkeby', - providerType: 'rinkeby', - rpcUrl: 'https://rinkeby.infura.io/v3/', - ticker: 'ETH', - viewOnly: true, - }, { blockExplorerUrl: 'https://goerli.etherscan.io', chainId: '0x5', @@ -59,17 +37,6 @@ const state = { ticker: 'ETH', viewOnly: true, }, - { - blockExplorerUrl: 'https://kovan.etherscan.io', - chainId: '0x2a', - iconColor: 'var(--kovan)', - isATestNetwork: true, - labelKey: 'kovan', - providerType: 'kovan', - rpcUrl: 'https://kovan.infura.io/v3/', - ticker: 'ETH', - viewOnly: true, - }, { blockExplorerUrl: 'https://sepolia.etherscan.io', chainId: '0xaa36a7', @@ -406,9 +373,9 @@ const state = { id: 3111025347726181, time: 1620710815484, status: 'unapproved', - metamaskNetworkId: '3', + metamaskNetworkId: '5', msgParams: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', - chainId: '0x3', + chainId: '0x5', loadingDefaults: false, txParams: { from: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', @@ -427,8 +394,8 @@ const state = { id: 7786962153682822, time: 1620710815484, status: 'unapproved', - metamaskNetworkId: '3', - chainId: '0x3', + metamaskNetworkId: '5', + chainId: '0x5', loadingDefaults: true, txParams: { from: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', @@ -581,20 +548,20 @@ const state = { swapsWelcomeMessageHasBeenShown: true, defaultHomeActiveTabName: 'Assets', provider: { - type: 'rinkeby', + type: 'goerli', ticker: 'ETH', nickname: '', rpcUrl: '', - chainId: '0x4', + chainId: '0x5', }, previousProviderStore: { - type: 'rinkeby', + type: 'goerli', ticker: 'ETH', nickname: '', rpcUrl: '', - chainId: '0x4', + chainId: '0x5', }, - network: '3', + network: '5', accounts: { '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': { address: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', @@ -1132,7 +1099,7 @@ const state = { '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e': '0x2d3142f5000', '0x9d0ba4ddac06032527b140912ec808ab9451b788': '0x15f6f0b9d4f8d000', }, - '0x3': { + 5: { '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': '0x176e5b6f173ebe66', '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e': '0x2d3142f5000', '0x9d0ba4ddac06032527b140912ec808ab9451b788': '0x15f6f0b9d4f8d000', @@ -1196,7 +1163,7 @@ const state = { decimals: 18, }, ], - '0x3': [ + '0x5': [ { address: '0xaD6D458402F60fD3Bd25163575031ACDce07538D', symbol: 'DAI', @@ -1209,7 +1176,7 @@ const state = { }, accountHiddenTokens: { '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': { - '0x3': [], + '0x5': [], }, }, assetImages: { @@ -1317,9 +1284,6 @@ const state = { }, }, incomingTxLastFetchedBlocksByNetwork: { - ropsten: 8872820, - rinkeby: null, - kovan: null, goerli: null, sepolia: null, mainnet: 10902989, @@ -1549,8 +1513,8 @@ const state = { id: 3111025347726181, time: 1620723786838, status: 'unapproved', - metamaskNetworkId: '3', - chainId: '0x3', + metamaskNetworkId: '5', + chainId: '0x5', loadingDefaults: false, txParams: { from: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', @@ -1569,8 +1533,8 @@ const state = { id: 3111025347726181, time: 1620723786838, status: 'unapproved', - metamaskNetworkId: '3', - chainId: '0x3', + metamaskNetworkId: '5', + chainId: '0x5', loadingDefaults: true, txParams: { from: '0x983211ce699ea5ab57cc528086154b6db1ad8e55', diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index 6a3d69bc2d0f..7c32af9f3adf 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -187,18 +187,9 @@ "connectingToGoerli": { "message": "ከ Goerli የሙከራ አውታረ መረብ ጋር መገናኘት" }, - "connectingToKovan": { - "message": "ከ Kovan የሙከራ አውታረ መረብ መገናኘት" - }, "connectingToMainnet": { "message": "ከዋናው የ Ethereum አውታረ መረብ ጋር መገናኘት" }, - "connectingToRinkeby": { - "message": "ከ Rinkeby የሙከራ አውታረ መረብ ጋር በመገናኘት ላይ" - }, - "connectingToRopsten": { - "message": "ከ Ropsten የሙከራ አውታረ መረብ ጋር በመገናኘት ላይ" - }, "continueToWyre": { "message": "ወደ Wyre ይቀጥሉ" }, @@ -494,9 +485,6 @@ "knownAddressRecipient": { "message": "የሚታወቅ የግንኙነት አድራሻ።" }, - "kovan": { - "message": "Kovan የሙከራ አውታረ መረብ" - }, "learnMore": { "message": "የበለጠ ይወቁ" }, @@ -753,12 +741,6 @@ "revealSeedWordsWarningTitle": { "message": "ይህን ሐረግ ለየትኛውም ሰው አያጋሩ!" }, - "rinkeby": { - "message": "Rinkeby የሙከራ አውታረ መረብ" - }, - "ropsten": { - "message": "Ropsten የሙከራ አውታረ መረብ " - }, "rpcUrl": { "message": "አዲስ የ RPC URL" }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 6d99fc54b78a..6e3448582ae4 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -201,18 +201,9 @@ "connectingToGoerli": { "message": "الاتصال بشبكة اختبار Goerli" }, - "connectingToKovan": { - "message": "الاتصال بشبكة اختبار Kovan" - }, "connectingToMainnet": { "message": "جارِ الاتصال بشبكة إيثيريوم الرئيسية" }, - "connectingToRinkeby": { - "message": "جارِ الاتصال بشبكة اختبار Rinkeby " - }, - "connectingToRopsten": { - "message": "جارِ الاتصال بشبكة اختبار Ropsten " - }, "continueToWyre": { "message": "الاستمرار إلى Wyre" }, @@ -507,9 +498,6 @@ "knownAddressRecipient": { "message": "عنوان العقد المعروف." }, - "kovan": { - "message": "شبكة اختبار Kovan " - }, "learnMore": { "message": "اكتشف المزيد" }, @@ -769,12 +757,6 @@ "revealSeedWordsWarningTitle": { "message": "لا تشارك هذه الجملة مع أي شخص آخر!" }, - "rinkeby": { - "message": "شبكة اختبارات Rinkeby" - }, - "ropsten": { - "message": "شبكة اختبار Ropsten" - }, "rpcUrl": { "message": "عنوان جديد لاستدعاء الإجراء عن بعد" }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 49b76836583e..8bb45fa464d5 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Свързване с тестова мрежа на Goerli" }, - "connectingToKovan": { - "message": "Свързване с тестовата мрежа на Kovan" - }, "connectingToMainnet": { "message": "Свързване с главната мрежа Ethereum" }, - "connectingToRinkeby": { - "message": "Свързване с тестова мрежа на Rinkeby" - }, - "connectingToRopsten": { - "message": "Свързване с тестова мрежа Ropsten" - }, "continueToWyre": { "message": "Продължете към Wyre" }, @@ -499,9 +490,6 @@ "knownAddressRecipient": { "message": "Известен адрес на договора." }, - "kovan": { - "message": "Тестова мрежа на Кован" - }, "learnMore": { "message": "Научете повече" }, @@ -764,12 +752,6 @@ "revealSeedWordsWarningTitle": { "message": "НЕ споделяйте тази фраза с никого!" }, - "rinkeby": { - "message": "Тестова мрежа на Rinkeby" - }, - "ropsten": { - "message": "Тестова мрежа Ropsten" - }, "rpcUrl": { "message": "Нов URL адрес за RPC" }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 88fedac63b1f..93f39489f766 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "গোয়েরলি টেস্ট নেটওয়ার্কের সাথে সংযোগ করা হচ্ছে" }, - "connectingToKovan": { - "message": "কোভান টেস্ট নেটওয়ার্কের সাথে সংযোগ করছে" - }, "connectingToMainnet": { "message": "মুখ্য Ethereum নেটওয়ার্কের সাথে সংযোগ করছে" }, - "connectingToRinkeby": { - "message": "রিঙ্কেবি টেস্ট নেটওয়ার্কের সাথে সংযোগ করছে" - }, - "connectingToRopsten": { - "message": "রপস্টেন টেস্ট নেটওয়ার্কের সাথে সংযোগ করছে" - }, "continueToWyre": { "message": "Wyre এ অবিরত রাখুন" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "জানা পরিচিতির ঠিকানা৷" }, - "kovan": { - "message": "কোভান টেস্ট নেটওয়ার্ক" - }, "learnMore": { "message": "আরও জানুন" }, @@ -768,12 +756,6 @@ "revealSeedWordsWarningTitle": { "message": "এই ফ্রেজটি কারোর সাথে শেয়ার করবেন না!" }, - "rinkeby": { - "message": "রিঙ্কেবি টেস্ট নেটওয়ার্ক" - }, - "ropsten": { - "message": "রোপস্টেন টেস্ট নেটওয়ার্ক" - }, "rpcUrl": { "message": "নতুন RPC URL" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 3bdaf93ba630..1fd13163dc44 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -190,18 +190,9 @@ "connectingToGoerli": { "message": "Connectant a Xarxa de Prova Goerli" }, - "connectingToKovan": { - "message": "Conectant a la xarxa de Kovan Test" - }, "connectingToMainnet": { "message": "Connectant a Xarxa Principal Ethereum" }, - "connectingToRinkeby": { - "message": "Connectant a la Xarxa de Prova Rinkeby" - }, - "connectingToRopsten": { - "message": "Connectant a la xarxa de test Ropsten" - }, "continueToWyre": { "message": "Continua a Wyre" }, @@ -490,9 +481,6 @@ "knownAddressRecipient": { "message": "Adreça de contracte coneguda" }, - "kovan": { - "message": "Xarxa de Prova Kovan" - }, "learnMore": { "message": "Saber més" }, @@ -746,12 +734,6 @@ "revealSeedWordsWarningTitle": { "message": "NO comparteixis aquesta frase amb ningú!" }, - "rinkeby": { - "message": "Xarxa del test Rinkeby" - }, - "ropsten": { - "message": "Xarxa de Prova Ropsten" - }, "rpcUrl": { "message": "Nova URL de RPC" }, diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index 51ec1eac69d1..9bd3572581c6 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -63,18 +63,9 @@ "confirmed": { "message": "Potvrzeno" }, - "connectingToKovan": { - "message": "Připojuji se k Kovan Test Network" - }, "connectingToMainnet": { "message": "Připojuji se k Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": "Připojuji se k Rinkeby Test Network" - }, - "connectingToRopsten": { - "message": "Připojuji se k Ropsten Test Network" - }, "contractDeployment": { "message": "Nasazení kontraktu" }, diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index 4b642ef37499..36fcda696fe3 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Opretter forbindelse til Goerli Testnetværk" }, - "connectingToKovan": { - "message": "Forbinder til Kovan Testnetværk" - }, "connectingToMainnet": { "message": "Forbinder til dit Primære Ethereum Netværk" }, - "connectingToRinkeby": { - "message": "Forbinder til Rinkeby-testnetværk" - }, - "connectingToRopsten": { - "message": "Forbinder til Ropsten-testnetværk" - }, "continueToWyre": { "message": "Fortsæt til Wyre" }, @@ -496,9 +487,6 @@ "knownAddressRecipient": { "message": "Kendte kontaktadresser." }, - "kovan": { - "message": "Kovan Test-Netværk" - }, "learnMore": { "message": "Lær mere" }, @@ -749,12 +737,6 @@ "revealSeedWordsWarningTitle": { "message": "DEL IKKE denne sætning med nogen!" }, - "rinkeby": { - "message": "Rinkeby-testnetværk" - }, - "ropsten": { - "message": "Ropsten Test-netværk" - }, "rpcUrl": { "message": "Ny RPC-URL" }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index d78a3f854400..aedf873245bd 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -608,17 +608,11 @@ "connectingToGoerli": { "message": "Verbindung mit Goerli Test Network wird hergestellt" }, - "connectingToKovan": { - "message": " Verbinde zum Kovan Testnetzwerk" - }, "connectingToMainnet": { "message": "Verbinde zum Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": " Verbinde zum Rinkeby Testnetzwerk" - }, - "connectingToRopsten": { - "message": " Verbinde zum Ropsten Testnetzwerk" + "connectingToSepolia": { + "message": "Verbindungsaufbau zum Sepolia-Testnetzwerk" }, "contactUs": { "message": "Kontaktaufnahme" @@ -1652,9 +1646,6 @@ "knownTokenWarning": { "message": "Mit dieser Aktion werden Token bearbeitet, die bereits in Ihrer Wallet aufgelistet sind und die dazu verwendet werden können, Sie zu betrügen. Genehmigen Sie diese Aktion nur, wenn Sie sicher sind, dass Sie den Wert dieser Token ändern wollen. Erfahren Sie mehr über $1" }, - "kovan": { - "message": "Kovan Testnetzwerk" - }, "lastConnected": { "message": "Zuletzt verbunden" }, @@ -2679,11 +2670,16 @@ "revealTheSeedPhrase": { "message": "Seed-Phrase anzeigen" }, - "rinkeby": { - "message": "Rinkeby Testnetzwerk" + "revokeAllTokensTitle": { + "message": "Erlaubnis zum Zugriff auf alle Ihre $1 entziehen?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "Wenn Sie diese Erlaubnis entziehen, wird folgende/s/r $1 nicht mehr dazu in der Lage sein, auf Ihr/e/n $2 zuzugreifen.", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "ropsten": { - "message": "Ropsten Testnetzwerk" + "revokeSpendingCapTooltipText": { + "message": "Mit diesem Contract können Sie keine weiteren Ihrer aktuellen oder zukünftigen Token ausgeben." }, "rpcUrl": { "message": "Neue RPC-URL" diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index e844d02b32b2..1338302e8214 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Σύνδεση στο Δίκτυο Δοκιμής Goerli" }, - "connectingToKovan": { - "message": "Σύνδεση στο Δοκιμαστικό Δίκτυο Kovan" - }, "connectingToMainnet": { "message": "Σύνδεση στο Κύριο Δίκτυο Ethereum" }, - "connectingToRinkeby": { - "message": "Σύνδεση στο Δίκτυο Δοκιμών Rinkeby" - }, - "connectingToRopsten": { - "message": "Σύνδεση με το Δίκτυο Δοκιμών Ropsten" + "connectingToSepolia": { + "message": "Σύνδεση στο δίκτυο δοκιμών Sepolia" }, "contactUs": { "message": "Επικοινωνήστε μαζί μας" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Αυτή η ενέργεια θα επεξεργαστεί tokens που είναι ήδη εισηγμένα στο πορτοφόλι σας, τα οποίαο μπορεί να χρησιμοποιηθούν για να σας κλέψουν στοιχεία. Αποδεχθείτε μόνο αν είστε σίγουροι ότι θέλετε να αλλάξετε αυτό που αντιπροσωπεύουν αυτά τα νομίσματα. Μάθετε περισσότερά γι'αυτό $1" }, - "kovan": { - "message": "Δίκτυο Δοκιμής Kovan" - }, "lastConnected": { "message": "Τελευταία Σύνδεση" }, @@ -2724,11 +2715,8 @@ "message": "Με την ανάκληση της άδειας, το ακόλουθο $1 δεν θα έχει πλέον πρόσβαση στο $2 σας", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Δοκιμαστικό Δίκτυο Rinkeby" - }, - "ropsten": { - "message": "Δίκτυο Δοκιμών Ropsten" + "revokeSpendingCapTooltipText": { + "message": "Αυτός ο συμβαλλόμενος δεν θα μπορεί να ξοδέψει άλλα από τα τρέχοντα ή μελλοντικά σας tokens." }, "rpcUrl": { "message": "Νέο RPC URL" diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index e8852f869cab..440596606bb4 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -704,18 +704,9 @@ "connectingToGoerli": { "message": "Connecting to Goerli test network" }, - "connectingToKovan": { - "message": "Connecting to Kovan test network" - }, "connectingToMainnet": { "message": "Connecting to Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": "Connecting to Rinkeby test network" - }, - "connectingToRopsten": { - "message": "Connecting to Ropsten test network" - }, "connectingToSepolia": { "message": "Connecting to Sepolia test network" }, @@ -824,6 +815,9 @@ "currentLanguage": { "message": "Current language" }, + "currentRpcUrlDeprecated": { + "message": "The current rpc url for this network has been deprecated." + }, "currentTitle": { "message": "Current:" }, @@ -1808,9 +1802,6 @@ "knownTokenWarning": { "message": "This action will edit tokens that are already listed in your wallet, which can be used to phish you. Only approve if you are certain that you mean to change what these tokens represent. Learn more about $1" }, - "kovan": { - "message": "Kovan test network" - }, "lastConnected": { "message": "Last connected" }, @@ -2928,12 +2919,6 @@ "revokeSpendingCapTooltipText": { "message": "This contract will be unable to spend any more of your current or future tokens." }, - "rinkeby": { - "message": "Rinkeby test network" - }, - "ropsten": { - "message": "Ropsten test network" - }, "rpcUrl": { "message": "New RPC URL" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 541bbf579e1d..b76062521ecf 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Estableciendo conexión a la red de prueba Goerli" }, - "connectingToKovan": { - "message": "Estableciendo conexión a la red de prueba Kovan" - }, "connectingToMainnet": { "message": "Estableciendo conexión a la red principal de Ethereum" }, - "connectingToRinkeby": { - "message": "Estableciendo conexión a la red de prueba Rinkeby" - }, - "connectingToRopsten": { - "message": "Estableciendo conexión a la red de prueba Ropsten" + "connectingToSepolia": { + "message": "Conectando a la red de prueba Sepolia" }, "contactUs": { "message": "Contáctenos" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Esta acción editará tokens que ya estén enumerados en la cartera y que se pueden usar para engañarlo. Apruebe solo si está seguro de que quiere cambiar lo que representan estos tokens." }, - "kovan": { - "message": "Red de prueba Kovan" - }, "lastConnected": { "message": "Última conexión" }, @@ -2724,11 +2715,8 @@ "message": "Al revocar permisos, el/la siguiente $1 no tendrá más acceso a su $2", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Red de prueba Rinkeby" - }, - "ropsten": { - "message": "Red de prueba Ropsten" + "revokeSpendingCapTooltipText": { + "message": "Este contrato no podrá gastar más de sus tokens actuales o futuros." }, "rpcUrl": { "message": "Nueva dirección URL de RPC" diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index e3a617fbebd3..88dcc4c3c4e9 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -514,18 +514,9 @@ "connectingToGoerli": { "message": "Estableciendo conexión a la red de prueba Goerli" }, - "connectingToKovan": { - "message": "Estableciendo conexión a la red de prueba Kovan" - }, "connectingToMainnet": { "message": "Estableciendo conexión a la red principal de Ethereum" }, - "connectingToRinkeby": { - "message": "Estableciendo conexión a la red de prueba Rinkeby" - }, - "connectingToRopsten": { - "message": "Estableciendo conexión a la red de prueba Ropsten" - }, "contactUs": { "message": "Contáctenos" }, @@ -1425,9 +1416,6 @@ "knownTokenWarning": { "message": "Esta acción editará tokens que ya estén enumerados en la cartera y que se pueden usar para engañarlo. Apruebe solo si está seguro de que quiere cambiar lo que representan estos tokens." }, - "kovan": { - "message": "Red de prueba Kovan" - }, "lastConnected": { "message": "Última conexión" }, @@ -2248,12 +2236,6 @@ "revealSeedWordsWarningTitle": { "message": "¡NO comparta esta frase con nadie!" }, - "rinkeby": { - "message": "Red de prueba Rinkeby" - }, - "ropsten": { - "message": "Red de prueba Ropsten" - }, "rpcUrl": { "message": "Nueva dirección URL de RPC" }, diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 1b1a3872061c..9fda9b49fe68 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Ühendamine Goerli testvõrguga" }, - "connectingToKovan": { - "message": "Ühendamine Kovani testvõrguga" - }, "connectingToMainnet": { "message": "Ühenduse loomine peamise Etherumi võrguga" }, - "connectingToRinkeby": { - "message": "Ühendamine Rinkeby testvõrguga" - }, - "connectingToRopsten": { - "message": "Ühendamine Ropsteni testvõrguga" - }, "continueToWyre": { "message": "Ava Wyre" }, @@ -499,9 +490,6 @@ "knownAddressRecipient": { "message": "Teadaolev lepinguaadress." }, - "kovan": { - "message": "Kovani testvõrk" - }, "learnMore": { "message": "Lisateave" }, @@ -758,12 +746,6 @@ "revealSeedWordsWarningTitle": { "message": "ÄRGE jagage seda fraasi mitte kellegagi!" }, - "rinkeby": { - "message": "Rinkeby katsevõrk" - }, - "ropsten": { - "message": "Ropsteni testvõrk" - }, "rpcUrl": { "message": "Uus RPC URL" }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index ab74d3482c0d..cf7d86087a3b 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "در حال اتصال به شبکه آزمایشی Goerli " }, - "connectingToKovan": { - "message": "در حال اتصال به شبکه آزمایشی Kovan" - }, "connectingToMainnet": { "message": "در حال اتصال به شبکه اصلی ایتریم" }, - "connectingToRinkeby": { - "message": "در حال اتصال به شبکه آزمایشی Rinkeby" - }, - "connectingToRopsten": { - "message": "در حال اتصال به شبکه آزمایشی Ropsten" - }, "continueToWyre": { "message": "ادامه به Wyre" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "آدرس شناخته شده قرارداد" }, - "kovan": { - "message": "شبکه آزمایشی Kovan" - }, "learnMore": { "message": "بیشتر بدانید" }, @@ -768,12 +756,6 @@ "revealSeedWordsWarningTitle": { "message": "این عبارت را با هیچکس شریک نسازید!" }, - "rinkeby": { - "message": "شبکه آزمایشی Rinkeby" - }, - "ropsten": { - "message": "شبکه آزمایشی Ropsten" - }, "rpcUrl": { "message": "RPC URL جدید" }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 496475976a3b..737090e1b8cd 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Yhdistetään Goerlin testiverkostoon" }, - "connectingToKovan": { - "message": "Yhdistetään Kovanin koeverkkoon" - }, "connectingToMainnet": { "message": "Yhdistetään Ethereumin pääverkkoon" }, - "connectingToRinkeby": { - "message": "Yhdistetään Rinkebyn koeverkkoon" - }, - "connectingToRopsten": { - "message": "Yhdistetään Ropstenin koeverkkoon" - }, "continueToWyre": { "message": "Jatka Wyreen" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "Tunnettu sopimusosoite." }, - "kovan": { - "message": "Kovanin koeverkko" - }, "learnMore": { "message": "Lisätietoa" }, @@ -765,12 +753,6 @@ "revealSeedWordsWarningTitle": { "message": "ÄLÄ jaa tätä tekstiä kenellekään!" }, - "rinkeby": { - "message": "Rinkebyn koeverkko" - }, - "ropsten": { - "message": "Ropstenin koeverkko" - }, "rpcUrl": { "message": "Uusi RPC:n URL" }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 6ed19fecdfa0..189d431e9a38 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -172,18 +172,9 @@ "connectingToGoerli": { "message": "Kumokonekta sa Goerli Test Network" }, - "connectingToKovan": { - "message": "Kumokonekta sa Kovan Test Network" - }, "connectingToMainnet": { "message": "Kumokonekta sa Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": "Kumokonekta sa Rinkeby Test Network" - }, - "connectingToRopsten": { - "message": "Kumokonekta sa Ropsten Test Network" - }, "continueToWyre": { "message": "Magpatuloy sa Wyre" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 43c53f4d7c3d..9410d6ef7110 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Connexion au réseau de test Goerli" }, - "connectingToKovan": { - "message": "Connexion au réseau de test Kovan" - }, "connectingToMainnet": { "message": "Connexion au réseau principal Ethereum" }, - "connectingToRinkeby": { - "message": "Connexion au réseau de test Rinkeby" - }, - "connectingToRopsten": { - "message": "Connexion au réseau de test Ropsten" + "connectingToSepolia": { + "message": "Connexion au réseau de test Sepolia" }, "contactUs": { "message": "Nous contacter" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Cette action modifiera les jetons déjà présents dans votre portefeuille, et risque de favoriser les tentatives d’hameçonnage. N’approuvez que si vous êtes certain·e de vouloir modifier ce que ces jetons représentent. En savoir plus sur $1" }, - "kovan": { - "message": "Réseau de test Kovan" - }, "lastConnected": { "message": "Dernière connexion" }, @@ -2724,11 +2715,8 @@ "message": "En révoquant cette autorisation, les $1 suivants ne pourront plus accéder à vos $2. ", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Réseau de test Rinkeby" - }, - "ropsten": { - "message": "Réseau de test Ropsten" + "revokeSpendingCapTooltipText": { + "message": "L’autre partie à ce contrat ne pourra plus dépenser vos jetons actuels ou futurs." }, "rpcUrl": { "message": "Nouvelle URL de RPC" diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 9bfd09d99abe..94c229408456 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "מתחבר ל-Goerli Test Network" }, - "connectingToKovan": { - "message": "מתחבר ל-Kovan Test Network" - }, "connectingToMainnet": { "message": "מתחבר לרשת אתריום הראשית" }, - "connectingToRinkeby": { - "message": "מתחבר ל- Rinkeby Test Network " - }, - "connectingToRopsten": { - "message": "מתחבר אל רשת בדיקה Ropsten " - }, "continueToWyre": { "message": "המשך ל-Wyre" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "כתובת חוזה ידועה." }, - "kovan": { - "message": "רשת בדיקה Kovan " - }, "learnMore": { "message": "למדו עוד" }, @@ -765,9 +753,6 @@ "revealSeedWordsWarningTitle": { "message": "אין לשתף צירוף מילים זה עם אף אחד!" }, - "rinkeby": { - "message": "רשת בדיקה Rinkeby " - }, "rpcUrl": { "message": "כתובת URL חדשה של RPC" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index dd68eaaf1b13..79620f31e6d7 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Goerli टेस्ट नेटवर्क से कनेक्ट हो रहा है" }, - "connectingToKovan": { - "message": "Kovan टेस्ट नेटवर्क से कनेक्ट हो रहा है" - }, "connectingToMainnet": { "message": "Ethereum Mainnet से कनेक्ट हो रहा है" }, - "connectingToRinkeby": { - "message": "Rinkeby टेस्ट नेटवर्क से कनेक्ट हो रहा है" - }, - "connectingToRopsten": { - "message": "Ropsten टेस्ट नेटवर्क से कनेक्ट हो रहा है" + "connectingToSepolia": { + "message": "सेपोलिया टेस्ट नेटवर्क से कनेक्ट कर रहा है" }, "contactUs": { "message": "हमसे संपर्क करें" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "यह कार्रवाई उन टोकन को संपादित करेगी, जो पहले से ही आपके वॉलेट में सूचीबद्ध हैं, जिसका उपयोग आपको फ़िश करने के लिए किया जा सकता है। केवल तभी अनुमोदित करें, जब आप इस बात को लेकर सुनिश्चित हों कि आप इन टोकन का प्रतिनिधित्व बदलना चाहते हैं। $1 के बारे में और अधिक जानें" }, - "kovan": { - "message": "Kovan टेस्ट नेटवर्क" - }, "lastConnected": { "message": "अंतिम बार कनेक्ट किया गया" }, @@ -2724,11 +2715,8 @@ "message": "अनुमति निरस्त करने से, निम्नलिखित $1 अब आपके $2 को एक्सेस नहीं कर सकेगा", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Rinkeby टेस्ट नेटवर्क" - }, - "ropsten": { - "message": "Ropsten टेस्ट नेटवर्क" + "revokeSpendingCapTooltipText": { + "message": "यह अनुबंध आपके वर्तमान या भविष्य के और टोकन पर खर्च करने में असमर्थ है।" }, "rpcUrl": { "message": "नया RPC URL" diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index 0fc0a7c26155..8b509d267fc0 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -178,9 +178,6 @@ "message": "JSON फ़ाइल", "description": "format for importing an account" }, - "kovan": { - "message": "कोवान टेस्ट नेटवर्क" - }, "likeToImportTokens": { "message": "क्या आप इन टोकनों को जोड़ना चाहते हैं?" }, @@ -284,12 +281,6 @@ "revealSeedWordsWarning": { "message": "किसी सार्वजनिक स्थान पर अपने बीज के शब्द ठीक नहीं करें! ये शब्द आपके सभी खातों को चोरी करने के लिए उपयोग किए जा सकते हैं।" }, - "rinkeby": { - "message": "रिचीव टेस्ट नेटवर्क" - }, - "ropsten": { - "message": "रॉप्स्टेन टेस्ट नेटवर्क" - }, "save": { "message": "सहेजें" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index 551b1f15aa21..c1555838c8b3 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Povezivanje na testnu mrežu Goerli" }, - "connectingToKovan": { - "message": "Povezivanje na testnu mrežu Kovan" - }, "connectingToMainnet": { "message": "Povezivanje na glavnu mrežu Ethereum" }, - "connectingToRinkeby": { - "message": "Povezivanje na testnu mrežu Rinkeby" - }, - "connectingToRopsten": { - "message": "Povezivanje na testnu mrežu Ropsten" - }, "continueToWyre": { "message": "Nastavi na uslugu Wyre" }, @@ -499,9 +490,6 @@ "knownAddressRecipient": { "message": "Poznata ugovorna adresa." }, - "kovan": { - "message": "Testna mreža Kovan" - }, "learnMore": { "message": "Saznajte više" }, @@ -761,12 +749,6 @@ "revealSeedWordsWarningTitle": { "message": "NE DIJELITE ovu rečenicu ni s kim!" }, - "rinkeby": { - "message": "Testna mreža Rinkeby" - }, - "ropsten": { - "message": "Testna mreža Ropsten" - }, "rpcUrl": { "message": "Novi URL RPC-a" }, diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 44409dd4598e..dd1579bac07c 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -108,18 +108,9 @@ "connectHardwareWallet": { "message": "Konekte Materyèl Wallet" }, - "connectingToKovan": { - "message": "Konekte nan Kovan Tès Rezo a" - }, "connectingToMainnet": { "message": "Konekte ak Prensipal Ethereum Rezo a" }, - "connectingToRinkeby": { - "message": "Konekte nan Rinkeby Tès Rezo a" - }, - "connectingToRopsten": { - "message": "Konekte ak Ropsten Tès Rezo a" - }, "contractDeployment": { "message": "Kontra Deplwaman" }, @@ -295,9 +286,6 @@ "message": "JSON Dosye", "description": "format for importing an account" }, - "kovan": { - "message": "Kovan Tès Rezo" - }, "learnMore": { "message": "Aprann plis" }, @@ -491,12 +479,6 @@ "revealSeedWordsWarningTitle": { "message": "PA pataje fraz sa a avèk nenpòt moun!" }, - "rinkeby": { - "message": "Rinkeby Tès Rezo" - }, - "ropsten": { - "message": "Ropsten Tès Rezo" - }, "save": { "message": "Sove" }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 590b77f86e22..d6a4baadb1ae 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Csatlakozás a Goerli teszthálózathoz" }, - "connectingToKovan": { - "message": "Csatlakozás a Kovan teszthálózathoz" - }, "connectingToMainnet": { "message": "Csatlakozás a fő Ethereum hálózathoz" }, - "connectingToRinkeby": { - "message": "Kapcsolódás a Rinkeby Teszthálózathoz" - }, - "connectingToRopsten": { - "message": "Csatlakozás a Ropsten teszthálózathoz" - }, "continueToWyre": { "message": "Tovább a Wyre-re" }, @@ -499,9 +490,6 @@ "knownAddressRecipient": { "message": "Ismert szerződéses cím." }, - "kovan": { - "message": "Kovan teszthálózat" - }, "learnMore": { "message": "Tudjon meg többet" }, @@ -761,12 +749,6 @@ "revealSeedWordsWarningTitle": { "message": "NE ossza meg ezt a mondatot senkivel!" }, - "rinkeby": { - "message": "Rinkeby teszthálózat" - }, - "ropsten": { - "message": "Ropsten teszthálózat" - }, "rpcUrl": { "message": "Új RPC URL" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 8063b53d64ab..2d86d9ec08db 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Menghubungkan ke Jaringan Uji Goerli" }, - "connectingToKovan": { - "message": "Menghubungkan ke Jaringan Uji Kovan" - }, "connectingToMainnet": { "message": "Menghubungkan ke Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": "Menghubungkan ke Jaringan Uji Rinkeby" - }, - "connectingToRopsten": { - "message": "Menghubungkan ke Jaringan Uji Ropsten" + "connectingToSepolia": { + "message": "Menghubungkan ke jaringan uji Sepolia" }, "contactUs": { "message": "Hubungi kami" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Tindakan ini akan mengedit token yang telah terdaftar dalam dompet Anda, yang dapat digunakan untuk menipu Anda. Setujui hanya jika Anda yakin bahwa Anda ingin mengubah apa yang diwakili token ini. Pelajari selengkapnya seputar $1" }, - "kovan": { - "message": "Jaringan Uji Kovan" - }, "lastConnected": { "message": "Terakhir Terhubung" }, @@ -2724,11 +2715,8 @@ "message": "Dengan mencabut izin, $1 berikut tidak lagi dapat mengakses $2 Anda", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Jaringan Uji Rinkeby" - }, - "ropsten": { - "message": "Jaringan Uji Ropsten" + "revokeSpendingCapTooltipText": { + "message": "Kontrak ini tidak akan dapat mempergunakan token Anda saat ini atau di masa mendatang." }, "rpcUrl": { "message": "URL RPC Baru" diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index c352034da896..246960f014fc 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -295,18 +295,9 @@ "connectingToGoerli": { "message": "Connessione alla Rete di Test Goerli" }, - "connectingToKovan": { - "message": "Connessione alla Rete di test Kovan" - }, "connectingToMainnet": { "message": "Connessione alla Rete Ethereum Principale" }, - "connectingToRinkeby": { - "message": "Connessione alla Rete di test Rinkeby" - }, - "connectingToRopsten": { - "message": "Connessione alla Rete di test Ropsten" - }, "contactUs": { "message": "Contattaci!" }, @@ -789,9 +780,6 @@ "knownTokenWarning": { "message": "Questa azione modificherà i token che sono già nel tuo portafoglio, che possono essere utilizzati per truffarti. Approva solo se sei sicuro di voler cambiare ciò che rappresentano questi token." }, - "kovan": { - "message": "Rete di test Kovan" - }, "lastConnected": { "message": "Ultima Connessione" }, @@ -1152,12 +1140,6 @@ "revealSeedWordsWarningTitle": { "message": "NON CONDIVIDERE questa frase con nessuno!" }, - "rinkeby": { - "message": "Rete di test Rinkeby" - }, - "ropsten": { - "message": "Rete di test Ropsten" - }, "rpcUrl": { "message": "Nuovo URL RPC" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 0b9a735fbcdb..3bbe7a90d718 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Goerliテストネットワークに接続中" }, - "connectingToKovan": { - "message": "Kovanテストネットワークに接続中" - }, "connectingToMainnet": { "message": "イーサリアムメインネットに接続中" }, - "connectingToRinkeby": { - "message": "Rinkebyテストネットワークに接続中" - }, - "connectingToRopsten": { - "message": "Ropstenテストネットワークに接続中" + "connectingToSepolia": { + "message": "Sepolia テストネットワークに接続中" }, "contactUs": { "message": "お問い合わせ" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "このアクションは、ウォレットに既に一覧表示されているトークンを編集します。これは、フィッシングに使用される可能性があります。これらのトークンの表す内容を変更する意図が確実な場合にのみ承認します。$1に関する詳細をご覧ください" }, - "kovan": { - "message": "Kovanテストネットワーク" - }, "lastConnected": { "message": "前回の接続" }, @@ -2724,11 +2715,8 @@ "message": "アクセス許可を取り消すと、次の $1 が今後 $2 にアクセスできなくなります", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Rinkebyテストネットワーク" - }, - "ropsten": { - "message": "Ropstenテストネットワーク" + "revokeSpendingCapTooltipText": { + "message": "このコントラクトは、現在または今後のトークンをこれ以上使用できなくなります。" }, "rpcUrl": { "message": "新しいRPC URL" diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 762b250c7ff6..831ce3344e28 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Goerli ಪರೀಕ್ಷಾ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಲಾಗುತ್ತಿದೆ" }, - "connectingToKovan": { - "message": "Kovan ಪರೀಕ್ಷಾ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಲಾಗುತ್ತಿದೆ " - }, "connectingToMainnet": { "message": "ಮುಖ್ಯ ಎಥೆರಿಯಮ್ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಲಾಗುತ್ತಿದೆ" }, - "connectingToRinkeby": { - "message": "Rinkeby ಪರೀಕ್ಷಾ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಲಾಗುತ್ತಿದೆ" - }, - "connectingToRopsten": { - "message": "Ropsten ಪರೀಕ್ಷಾ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಲಾಗುತ್ತಿದೆ" - }, "continueToWyre": { "message": "Wyre ಗೆ ಮುಂದುವರಿಸಿ" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "ತಿಳಿದಿರುವ ಒಪ್ಪಂದದ ವಿಳಾಸ." }, - "kovan": { - "message": "Kovan ಪರೀಕ್ಷೆ ನೆಟ್‌ವರ್ಕ್" - }, "learnMore": { "message": "ಇನ್ನಷ್ಟು ತಿಳಿಯಿರಿ" }, @@ -768,12 +756,6 @@ "revealSeedWordsWarningTitle": { "message": "ಈ ಫ್ರೇಸ್ ಅನ್ನು ಯಾರೊಂದಿಗೂ ಹಂಚಿಕೊಳ್ಳಬೇಡಿ!" }, - "rinkeby": { - "message": "Rinkeby ಪರೀಕ್ಷೆ ನೆಟ್‌ವರ್ಕ್" - }, - "ropsten": { - "message": "Ropsten ಪರೀಕ್ಷೆ ನೆಟ್‌ವರ್ಕ್" - }, "rpcUrl": { "message": "ಹೊಸ RPC URL" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index f4d108491dc0..1c647cf5e846 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Goerli 테스트 네트워크에 연결 중" }, - "connectingToKovan": { - "message": "Kovan 테스트 네트워크에 연결 중" - }, "connectingToMainnet": { "message": "이더리움 메인넷에 연결 중" }, - "connectingToRinkeby": { - "message": "Rinkeby 테스트 네트워크에 연결 중" - }, - "connectingToRopsten": { - "message": "Ropsten 테스트 네트워크에 연결 중" + "connectingToSepolia": { + "message": "Sepolia 테스트 네트워크에 연결 중" }, "contactUs": { "message": "문의하기" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "이 작업은 지갑에 이미 나열되어 있고 피싱에 사용될 수 있는 토큰을 편집합니다. 해당 토큰이 나타내는 내용을 변경하려는 경우에만 작업을 승인하세요. $1에 대해 자세히 알아보기" }, - "kovan": { - "message": "Kovan 테스트 네트워크" - }, "lastConnected": { "message": "마지막 연결" }, @@ -2724,11 +2715,8 @@ "message": "권한을 취소하면 다음 $1의 $2 권한은 더 이상 유효하지 않습니다", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Rinkeby 테스트 네트워크" - }, - "ropsten": { - "message": "Ropsten 테스트 네트워크" + "revokeSpendingCapTooltipText": { + "message": "이 계약은 현재나 미래의 토큰을 더 이상 사용할 수 없습니다." }, "rpcUrl": { "message": "새 RPC URL" diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 68dd08edc238..7672fa096ced 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Jungiamasi prie „Goerli“ bandomojo tinklo" }, - "connectingToKovan": { - "message": "Jungiamasi prie „Kovan“ bandomojo tinklo" - }, "connectingToMainnet": { "message": "Jungiamasi prie pagrindinio „Ethereum“ tinklo" }, - "connectingToRinkeby": { - "message": "Jungiamasi prie „Rinkeby“ bandomojo tinklo" - }, - "connectingToRopsten": { - "message": "Jungiamasi prie „Ropsten“ bandomojo tinklo" - }, "continueToWyre": { "message": "Tęsti su „Wyre“" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "Žinomas sutarties adresas." }, - "kovan": { - "message": "„Kovan“ bandomasis tinklas" - }, "learnMore": { "message": "Sužinokite daugiau" }, @@ -768,12 +756,6 @@ "revealSeedWordsWarningTitle": { "message": "Šia fraze su niekuo NESIDALINKITE!" }, - "rinkeby": { - "message": "„Rinkeby“ bandomasis tinklas" - }, - "ropsten": { - "message": "„Ropsten“ bandomasis tinklas" - }, "rpcUrl": { "message": "Naujas RPC URL" }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 30e65fd68b1e..ec46605efe63 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Pieslēdzas Goerli testa tīklam" }, - "connectingToKovan": { - "message": "Savienojas ar Kovan testa tīklu" - }, "connectingToMainnet": { "message": "Savienojas ar galveno Ethereum tīklu" }, - "connectingToRinkeby": { - "message": "Pieslēdzas Rinkeby testa tīklam" - }, - "connectingToRopsten": { - "message": "Pieslēdzas Ropsten testa tīklam" - }, "continueToWyre": { "message": "Pāriet uz Wyre" }, @@ -499,9 +490,6 @@ "knownAddressRecipient": { "message": "Zināmā līguma adrese." }, - "kovan": { - "message": "Kovan testa tīkls" - }, "learnMore": { "message": "Uzzināt vairāk" }, @@ -764,12 +752,6 @@ "revealSeedWordsWarningTitle": { "message": "NEDALIETIES ar šo frāzi!" }, - "rinkeby": { - "message": "Rinkeby testa tīkls" - }, - "ropsten": { - "message": "Ropsten testa tīkls" - }, "rpcUrl": { "message": "Jauns RPC URL" }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index 8923fb8bfcb9..20fca94c08eb 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Menyambung kepada Rangkaian Ujian Goerli" }, - "connectingToKovan": { - "message": "Menyambungkan kepada Rangkaian Ujian Kovan" - }, "connectingToMainnet": { "message": "Menyambung kepada Rangkaian Ethereum Utama" }, - "connectingToRinkeby": { - "message": "Menyambung kepada Rangkaian Ujian Rinkeby" - }, - "connectingToRopsten": { - "message": "Menyambungkan kepada Rangkaian Ujian Ropsten" - }, "continueToWyre": { "message": "Teruskan ke Wyre" }, @@ -492,9 +483,6 @@ "knownAddressRecipient": { "message": "Alamat kontrak diketahui." }, - "kovan": { - "message": "Rangkaian Ujian Kovan" - }, "learnMore": { "message": "Maklumat lanjut" }, @@ -748,12 +736,6 @@ "revealSeedWordsWarningTitle": { "message": "JANGAN berkongsi ungkapan ini dengan orang lain!" }, - "rinkeby": { - "message": "Rangkaian Ujian Rinkeby" - }, - "ropsten": { - "message": "Rangkaian Ujian Ropsten" - }, "rpcUrl": { "message": "URL RPC baru" }, diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index 03510df014fb..b77ced60a84a 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -175,9 +175,6 @@ "message": "JSON-bestand", "description": "format for importing an account" }, - "kovan": { - "message": "Kovan-testnetwerk" - }, "likeToImportTokens": { "message": "Wil je deze tokens toevoegen?" }, @@ -274,12 +271,6 @@ "revealSeedWordsWarning": { "message": "Zorg dat je back-up woorden niet op een openbare plaats bekijkt! Deze woorden kunnen worden gebruikt om al uw accounts opnieuw te genereren (en dus uw account te stelen)." }, - "rinkeby": { - "message": "Rinkeby testnetwerk" - }, - "ropsten": { - "message": "Ropsten testnetwerk" - }, "save": { "message": "Opslaan" }, diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 8d1cc1eab29e..07f2ae027753 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -190,18 +190,9 @@ "connectingToGoerli": { "message": "Oppretter forbindelse med Goerli Test Network" }, - "connectingToKovan": { - "message": "Kobler til Kovan testnettverk" - }, "connectingToMainnet": { "message": "Forbinder med hoved-Ethereumnettverk " }, - "connectingToRinkeby": { - "message": "Kobler til Rinkeby Test Network " - }, - "connectingToRopsten": { - "message": "Kobler til Ropsten testnettverk" - }, "continueToWyre": { "message": "Fortsett til Wyre " }, @@ -490,9 +481,6 @@ "knownAddressRecipient": { "message": "Kjent kontaktadresse" }, - "kovan": { - "message": "Kovan testnettverk" - }, "learnMore": { "message": "Lær mer" }, @@ -755,9 +743,6 @@ "revealSeedWordsWarningTitle": { "message": "IKKE del denne frasen med noen! " }, - "rinkeby": { - "message": "Rinkeby testnettverk" - }, "rpcUrl": { "message": "NY RPC-URL " }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index af0a3c7a6fd9..a5c5901a75aa 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -355,18 +355,9 @@ "connectingToGoerli": { "message": "Kumokonekta sa Goerli Test Network" }, - "connectingToKovan": { - "message": "Kumokonekta sa Kovan Test Network" - }, "connectingToMainnet": { "message": "Kumokonekta sa Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": "Kumokonekta sa Rinkeby Test Network" - }, - "connectingToRopsten": { - "message": "Kumokonekta sa Ropsten Test Network" - }, "contactUs": { "message": "Makipag-ugnayan sa amin" }, @@ -924,9 +915,6 @@ "knownTokenWarning": { "message": "Mae-edit ng aksyong ito ang mga token na nakalista na sa iyong wallet, na puwedeng gamitin para i-phish ka. Aprubahan lang kung sigurado kang gusto mong baguhin kung ano ang kinakatawan ng mga token na ito." }, - "kovan": { - "message": "Kovan Test Network" - }, "lastConnected": { "message": "Huling Kumonekta" }, @@ -1435,12 +1423,6 @@ "revealSeedWordsWarningTitle": { "message": "Huwag ibahagi ang phrase na ito sa kahit sino!" }, - "rinkeby": { - "message": "Rinkeby Test Network" - }, - "ropsten": { - "message": "Ropsten Test Network" - }, "rpcUrl": { "message": "Bagong RPC URL" }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 0025ba5fa3ed..5b2b6441daea 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Łączenie z siecią testową Goerli" }, - "connectingToKovan": { - "message": "Łączenie z siecią testową Kovan" - }, "connectingToMainnet": { "message": "Łączenie z główną siecią Ethereum" }, - "connectingToRinkeby": { - "message": "Łączenie z siecią testową Rinkeby" - }, - "connectingToRopsten": { - "message": "Łączenie z siecią testową Ropsten" - }, "continueToWyre": { "message": "Przejdź do Wyre" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "Znany adres kontraktu." }, - "kovan": { - "message": "Sieć testowa Kovan" - }, "learnMore": { "message": "Dowiedz się więcej" }, @@ -762,12 +750,6 @@ "revealSeedWordsWarningTitle": { "message": "NIE pokazuj tej frazy nikomu!" }, - "rinkeby": { - "message": "Sieć testowa Rinkeby" - }, - "ropsten": { - "message": "Sieć testowa Ropsten" - }, "rpcUrl": { "message": "Nowy adres URL RPC" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 4e261ec78a2b..a3e223eed676 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Conectando à rede de testes Goerli" }, - "connectingToKovan": { - "message": "Conectando à rede de testes Kovan" - }, "connectingToMainnet": { "message": "Conectando à mainnet do Ethereum" }, - "connectingToRinkeby": { - "message": "Conectando à rede de testes Rinkeby" - }, - "connectingToRopsten": { - "message": "Conectando à rede de testes Ropsten" + "connectingToSepolia": { + "message": "Conectando à rede de teste Sepolia" }, "contactUs": { "message": "Fale conosco" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Essa ação editará os tokens já listados na sua carteira, que podem ser usado para praticar phishing contra você. Só aprove se você tiver certeza de que quer alterar o que esses tokens representam." }, - "kovan": { - "message": "Rede de Teste Kovan" - }, "lastConnected": { "message": "Conectado pela última vez em" }, @@ -2724,11 +2715,8 @@ "message": "Ao revogar a permissão, o $1 a seguir não terá mais acesso ao seu $2", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Rede de Teste Rinkeby" - }, - "ropsten": { - "message": "Rede de Teste Ropsten" + "revokeSpendingCapTooltipText": { + "message": "Este contrato não poderá gastar mais nenhum de seus tokens atuais ou futuros." }, "rpcUrl": { "message": "Novo URL da RPC" diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 5b2c104595be..802b1b55c594 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -514,18 +514,9 @@ "connectingToGoerli": { "message": "Conectando à rede de testes Goerli" }, - "connectingToKovan": { - "message": "Conectando à rede de testes Kovan" - }, "connectingToMainnet": { "message": "Conectando à mainnet do Ethereum" }, - "connectingToRinkeby": { - "message": "Conectando à rede de testes Rinkeby" - }, - "connectingToRopsten": { - "message": "Conectando à rede de testes Ropsten" - }, "contactUs": { "message": "Fale conosco" }, @@ -1409,9 +1400,6 @@ "knownTokenWarning": { "message": "Essa ação editará os tokens já listados na sua carteira, que podem ser usado para praticar phishing contra você. Só aprove se você tiver certeza de que quer alterar o que esses tokens representam." }, - "kovan": { - "message": "Rede de testes Kovan" - }, "lastConnected": { "message": "Conectado pela última vez em" }, @@ -2232,12 +2220,6 @@ "revealSeedWordsWarningTitle": { "message": "NÃO compartilhe essa frase com ninguém!" }, - "rinkeby": { - "message": "Rede de testes Rinkeby" - }, - "ropsten": { - "message": "Rede de testes Ropsten" - }, "rpcUrl": { "message": "Novo URL da RPC" }, diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 002236935c12..6484ab9f2648 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Se conectează la rețeaua de test Goerli" }, - "connectingToKovan": { - "message": "Se conectează la rețeaua de test Kovan" - }, "connectingToMainnet": { "message": "Se conectează la rețeaua Ethereum principală" }, - "connectingToRinkeby": { - "message": "Se conectează la Rețeaua de test Rinkeby" - }, - "connectingToRopsten": { - "message": "Se conectează la rețeaua de test Ropsten" - }, "continueToWyre": { "message": "Continuați la Wyre" }, @@ -493,9 +484,6 @@ "knownAddressRecipient": { "message": "Adresa cunoscută din contract." }, - "kovan": { - "message": "Rețea de test Kovan" - }, "learnMore": { "message": "Aflați mai multe" }, @@ -755,12 +743,6 @@ "revealSeedWordsWarningTitle": { "message": "NU împărtășiți această expresie nimănui!" }, - "rinkeby": { - "message": "Rețea test Rinkeby" - }, - "ropsten": { - "message": "Rețea de testare Ropsten" - }, "rpcUrl": { "message": "URL RPC nou" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index a4d0891ab073..d194ac40dd99 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Подключение к тестовой сети Goerli..." }, - "connectingToKovan": { - "message": "Подключение к тестовой сети Kovan..." - }, "connectingToMainnet": { "message": "Подключение к сети Ethereum Mainnet..." }, - "connectingToRinkeby": { - "message": "Подключение к тестовой сети Rinkeby..." - }, - "connectingToRopsten": { - "message": "Подключение к тестовой сети Ropsten..." + "connectingToSepolia": { + "message": "Подключение к тестовой сети Sepolia..." }, "contactUs": { "message": "Свяжитесь с нами" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Это действие изменит токены, уже указанные в вашем кошельке, которые можно использовать для фишинга. Утверждайте, только если вы уверены, что хотите изменить то, что представляют эти токены. Узнайте подробнее о $1" }, - "kovan": { - "message": "Тестовая сеть Kovan" - }, "lastConnected": { "message": "Последнее подключение" }, @@ -2724,11 +2715,8 @@ "message": "При отмене разрешения следующий $1 больше не сможет получить доступ к вашему $2", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Тестовая сеть Rinkeby" - }, - "ropsten": { - "message": "Тестовая сеть Ropsten" + "revokeSpendingCapTooltipText": { + "message": "Этот контракт не позволит вам больше тратить ваши текущие или будущие токены." }, "rpcUrl": { "message": "Новый URL-адрес RPC" diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 2bfd7e540dcc..da3f1889a316 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -187,18 +187,9 @@ "connectingToGoerli": { "message": "Pripája sa k testovacej sieti Goerli" }, - "connectingToKovan": { - "message": "Připojuji se k Kovan Test Network" - }, "connectingToMainnet": { "message": "Připojuji se k Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": "Připojuji se k Rinkeby Test Network" - }, - "connectingToRopsten": { - "message": "Připojuji se k Ropsten Test Network" - }, "continueToWyre": { "message": "Pokračovať na Wyre" }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index c49155135358..cb6812231ebb 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Povezovanje na testno omrežje Goerli" }, - "connectingToKovan": { - "message": "Povezovanje na testno omrežje Kovan" - }, "connectingToMainnet": { "message": "Povezovanje na glavno omrežje" }, - "connectingToRinkeby": { - "message": "Povezovanje na testno omrežje Rinkeby" - }, - "connectingToRopsten": { - "message": "Povezovanje na testno omrežje Ropsten" - }, "continueToWyre": { "message": "Nadaljuj na Wyre" }, @@ -497,9 +488,6 @@ "knownAddressRecipient": { "message": "Znan naslov pogodbe." }, - "kovan": { - "message": "Testno omrežje Kovan" - }, "learnMore": { "message": "Preberite več" }, @@ -756,12 +744,6 @@ "revealSeedWordsWarningTitle": { "message": "Tega ne delite z nikomer!" }, - "rinkeby": { - "message": "Testno omrežje Rinkeby" - }, - "ropsten": { - "message": "Testno omrežje Ropsten" - }, "rpcUrl": { "message": "Nov URL RPC" }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 5ebbd176e554..e70ff66c9458 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -190,18 +190,9 @@ "connectingToGoerli": { "message": "Povezuje se sa test mrežom Goerli " }, - "connectingToKovan": { - "message": "Povezuje se na test mrežu Kovan" - }, "connectingToMainnet": { "message": "Povezuje se na glavnu Ethereum mrežu" }, - "connectingToRinkeby": { - "message": "Poezivanje na Rinkeby Test mrežu" - }, - "connectingToRopsten": { - "message": "Povezuje se na Ropsten Test mrežu" - }, "continueToWyre": { "message": "Nastavite ka Wyre" }, @@ -500,9 +491,6 @@ "knownAddressRecipient": { "message": "Poznata adresa ugovora." }, - "kovan": { - "message": "Kovan test mreža" - }, "learnMore": { "message": "Nauči više" }, @@ -759,12 +747,6 @@ "revealSeedWordsWarningTitle": { "message": "NE delite ovu frazu ni sa kim!" }, - "rinkeby": { - "message": "Rinkeby test mreža" - }, - "ropsten": { - "message": "Test mreža Ropsten" - }, "rpcUrl": { "message": "Novi RPC URL" }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index c8d77d1677ed..e5a64143062f 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -187,18 +187,9 @@ "connectingToGoerli": { "message": "Ansluter till Goerli Test Network" }, - "connectingToKovan": { - "message": "Ansluter till Kovans testnätverk" - }, "connectingToMainnet": { "message": "Koppla till Ethereums huvudnätverk" }, - "connectingToRinkeby": { - "message": "Ansluter till Rinkeby Test Network" - }, - "connectingToRopsten": { - "message": "Ansluter till Ropsten Test Network" - }, "continueToWyre": { "message": "Fortsätt till Wyre" }, @@ -493,9 +484,6 @@ "knownAddressRecipient": { "message": "Känd kontraktadress." }, - "kovan": { - "message": "Kovan testnätverk" - }, "learnMore": { "message": "Läs mer" }, @@ -752,12 +740,6 @@ "revealSeedWordsWarningTitle": { "message": "DELA INTE frasen med någon!" }, - "rinkeby": { - "message": "Rinkeby testnätverk" - }, - "ropsten": { - "message": "Ropsten testnätverk" - }, "rpcUrl": { "message": "Ny RPC-URL" }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 9a060e45ec42..a7307bb439b7 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -187,18 +187,9 @@ "connectingToGoerli": { "message": "Inaunganisha kwenye Mtandao wa Majaribio wa Goerli" }, - "connectingToKovan": { - "message": "Inaunganisha kwenye Mtandao wa Majaribio wa Kovan" - }, "connectingToMainnet": { "message": "Inaunganisha kwenye Mtandao Mkuu wa Ethereum" }, - "connectingToRinkeby": { - "message": "Inaunganisha kwenye Mtandao wa Majaribio wa Rinkeby" - }, - "connectingToRopsten": { - "message": "Inaunganisha kwenye Mtandao wa Majaribio wa Ropsten" - }, "continueToWyre": { "message": "Endelea kwenye Wyre" }, @@ -490,9 +481,6 @@ "knownAddressRecipient": { "message": "Anwani za mkataba zinazofahamika." }, - "kovan": { - "message": "Mtandao wa Majaribio wa Kovan" - }, "learnMore": { "message": "Jifunze zaidi" }, @@ -746,12 +734,6 @@ "revealSeedWordsWarningTitle": { "message": "USISHIRIKI kirai hiki na mtu yeyote!" }, - "rinkeby": { - "message": "Mtandao wa Majaribio wa Rinkeby" - }, - "ropsten": { - "message": "Mtandao wa Majaribio wa Ropsten" - }, "rpcUrl": { "message": "RPC URL mpya" }, diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index 7d003b620d4a..270bd0b4db0b 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -78,18 +78,9 @@ "connect": { "message": "இணை" }, - "connectingToKovan": { - "message": "கோவன் டெஸ்ட் நெட்வொர்க்குடன் இணைத்தல்" - }, "connectingToMainnet": { "message": "முக்கிய எதெரியும் நெட்வொர்க் இணைக்கும்" }, - "connectingToRinkeby": { - "message": "ரிங்கெப்ய டெஸ்ட் நெட்வொர்க்குடன் இணைக்கிறது" - }, - "connectingToRopsten": { - "message": "ரொப்ஸ்டென் டெஸ்ட் நெட்வொர்க்குடன் இணைக்கிறது" - }, "contractDeployment": { "message": "ஒப்பந்த வரிசைப்படுத்தல்" }, @@ -238,9 +229,6 @@ "message": "JSON கோப்பு", "description": "format for importing an account" }, - "kovan": { - "message": "கோவன் டெஸ்ட் நெட்வொர்க்" - }, "learnMore": { "message": "மேலும் அறிக" }, @@ -392,12 +380,6 @@ "revealSeedWordsWarning": { "message": "உங்கள் விதை வார்த்தைகள் ஒரு பொது இடத்தில் மீட்க வேண்டாம்! உங்கள் எல்லா கணக்குகளையும் திருட இந்த வார்த்தைகள் பயன்படுத்தப்படலாம்." }, - "rinkeby": { - "message": "ரிங்கெப்ய டெஸ்ட் நெட்வொர்க்" - }, - "ropsten": { - "message": "ரொப்ஸ்டென் டெஸ்ட் நெட்வொர்க்" - }, "save": { "message": "சேமி" }, diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 6daf3c05b10b..7a7e2dbc3058 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -81,9 +81,6 @@ "connectingToMainnet": { "message": "เชื่อมต่อกับเครือข่าย Ethereum หลัก" }, - "connectingToRopsten": { - "message": "เชื่อมต่อกับเครือข่ายทดสอบ Ropsten" - }, "continueToWyre": { "message": "ไปที่ Wyre" }, @@ -253,9 +250,6 @@ "message": "ไฟล์ JSON", "description": "format for importing an account" }, - "kovan": { - "message": "เครือข่ายทดสอบ Kovan" - }, "learnMore": { "message": "เรียนรู้เพิ่มเติม" }, @@ -380,12 +374,6 @@ "revealSeedWordsWarning": { "message": "อย่าเปิดเผยคำกลุ่มคำชีดของคุณในที่สาธารณะ! คำเหล่านี้สามารถใช้เพื่อขโมยบัญชีทั้งหมดของคุณ" }, - "rinkeby": { - "message": "เครือข่ายทดสอบ Rinkeby" - }, - "ropsten": { - "message": "เครือข่ายทดสอบ Ropsten" - }, "save": { "message": "บันทึก" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 04c1f8983395..d04235ae449f 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Kumokonekta sa Goerli Test Network" }, - "connectingToKovan": { - "message": "Kumokonekta sa Kovan Test Network" - }, "connectingToMainnet": { "message": "Kumokonekta sa Ethereum Mainnet" }, - "connectingToRinkeby": { - "message": "Kumokonekta sa Rinkeby Test Network" - }, - "connectingToRopsten": { - "message": "Kumokonekta sa Ropsten Test Network" + "connectingToSepolia": { + "message": "Kumokonekta sa Sepolia test network" }, "contactUs": { "message": "Makipag-ugnayan sa amin" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Mae-edit ng aksyong ito ang mga token na nakalista na sa iyong wallet, na puwedeng gamitin para i-phish ka. Aprubahan lang kung sigurado kang gusto mong baguhin kung ano ang kinakatawan ng mga token na ito. Alamin pa ang tungkol sa $1" }, - "kovan": { - "message": "Kovan Test Network" - }, "lastConnected": { "message": "Huling Kumonekta" }, @@ -2724,11 +2715,8 @@ "message": "Sa pamamagitan ng pagbawi ng pahintulot, hindi na maa-access ng sumusunod na $1 ang iyong $2", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Rinkeby Test Network" - }, - "ropsten": { - "message": "Ropsten Test Network" + "revokeSpendingCapTooltipText": { + "message": "Hindi na magagawang gastusin pa ng kontratang ito ang iyong mga pangkasalukuyan o panghinaharap na mga token." }, "rpcUrl": { "message": "Bagong RPC URL" diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index fa30acbdd684..6ddc0eeb8c8e 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Goerli Test Ağına Bağlanıyor" }, - "connectingToKovan": { - "message": "Kovan Test Ağına bağlanıyor" - }, "connectingToMainnet": { "message": "Ethereum Mainnet ağına bağlanıyor" }, - "connectingToRinkeby": { - "message": "Rinkeby Test Ağına bağlanıyor" - }, - "connectingToRopsten": { - "message": "Ropsten Test Ağına bağlanıyor" + "connectingToSepolia": { + "message": "Sepolia test ağına bağlanılıyor" }, "contactUs": { "message": "Bize ulaşın" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Bu eylem kimlik avı için kullanılabilecek şekilde cüzdanınızda zaten listelenmiş olan tokenleri düzenleyecektir. Sadece bu tokenlerin neyi temsil ettiğini değiştirmek istediğinizden eminseniz onaylayın. $1 hakkında daha fazla bilgi edinin" }, - "kovan": { - "message": "Kovan Test Ağı" - }, "lastConnected": { "message": "Son Bağlanma" }, @@ -2724,11 +2715,8 @@ "message": "İzni geri çektiğinizde aşağıdaki $1 artık $2 alanınıza erişim sağlayamayacak", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Rinkeby Test Ağı" - }, - "ropsten": { - "message": "Ropsten Test Ağı" + "revokeSpendingCapTooltipText": { + "message": "Bu sözleşme şimdiki ya da gelecekteki tokenlerinizin hiçbirini kullanamayacak." }, "rpcUrl": { "message": "Yeni RPC URL adresi" diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 2b47cd8d45ef..acc8275672b7 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -193,18 +193,9 @@ "connectingToGoerli": { "message": "Підключення до тестової мережі Goerli" }, - "connectingToKovan": { - "message": "Підключення до тестової мережі Kovan" - }, "connectingToMainnet": { "message": "З'єднуємось з Головною мережею Ethereum" }, - "connectingToRinkeby": { - "message": "Під'єднуємось до тестової мережі Rinkeby" - }, - "connectingToRopsten": { - "message": "Під'єднуємось до Тестової мережі Ropsten" - }, "continueToWyre": { "message": "Продовжити у Wyre" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "Відома контрактна адреса." }, - "kovan": { - "message": "Тестова мережа Kovan" - }, "learnMore": { "message": "Дізнатись більше" }, @@ -768,12 +756,6 @@ "revealSeedWordsWarningTitle": { "message": "НЕ передавайте цю фразу нікому!" }, - "rinkeby": { - "message": "Тестова мережа Rinkeby" - }, - "ropsten": { - "message": "Тестова мережа Ropsten" - }, "rpcUrl": { "message": "Новий RPC URL" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 9adab7642c74..c8133649a42f 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -616,17 +616,11 @@ "connectingToGoerli": { "message": "Đang kết nối với mạng thử nghiệm Goerli" }, - "connectingToKovan": { - "message": "Đang kết nối với mạng thử nghiệm Kovan" - }, "connectingToMainnet": { "message": "Đang kết nối với mạng chính thức của Ethereum" }, - "connectingToRinkeby": { - "message": "Đang kết nối với mạng thử nghiệm Rinkeby" - }, - "connectingToRopsten": { - "message": "Đang kết nối với mạng thử nghiệm Ropsten" + "connectingToSepolia": { + "message": "Đang kết nối với mạng thử nghiệm Sepolia" }, "contactUs": { "message": "Liên hệ với chúng tôi" @@ -1666,9 +1660,6 @@ "knownTokenWarning": { "message": "Hành động này sẽ chỉnh sửa các token đã niêm yết trong ví của bạn, kẻ xấu có thể lợi dụng việc này để lừa đảo bạn. Chỉ phê duyệt nếu bạn chắc chắn rằng bạn muốn thay đổi giá trị mà những token này đại diện cho. Tìm hiểu thêm về $1" }, - "kovan": { - "message": "Mạng thử nghiệm Kovan" - }, "lastConnected": { "message": "Đã kết nối lần cuối" }, @@ -2724,11 +2715,8 @@ "message": "Bằng cách thu hồi quyền truy cập, $1 sau đây sẽ không thể truy cập vào $2 của bạn nữa", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Mạng thử nghiệm Rinkeby" - }, - "ropsten": { - "message": "Mạng thử nghiệm Ropsten" + "revokeSpendingCapTooltipText": { + "message": "Hợp đồng này sẽ không thể chi tiêu thêm bất kỳ token hiện tại hoặc tương lai nào của bạn." }, "rpcUrl": { "message": "URL RPC mới" diff --git a/app/_locales/zh/messages.json b/app/_locales/zh/messages.json index 37d0db90632a..49f7140a6c14 100644 --- a/app/_locales/zh/messages.json +++ b/app/_locales/zh/messages.json @@ -619,18 +619,9 @@ "connectingToGoerli": { "message": "正在连接 Goerli 测试网络" }, - "connectingToKovan": { - "message": "正在连接到 Kovan 测试网络" - }, "connectingToMainnet": { "message": "正在连接到以太坊主网" }, - "connectingToRinkeby": { - "message": "正在连接到 Rinkeby 测试网络" - }, - "connectingToRopsten": { - "message": "正在连接到 Ropsten 测试网络" - }, "contactUs": { "message": "联系我们" }, @@ -1669,9 +1660,6 @@ "knownTokenWarning": { "message": "此操作将编辑已经在您的钱包中列出的代币,有肯能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" }, - "kovan": { - "message": "Kovan 测试网络" - }, "lastConnected": { "message": "最后连接" }, @@ -2734,12 +2722,6 @@ "message": "通过撤销权限,以下$1将无法再访问您的$2", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, - "rinkeby": { - "message": "Rinkeby 测试网络" - }, - "ropsten": { - "message": "Ropsten 测试网络" - }, "rpcUrl": { "message": "新的 RPC URL" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 147485e81802..80f25739e389 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -506,17 +506,11 @@ "connectingToGoerli": { "message": "正在连接 Goerli 测试网络" }, - "connectingToKovan": { - "message": "正在连接到 Kovan 测试网络" - }, "connectingToMainnet": { "message": "正在连接到以太坊 Ethereum 主网" }, - "connectingToRinkeby": { - "message": "正在连接到 Rinkeby 测试网络" - }, - "connectingToRopsten": { - "message": "正在连接到 Ropsten 测试网络" + "connectingToSepolia": { + "message": "正在连接Sepolia测试网络" }, "contactUs": { "message": "联系我们" @@ -1376,9 +1370,6 @@ "knownTokenWarning": { "message": "此操作将编辑已经在您的钱包中列出的代币,有可能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" }, - "kovan": { - "message": "Kovan 测试网络" - }, "lastConnected": { "message": "最后连接" }, @@ -2199,12 +2190,6 @@ "revealSeedWordsWarningTitle": { "message": "不要对任何人展示此账户助记词!" }, - "rinkeby": { - "message": "Rinkeby 测试网络" - }, - "ropsten": { - "message": "Ropsten 测试网络" - }, "rpcUrl": { "message": "新增 RPC URL" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 4bed5f928ef6..cfa64615f258 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -196,18 +196,9 @@ "connectingToGoerli": { "message": "連接至 Goerli 測試網路" }, - "connectingToKovan": { - "message": "連線到 Kovan 測試網路" - }, "connectingToMainnet": { "message": "連線到主 Ethereum 網路" }, - "connectingToRinkeby": { - "message": "連線到 Rinkeby 測試網路" - }, - "connectingToRopsten": { - "message": "連線到 Ropsten 測試網路" - }, "continueToWyre": { "message": "繼續至 Wyre" }, @@ -503,9 +494,6 @@ "knownAddressRecipient": { "message": "已知合約位址" }, - "kovan": { - "message": "Kovan 測試網路" - }, "learnMore": { "message": "了解更多" }, @@ -750,12 +738,6 @@ "revealSeedWordsWarningTitle": { "message": "請勿將助憶詞洩漏予他人" }, - "rinkeby": { - "message": "Rinkeby 測試網路" - }, - "ropsten": { - "message": "Ropsten 測試網路" - }, "rpcUrl": { "message": "新的 RPC URL" }, diff --git a/app/scripts/constants/contracts.js b/app/scripts/constants/contracts.js index 7afbba1f0ef3..19ed411ec57f 100644 --- a/app/scripts/constants/contracts.js +++ b/app/scripts/constants/contracts.js @@ -1,11 +1,5 @@ export const SINGLE_CALL_BALANCES_ADDRESS = '0xb1f8e55c7f64d203c1400b9d8555d050f94adf39'; -export const SINGLE_CALL_BALANCES_ADDRESS_RINKEBY = - '0x9f510b19f1ad66f0dcf6e45559fab0d6752c1db7'; -export const SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN = - '0xb8e671734ce5c8d7dfbbea5574fa4cf39f7a54a4'; -export const SINGLE_CALL_BALANCES_ADDRESS_KOVAN = - '0xb1d3fbb2f83aecd196f474c16ca5d9cffa0d0ffc'; export const SINGLE_CALL_BALANCES_ADDRESS_GOERLI = '0x9788C4E93f9002a7ad8e72633b11E8d1ecd51f9b'; // TODO(SEPOLIA) There is currently no balance call address for Sepolia diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 5dfdc2f70dcc..6e96504a66a5 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -40,9 +40,6 @@ export default class AppStateController extends EventEmitter { collectiblesDropdownState: {}, usedNetworks: { '0x1': true, - '0x2a': true, - '0x3': true, - '0x4': true, '0x5': true, '0x539': true, }, diff --git a/app/scripts/controllers/cached-balances.test.js b/app/scripts/controllers/cached-balances.test.js index 5ef473110559..fb581ef5ea0b 100644 --- a/app/scripts/controllers/cached-balances.test.js +++ b/app/scripts/controllers/cached-balances.test.js @@ -1,13 +1,13 @@ import { strict as assert } from 'assert'; import sinon from 'sinon'; -import { KOVAN_CHAIN_ID } from '../../../shared/constants/network'; +import { GOERLI_CHAIN_ID } from '../../../shared/constants/network'; import CachedBalancesController from './cached-balances'; describe('CachedBalancesController', function () { describe('updateCachedBalances', function () { it('should update the cached balances', async function () { const controller = new CachedBalancesController({ - getCurrentChainId: () => KOVAN_CHAIN_ID, + getCurrentChainId: () => GOERLI_CHAIN_ID, accountTracker: { store: { subscribe: () => undefined, @@ -27,7 +27,7 @@ describe('CachedBalancesController', function () { assert.equal(controller._generateBalancesToCache.callCount, 1); assert.deepEqual(controller._generateBalancesToCache.args[0], [ 'mockAccounts', - KOVAN_CHAIN_ID, + GOERLI_CHAIN_ID, ]); assert.equal( controller.store.getState().cachedBalances, @@ -46,7 +46,7 @@ describe('CachedBalancesController', function () { }, initState: { cachedBalances: { - [KOVAN_CHAIN_ID]: { + [GOERLI_CHAIN_ID]: { a: '0x1', b: '0x2', c: '0x3', @@ -66,11 +66,11 @@ describe('CachedBalancesController', function () { b: { balance: null }, c: { balance: '0x5' }, }, - KOVAN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert.deepEqual(result, { - [KOVAN_CHAIN_ID]: { + [GOERLI_CHAIN_ID]: { a: '0x4', b: '0x2', c: '0x5', @@ -92,7 +92,7 @@ describe('CachedBalancesController', function () { }, initState: { cachedBalances: { - [KOVAN_CHAIN_ID]: { + [GOERLI_CHAIN_ID]: { a: '0x1', b: '0x2', c: '0x3', @@ -111,7 +111,7 @@ describe('CachedBalancesController', function () { ); assert.deepEqual(result, { - [KOVAN_CHAIN_ID]: { + [GOERLI_CHAIN_ID]: { a: '0x1', b: '0x2', c: '0x3', @@ -128,7 +128,7 @@ describe('CachedBalancesController', function () { it('should subscribe to the account tracker with the updateCachedBalances method', async function () { const subscribeSpy = sinon.spy(); const controller = new CachedBalancesController({ - getCurrentChainId: () => KOVAN_CHAIN_ID, + getCurrentChainId: () => GOERLI_CHAIN_ID, accountTracker: { store: { subscribe: subscribeSpy, diff --git a/app/scripts/controllers/detect-tokens.test.js b/app/scripts/controllers/detect-tokens.test.js index f0ec07954816..7b55e9fa40cf 100644 --- a/app/scripts/controllers/detect-tokens.test.js +++ b/app/scripts/controllers/detect-tokens.test.js @@ -9,7 +9,7 @@ import { TokensController, AssetsContractController, } from '@metamask/controllers'; -import { MAINNET, ROPSTEN } from '../../../shared/constants/network'; +import { MAINNET, SEPOLIA } from '../../../shared/constants/network'; import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils'; import DetectTokensController from './detect-tokens'; import NetworkController from './network'; @@ -195,15 +195,15 @@ describe('DetectTokensController', function () { it('should not check and add tokens while on unsupported networks', async function () { sandbox.useFakeTimers(); - network.setProviderType(ROPSTEN); - const tokenListMessengerRopsten = new ControllerMessenger().getRestricted({ + network.setProviderType(SEPOLIA); + const tokenListMessengerSepolia = new ControllerMessenger().getRestricted({ name: 'TokenListController', }); tokenListController = new TokenListController({ - chainId: '3', + chainId: '11155111', onNetworkStateChange: sinon.spy(), onPreferencesStateChange: sinon.spy(), - messenger: tokenListMessengerRopsten, + messenger: tokenListMessengerSepolia, }); await tokenListController.start(); const controller = new DetectTokensController({ diff --git a/app/scripts/controllers/ens/index.test.js b/app/scripts/controllers/ens/index.test.js index d325e2885084..aa7ed8c04a98 100644 --- a/app/scripts/controllers/ens/index.test.js +++ b/app/scripts/controllers/ens/index.test.js @@ -10,7 +10,7 @@ describe('EnsController', function () { let getCurrentChainId; let onNetworkDidChange; beforeEach(function () { - currentChainId = '0x3'; + currentChainId = '0x5'; getCurrentChainId = () => currentChainId; onNetworkDidChange = sinon.spy(); }); diff --git a/app/scripts/controllers/incoming-transactions.js b/app/scripts/controllers/incoming-transactions.js index f1f81352be6c..95473937b6da 100644 --- a/app/scripts/controllers/incoming-transactions.js +++ b/app/scripts/controllers/incoming-transactions.js @@ -13,10 +13,7 @@ import { CHAIN_ID_TO_NETWORK_ID_MAP, CHAIN_ID_TO_TYPE_MAP, GOERLI_CHAIN_ID, - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, SEPOLIA_CHAIN_ID, } from '../../../shared/constants/network'; @@ -55,10 +52,7 @@ const fetchWithTimeout = getFetchWithTimeout(); */ const etherscanSupportedNetworks = [ GOERLI_CHAIN_ID, - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, SEPOLIA_CHAIN_ID, ]; @@ -84,10 +78,7 @@ export default class IncomingTransactionsController { incomingTransactions: {}, incomingTxLastFetchedBlockByChainId: { [GOERLI_CHAIN_ID]: null, - [KOVAN_CHAIN_ID]: null, [MAINNET_CHAIN_ID]: null, - [RINKEBY_CHAIN_ID]: null, - [ROPSTEN_CHAIN_ID]: null, [SEPOLIA_CHAIN_ID]: null, }, ...opts.initState, diff --git a/app/scripts/controllers/incoming-transactions.test.js b/app/scripts/controllers/incoming-transactions.test.js index 5d1d8612942d..c341ab5579e2 100644 --- a/app/scripts/controllers/incoming-transactions.test.js +++ b/app/scripts/controllers/incoming-transactions.test.js @@ -8,13 +8,10 @@ import waitUntilCalled from '../../../test/lib/wait-until-called'; import { CHAIN_ID_TO_TYPE_MAP, GOERLI_CHAIN_ID, - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, SEPOLIA_CHAIN_ID, - ROPSTEN_NETWORK_ID, - ROPSTEN, + GOERLI_NETWORK_ID, + GOERLI, } from '../../../shared/constants/network'; import { TRANSACTION_TYPES, @@ -36,18 +33,12 @@ const PREPOPULATED_INCOMING_TXS_BY_HASH = { }; const PREPOPULATED_BLOCKS_BY_NETWORK = { [GOERLI_CHAIN_ID]: 1, - [KOVAN_CHAIN_ID]: 2, [MAINNET_CHAIN_ID]: 3, - [RINKEBY_CHAIN_ID]: 5, - [ROPSTEN_CHAIN_ID]: 4, [SEPOLIA_CHAIN_ID]: 6, }; const EMPTY_BLOCKS_BY_NETWORK = { [GOERLI_CHAIN_ID]: null, - [KOVAN_CHAIN_ID]: null, [MAINNET_CHAIN_ID]: null, - [RINKEBY_CHAIN_ID]: null, - [ROPSTEN_CHAIN_ID]: null, [SEPOLIA_CHAIN_ID]: null, }; @@ -152,10 +143,7 @@ const getFakeEtherscanTransaction = ({ function nockEtherscanApiForAllChains(mockResponse) { for (const chainId of [ GOERLI_CHAIN_ID, - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, SEPOLIA_CHAIN_ID, 'undefined', ]) { @@ -251,16 +239,16 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, ); const startBlock = getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[ - ROPSTEN_CHAIN_ID + GOERLI_CHAIN_ID ]; - nock('https://api-ropsten.etherscan.io') + nock('https://api-goerli.etherscan.io') .get( `/api?module=account&action=txlist&address=${MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`, ) @@ -310,8 +298,8 @@ describe('IncomingTransactionsController', function () { '0xfake': { blockNumber: '10', hash: '0xfake', - metamaskNetworkId: ROPSTEN_NETWORK_ID, - chainId: ROPSTEN_CHAIN_ID, + metamaskNetworkId: GOERLI_NETWORK_ID, + chainId: GOERLI_CHAIN_ID, status: TRANSACTION_STATUSES.CONFIRMED, time: 16000000000000000, type: TRANSACTION_TYPES.INCOMING, @@ -327,8 +315,8 @@ describe('IncomingTransactionsController', function () { '0xfakeeip1559': { blockNumber: '10', hash: '0xfakeeip1559', - metamaskNetworkId: ROPSTEN_NETWORK_ID, - chainId: ROPSTEN_CHAIN_ID, + metamaskNetworkId: GOERLI_NETWORK_ID, + chainId: GOERLI_CHAIN_ID, status: TRANSACTION_STATUSES.CONFIRMED, time: 16000000000000000, type: TRANSACTION_TYPES.INCOMING, @@ -345,7 +333,7 @@ describe('IncomingTransactionsController', function () { }, incomingTxLastFetchedBlockByChainId: { ...getNonEmptyInitState().incomingTxLastFetchedBlockByChainId, - [ROPSTEN_CHAIN_ID]: 11, + [GOERLI_CHAIN_ID]: 11, }, }, 'State should have been updated after first block was received', @@ -453,7 +441,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -498,7 +486,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -545,7 +533,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -553,9 +541,9 @@ describe('IncomingTransactionsController', function () { const NEW_MOCK_SELECTED_ADDRESS = `${MOCK_SELECTED_ADDRESS}9`; const startBlock = getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[ - ROPSTEN_CHAIN_ID + GOERLI_CHAIN_ID ]; - nock('https://api-ropsten.etherscan.io') + nock('https://api-goerli.etherscan.io') .get( `/api?module=account&action=txlist&address=${NEW_MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`, ) @@ -608,8 +596,8 @@ describe('IncomingTransactionsController', function () { '0xfake': { blockNumber: '10', hash: '0xfake', - metamaskNetworkId: ROPSTEN_NETWORK_ID, - chainId: ROPSTEN_CHAIN_ID, + metamaskNetworkId: GOERLI_NETWORK_ID, + chainId: GOERLI_CHAIN_ID, status: TRANSACTION_STATUSES.CONFIRMED, time: 16000000000000000, type: TRANSACTION_TYPES.INCOMING, @@ -625,7 +613,7 @@ describe('IncomingTransactionsController', function () { }, incomingTxLastFetchedBlockByChainId: { ...getNonEmptyInitState().incomingTxLastFetchedBlockByChainId, - [ROPSTEN_CHAIN_ID]: 11, + [GOERLI_CHAIN_ID]: 11, }, }, 'State should have been updated after first block was received', @@ -692,7 +680,7 @@ describe('IncomingTransactionsController', function () { it('should update when switching to a supported network', async function () { const mockedNetworkMethods = - getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID); + getMockNetworkControllerMethods(GOERLI_CHAIN_ID); const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), @@ -703,9 +691,9 @@ describe('IncomingTransactionsController', function () { ); const startBlock = getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[ - ROPSTEN_CHAIN_ID + GOERLI_CHAIN_ID ]; - nock('https://api-ropsten.etherscan.io') + nock('https://api-goerli.etherscan.io') .get( `/api?module=account&action=txlist&address=${MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`, ) @@ -727,7 +715,7 @@ describe('IncomingTransactionsController', function () { const subscription = mockedNetworkMethods.onNetworkDidChange.getCall(0).args[0]; - await subscription(ROPSTEN_CHAIN_ID); + await subscription(GOERLI_CHAIN_ID); await updateStateCalled(); const actualState = incomingTransactionsController.store.getState(); @@ -748,8 +736,8 @@ describe('IncomingTransactionsController', function () { '0xfake': { blockNumber: '10', hash: '0xfake', - metamaskNetworkId: ROPSTEN_NETWORK_ID, - chainId: ROPSTEN_CHAIN_ID, + metamaskNetworkId: GOERLI_NETWORK_ID, + chainId: GOERLI_CHAIN_ID, status: TRANSACTION_STATUSES.CONFIRMED, time: 16000000000000000, type: TRANSACTION_TYPES.INCOMING, @@ -765,7 +753,7 @@ describe('IncomingTransactionsController', function () { }, incomingTxLastFetchedBlockByChainId: { ...getNonEmptyInitState().incomingTxLastFetchedBlockByChainId, - [ROPSTEN_CHAIN_ID]: 11, + [GOERLI_CHAIN_ID]: 11, }, }, 'State should have been updated after first block was received', @@ -774,7 +762,7 @@ describe('IncomingTransactionsController', function () { it('should not update when switching to an unsupported network', async function () { const mockedNetworkMethods = - getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID); + getMockNetworkControllerMethods(GOERLI_CHAIN_ID); const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), @@ -832,10 +820,10 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController({ blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getEmptyInitState(), - getCurrentChainId: () => ROPSTEN_CHAIN_ID, + getCurrentChainId: () => GOERLI_CHAIN_ID, }); sinon.spy(incomingTransactionsController.store, 'updateState'); @@ -850,14 +838,14 @@ describe('IncomingTransactionsController', function () { assert.deepStrictEqual( incomingTransactionsController._getNewIncomingTransactions.getCall(0) .args, - ['fakeAddress', 999, ROPSTEN_CHAIN_ID], + ['fakeAddress', 999, GOERLI_CHAIN_ID], ); assert.deepStrictEqual( incomingTransactionsController.store.updateState.getCall(0).args[0], { incomingTxLastFetchedBlockByChainId: { ...EMPTY_BLOCKS_BY_NETWORK, - [ROPSTEN_CHAIN_ID]: 1000, + [GOERLI_CHAIN_ID]: 1000, }, incomingTransactions: {}, }, @@ -868,10 +856,10 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController({ blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getEmptyInitState(), - getCurrentChainId: () => ROPSTEN_CHAIN_ID, + getCurrentChainId: () => GOERLI_CHAIN_ID, }); const NEW_TRANSACTION_ONE = { @@ -897,7 +885,7 @@ describe('IncomingTransactionsController', function () { assert.deepStrictEqual( incomingTransactionsController._getNewIncomingTransactions.getCall(0) .args, - ['fakeAddress', 10, ROPSTEN_CHAIN_ID], + ['fakeAddress', 10, GOERLI_CHAIN_ID], ); assert.deepStrictEqual( @@ -905,7 +893,7 @@ describe('IncomingTransactionsController', function () { { incomingTxLastFetchedBlockByChainId: { ...EMPTY_BLOCKS_BY_NETWORK, - [ROPSTEN_CHAIN_ID]: 445, + [GOERLI_CHAIN_ID]: 445, }, incomingTransactions: { [NEW_TRANSACTION_ONE.hash]: NEW_TRANSACTION_ONE, @@ -921,10 +909,10 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController({ blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), - getCurrentChainId: () => ROPSTEN_CHAIN_ID, + getCurrentChainId: () => GOERLI_CHAIN_ID, }); sinon.spy(incomingTransactionsController.store, 'updateState'); incomingTransactionsController._getNewIncomingTransactions = sinon @@ -940,7 +928,7 @@ describe('IncomingTransactionsController', function () { assert.deepStrictEqual( incomingTransactionsController._getNewIncomingTransactions.getCall(0) .args, - ['fakeAddress', 4, ROPSTEN_CHAIN_ID], + ['fakeAddress', 1, GOERLI_CHAIN_ID], ); assert.deepStrictEqual( @@ -948,8 +936,8 @@ describe('IncomingTransactionsController', function () { { incomingTxLastFetchedBlockByChainId: { ...PREPOPULATED_BLOCKS_BY_NETWORK, - [ROPSTEN_CHAIN_ID]: - PREPOPULATED_BLOCKS_BY_NETWORK[ROPSTEN_CHAIN_ID] + 1, + [GOERLI_CHAIN_ID]: + PREPOPULATED_BLOCKS_BY_NETWORK[GOERLI_CHAIN_ID] + 1, }, incomingTransactions: PREPOPULATED_INCOMING_TXS_BY_HASH, }, @@ -961,10 +949,10 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), - getCurrentChainId: () => ROPSTEN_CHAIN_ID, + getCurrentChainId: () => GOERLI_CHAIN_ID, }, ); @@ -991,7 +979,7 @@ describe('IncomingTransactionsController', function () { assert.deepStrictEqual( incomingTransactionsController._getNewIncomingTransactions.getCall(0) .args, - ['fakeAddress', 4, ROPSTEN_CHAIN_ID], + ['fakeAddress', 1, GOERLI_CHAIN_ID], ); assert.deepStrictEqual( @@ -999,7 +987,7 @@ describe('IncomingTransactionsController', function () { { incomingTxLastFetchedBlockByChainId: { ...PREPOPULATED_BLOCKS_BY_NETWORK, - [ROPSTEN_CHAIN_ID]: 445, + [GOERLI_CHAIN_ID]: 445, }, incomingTransactions: { ...PREPOPULATED_INCOMING_TXS_BY_HASH, @@ -1036,7 +1024,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1045,13 +1033,13 @@ describe('IncomingTransactionsController', function () { await incomingTransactionsController._getNewIncomingTransactions( ADDRESS_TO_FETCH_FOR, '789', - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert(mockFetch.calledOnce); assert.strictEqual( mockFetch.getCall(0).args[0], - `https://api-${ROPSTEN}.etherscan.io/api?module=account&action=txlist&address=0xfakeaddress&tag=latest&page=1&startBlock=789`, + `https://api-${GOERLI}.etherscan.io/api?module=account&action=txlist&address=0xfakeaddress&tag=latest&page=1&startBlock=789`, ); }); @@ -1082,7 +1070,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1091,13 +1079,13 @@ describe('IncomingTransactionsController', function () { await incomingTransactionsController._getNewIncomingTransactions( ADDRESS_TO_FETCH_FOR, null, - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert(mockFetch.calledOnce); assert.strictEqual( mockFetch.getCall(0).args[0], - `https://api-${ROPSTEN}.etherscan.io/api?module=account&action=txlist&address=0xfakeaddress&tag=latest&page=1`, + `https://api-${GOERLI}.etherscan.io/api?module=account&action=txlist&address=0xfakeaddress&tag=latest&page=1`, ); }); @@ -1105,7 +1093,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1115,14 +1103,14 @@ describe('IncomingTransactionsController', function () { await incomingTransactionsController._getNewIncomingTransactions( ADDRESS_TO_FETCH_FOR, '789', - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert(mockFetch.calledOnce); assert.deepStrictEqual(result, [ incomingTransactionsController._normalizeTxFromEtherscan( FETCHED_TX, - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ), ]); }); @@ -1138,7 +1126,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1148,7 +1136,7 @@ describe('IncomingTransactionsController', function () { await incomingTransactionsController._getNewIncomingTransactions( ADDRESS_TO_FETCH_FOR, '789', - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert.deepStrictEqual(result, []); window.fetch = tempFetchStatusZero; @@ -1166,7 +1154,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1176,7 +1164,7 @@ describe('IncomingTransactionsController', function () { await incomingTransactionsController._getNewIncomingTransactions( ADDRESS_TO_FETCH_FOR, '789', - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert.deepStrictEqual(result, []); window.fetch = tempFetchEmptyResult; @@ -1189,7 +1177,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1208,14 +1196,14 @@ describe('IncomingTransactionsController', function () { value: '15', hash: '0xg', }, - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert.deepStrictEqual(result, { blockNumber: 333, id: 54321, - metamaskNetworkId: ROPSTEN_NETWORK_ID, - chainId: ROPSTEN_CHAIN_ID, + metamaskNetworkId: GOERLI_NETWORK_ID, + chainId: GOERLI_CHAIN_ID, status: TRANSACTION_STATUSES.FAILED, time: 4444000, txParams: { @@ -1235,7 +1223,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1254,14 +1242,14 @@ describe('IncomingTransactionsController', function () { value: '15', hash: '0xg', }, - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert.deepStrictEqual(result, { blockNumber: 333, id: 54321, - metamaskNetworkId: ROPSTEN_NETWORK_ID, - chainId: ROPSTEN_CHAIN_ID, + metamaskNetworkId: GOERLI_NETWORK_ID, + chainId: GOERLI_CHAIN_ID, status: TRANSACTION_STATUSES.CONFIRMED, time: 4444000, txParams: { @@ -1281,7 +1269,7 @@ describe('IncomingTransactionsController', function () { const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), - ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), + ...getMockNetworkControllerMethods(GOERLI_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), }, @@ -1301,14 +1289,14 @@ describe('IncomingTransactionsController', function () { value: '15', hash: '0xg', }, - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, ); assert.deepStrictEqual(result, { blockNumber: 333, id: 54321, - metamaskNetworkId: ROPSTEN_NETWORK_ID, - chainId: ROPSTEN_CHAIN_ID, + metamaskNetworkId: GOERLI_NETWORK_ID, + chainId: GOERLI_CHAIN_ID, status: TRANSACTION_STATUSES.CONFIRMED, time: 4444000, txParams: { diff --git a/app/scripts/controllers/metametrics.test.js b/app/scripts/controllers/metametrics.test.js index c5449b90edf6..ae137807ae0f 100644 --- a/app/scripts/controllers/metametrics.test.js +++ b/app/scripts/controllers/metametrics.test.js @@ -11,7 +11,7 @@ import waitUntilCalled from '../../../test/lib/wait-until-called'; import { ETH_SYMBOL, MAINNET_CHAIN_ID, - ROPSTEN_CHAIN_ID, + GOERLI_CHAIN_ID, TEST_ETH_SYMBOL, } from '../../../shared/constants/network'; import MetaMetricsController from './metametrics'; @@ -643,7 +643,7 @@ describe('MetaMetricsController', function () { const traits = metaMetricsController._buildUserTraitsObject({ addressBook: { [MAINNET_CHAIN_ID]: [{ address: '0x' }], - [ROPSTEN_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], + [GOERLI_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], }, allCollectibles: { '0xac706cE8A9BF27Afecf080fB298d0ee13cfb978A': { @@ -674,7 +674,7 @@ describe('MetaMetricsController', function () { allTokens: MOCK_ALL_TOKENS, frequentRpcListDetail: [ { chainId: MAINNET_CHAIN_ID, ticker: ETH_SYMBOL }, - { chainId: ROPSTEN_CHAIN_ID, ticker: TEST_ETH_SYMBOL }, + { chainId: GOERLI_CHAIN_ID, ticker: TEST_ETH_SYMBOL }, { chainId: '0xaf' }, ], identities: [{}, {}], @@ -690,7 +690,7 @@ describe('MetaMetricsController', function () { [TRAITS.ADDRESS_BOOK_ENTRIES]: 3, [TRAITS.INSTALL_DATE_EXT]: '', [TRAITS.LEDGER_CONNECTION_TYPE]: 'web-hid', - [TRAITS.NETWORKS_ADDED]: [MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID, '0xaf'], + [TRAITS.NETWORKS_ADDED]: [MAINNET_CHAIN_ID, GOERLI_CHAIN_ID, '0xaf'], [TRAITS.NETWORKS_WITHOUT_TICKER]: ['0xaf'], [TRAITS.NFT_AUTODETECTION_ENABLED]: false, [TRAITS.NUMBER_OF_ACCOUNTS]: 2, @@ -709,12 +709,12 @@ describe('MetaMetricsController', function () { metaMetricsController._buildUserTraitsObject({ addressBook: { [MAINNET_CHAIN_ID]: [{ address: '0x' }], - [ROPSTEN_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], + [GOERLI_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], }, allTokens: {}, frequentRpcListDetail: [ { chainId: MAINNET_CHAIN_ID }, - { chainId: ROPSTEN_CHAIN_ID }, + { chainId: GOERLI_CHAIN_ID }, ], ledgerTransportType: 'web-hid', openSeaEnabled: true, @@ -728,14 +728,14 @@ describe('MetaMetricsController', function () { const updatedTraits = metaMetricsController._buildUserTraitsObject({ addressBook: { [MAINNET_CHAIN_ID]: [{ address: '0x' }, { address: '0x1' }], - [ROPSTEN_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], + [GOERLI_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], }, allTokens: { '0x1': { '0xabcde': [{ '0x12345': { address: '0xtestAddress' } }] }, }, frequentRpcListDetail: [ { chainId: MAINNET_CHAIN_ID }, - { chainId: ROPSTEN_CHAIN_ID }, + { chainId: GOERLI_CHAIN_ID }, ], ledgerTransportType: 'web-hid', openSeaEnabled: false, @@ -759,12 +759,12 @@ describe('MetaMetricsController', function () { metaMetricsController._buildUserTraitsObject({ addressBook: { [MAINNET_CHAIN_ID]: [{ address: '0x' }], - [ROPSTEN_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], + [GOERLI_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], }, allTokens: {}, frequentRpcListDetail: [ { chainId: MAINNET_CHAIN_ID }, - { chainId: ROPSTEN_CHAIN_ID }, + { chainId: GOERLI_CHAIN_ID }, ], ledgerTransportType: 'web-hid', openSeaEnabled: true, @@ -778,12 +778,12 @@ describe('MetaMetricsController', function () { const updatedTraits = metaMetricsController._buildUserTraitsObject({ addressBook: { [MAINNET_CHAIN_ID]: [{ address: '0x' }], - [ROPSTEN_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], + [GOERLI_CHAIN_ID]: [{ address: '0x' }, { address: '0x0' }], }, allTokens: {}, frequentRpcListDetail: [ { chainId: MAINNET_CHAIN_ID }, - { chainId: ROPSTEN_CHAIN_ID }, + { chainId: GOERLI_CHAIN_ID }, ], ledgerTransportType: 'web-hid', openSeaEnabled: true, diff --git a/app/scripts/controllers/network/network-controller.test.js b/app/scripts/controllers/network/network-controller.test.js index ec47eefdca62..64afce45a8f8 100644 --- a/app/scripts/controllers/network/network-controller.test.js +++ b/app/scripts/controllers/network/network-controller.test.js @@ -133,42 +133,6 @@ describe('NetworkController', () => { describe('utils', () => { it('getNetworkDisplayName should return the correct network name', () => { const tests = [ - { - input: '3', - expected: 'Ropsten', - }, - { - input: '4', - expected: 'Rinkeby', - }, - { - input: '42', - expected: 'Kovan', - }, - { - input: '0x3', - expected: 'Ropsten', - }, - { - input: '0x4', - expected: 'Rinkeby', - }, - { - input: '0x2a', - expected: 'Kovan', - }, - { - input: 'ropsten', - expected: 'Ropsten', - }, - { - input: 'rinkeby', - expected: 'Rinkeby', - }, - { - input: 'kovan', - expected: 'Kovan', - }, { input: 'mainnet', expected: 'Ethereum Mainnet', diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index a079307ab20c..8bc93803270b 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -10,13 +10,13 @@ import { } from 'swappable-obj-proxy'; import EthQuery from 'eth-query'; import { - RINKEBY, MAINNET, + GOERLI_CHAIN_ID, + GOERLI, INFURA_PROVIDER_TYPES, NETWORK_TYPE_RPC, NETWORK_TYPE_TO_ID_MAP, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, INFURA_BLOCKED_KEY, TEST_NETWORK_TICKER_MAP, } from '../../../../shared/constants/network'; @@ -42,9 +42,9 @@ if (process.env.IN_TEST) { }; } else if (process.env.METAMASK_DEBUG || env === 'test') { defaultProviderConfigOpts = { - type: RINKEBY, - chainId: RINKEBY_CHAIN_ID, - ticker: TEST_NETWORK_TICKER_MAP.rinkeby, + type: GOERLI, + chainId: GOERLI_CHAIN_ID, + ticker: TEST_NETWORK_TICKER_MAP.goerli, }; } else { defaultProviderConfigOpts = { type: MAINNET, chainId: MAINNET_CHAIN_ID }; diff --git a/app/scripts/controllers/network/pending-middleware.test.js b/app/scripts/controllers/network/pending-middleware.test.js index 9544dc7920f9..5b34a48c3cc2 100644 --- a/app/scripts/controllers/network/pending-middleware.test.js +++ b/app/scripts/controllers/network/pending-middleware.test.js @@ -70,7 +70,7 @@ describe('PendingNonceMiddleware', () => { gasPrice: '0x1e8480', hash: '0x2cc5a25744486f7383edebbf32003e5a66e18135799593d6b5cdd2bb43674f09', input: '0x', - nonce: '0x4', + nonce: '0x5', type: TRANSACTION_ENVELOPE_TYPES.LEGACY, to: '0xf231d46dd78806e1dd93442cf33c7671f8538748', transactionIndex: null, diff --git a/app/scripts/controllers/network/util.test.js b/app/scripts/controllers/network/util.test.js index 4ca1768cb2a0..49fda6ef8215 100644 --- a/app/scripts/controllers/network/util.test.js +++ b/app/scripts/controllers/network/util.test.js @@ -22,9 +22,9 @@ describe('network utils', () => { }, type: TRANSACTION_TYPES.SIMPLE_SEND, origin: 'other', - chainId: '0x3', + chainId: '0x5', time: 1624408066355, - metamaskNetworkId: '3', + metamaskNetworkId: '5', hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', r: '0x4c3111e42ed5eec3dcecba1e234700f387e8693c373c61c3e54a762a26f1570e', s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff', @@ -67,9 +67,9 @@ describe('network utils', () => { }, type: TRANSACTION_TYPES.SIMPLE_SEND, origin: 'other', - chainId: '0x3', + chainId: '0x5', time: 1624408066355, - metamaskNetworkId: '3', + metamaskNetworkId: '5', hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', r: '0x4c3111e42ed5eec3dcecba1e234700f387e8693c373c61c3e54a762a26f1570e', s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff', diff --git a/app/scripts/controllers/swaps.test.js b/app/scripts/controllers/swaps.test.js index e34dff016c0b..26e084d56183 100644 --- a/app/scripts/controllers/swaps.test.js +++ b/app/scripts/controllers/swaps.test.js @@ -5,7 +5,7 @@ import { ethers } from 'ethers'; import { mapValues } from 'lodash'; import BigNumber from 'bignumber.js'; import { - ROPSTEN_NETWORK_ID, + GOERLI_NETWORK_ID, MAINNET_NETWORK_ID, MAINNET_CHAIN_ID, } from '../../../shared/constants/network'; @@ -104,7 +104,7 @@ function getMockNetworkController() { store: { getState: () => { return { - network: ROPSTEN_NETWORK_ID, + network: GOERLI_NETWORK_ID, }; }, }, @@ -273,7 +273,7 @@ describe('SwapsController', function () { const currentEthersInstance = swapsController.ethersProvider; const onNetworkDidChange = networkController.on.getCall(0).args[1]; - onNetworkDidChange(ROPSTEN_NETWORK_ID); + onNetworkDidChange(GOERLI_NETWORK_ID); const newEthersInstance = swapsController.ethersProvider; assert.strictEqual( diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js index 4bbb3046d2c6..e4be03e62979 100644 --- a/app/scripts/controllers/transactions/index.test.js +++ b/app/scripts/controllers/transactions/index.test.js @@ -31,10 +31,10 @@ import { ORIGIN_METAMASK } from '../../../../shared/constants/app'; import TransactionController from '.'; const noop = () => true; -const currentNetworkId = '42'; -const currentChainId = '0x2a'; +const currentNetworkId = '5'; +const currentChainId = '0x5'; const providerConfig = { - type: 'kovan', + type: 'goerli', }; const VALID_ADDRESS = '0x0000000000000000000000000000000000000000'; @@ -940,7 +940,7 @@ describe('Transaction Controller', function () { ); const rawTx = await txController.signTransaction('1'); const ethTx = TransactionFactory.fromSerializedData(toBuffer(rawTx)); - assert.equal(ethTx.common.chainIdBN().toNumber(), 42); + assert.equal(ethTx.common.chainIdBN().toNumber(), 5); }); }); @@ -1524,11 +1524,11 @@ describe('Transaction Controller', function () { category: EVENT.CATEGORIES.TRANSACTIONS, persist: true, properties: { - chain_id: '0x2a', + chain_id: '0x5', eip_1559_version: '0', gas_edit_attempted: 'none', gas_edit_type: 'none', - network: '42', + network: '5', referrer: ORIGIN_METAMASK, source: EVENT.SOURCE.TRANSACTION.USER, transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -1606,11 +1606,11 @@ describe('Transaction Controller', function () { category: EVENT.CATEGORIES.TRANSACTIONS, persist: true, properties: { - chain_id: '0x2a', + chain_id: '0x5', eip_1559_version: '0', gas_edit_attempted: 'none', gas_edit_type: 'none', - network: '42', + network: '5', referrer: ORIGIN_METAMASK, source: EVENT.SOURCE.TRANSACTION.USER, transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -1698,11 +1698,11 @@ describe('Transaction Controller', function () { category: EVENT.CATEGORIES.TRANSACTIONS, persist: true, properties: { - chain_id: '0x2a', + chain_id: '0x5', eip_1559_version: '0', gas_edit_attempted: 'none', gas_edit_type: 'none', - network: '42', + network: '5', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -1782,11 +1782,11 @@ describe('Transaction Controller', function () { category: EVENT.CATEGORIES.TRANSACTIONS, persist: true, properties: { - chain_id: '0x2a', + chain_id: '0x5', eip_1559_version: '0', gas_edit_attempted: 'none', gas_edit_type: 'none', - network: '42', + network: '5', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -1866,11 +1866,11 @@ describe('Transaction Controller', function () { category: EVENT.CATEGORIES.TRANSACTIONS, persist: true, properties: { - chain_id: '0x2a', + chain_id: '0x5', eip_1559_version: '0', gas_edit_attempted: 'none', gas_edit_type: 'none', - network: '42', + network: '5', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -1932,11 +1932,11 @@ describe('Transaction Controller', function () { persist: true, category: EVENT.CATEGORIES.TRANSACTIONS, properties: { - network: '42', + network: '5', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, - chain_id: '0x2a', + chain_id: '0x5', eip_1559_version: '0', gas_edit_attempted: 'none', gas_edit_type: 'none', @@ -2008,11 +2008,11 @@ describe('Transaction Controller', function () { persist: true, category: EVENT.CATEGORIES.TRANSACTIONS, properties: { - chain_id: '0x2a', + chain_id: '0x5', eip_1559_version: '1', gas_edit_attempted: 'none', gas_edit_type: 'none', - network: '42', + network: '5', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, diff --git a/app/scripts/controllers/transactions/tx-gas-utils.test.js b/app/scripts/controllers/transactions/tx-gas-utils.test.js index 15386e3191ae..ed512f596899 100644 --- a/app/scripts/controllers/transactions/tx-gas-utils.test.js +++ b/app/scripts/controllers/transactions/tx-gas-utils.test.js @@ -30,14 +30,14 @@ describe('txUtils', function () { gasPrice: '0x199c82cc00', data: '0x', nonce: '0x3', - chainId: 42, + chainId: 5, }; const ethTx = TransactionFactory.fromTxData(txParams, { - common: new Common({ chain: 'kovan' }), + common: new Common({ chain: 'goerli' }), }); assert.equal( ethTx.common.chainIdBN().toNumber(), - 42, + 5, 'chainId is set from tx params', ); }); diff --git a/app/scripts/controllers/transactions/tx-state-manager.test.js b/app/scripts/controllers/transactions/tx-state-manager.test.js index 7fbe6ec1eae4..570bfa1ee1a7 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.test.js +++ b/app/scripts/controllers/transactions/tx-state-manager.test.js @@ -5,10 +5,9 @@ import { TRANSACTION_TYPES, } from '../../../../shared/constants/transaction'; import { - KOVAN_CHAIN_ID, + GOERLI_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - KOVAN_NETWORK_ID, + GOERLI_NETWORK_ID, } from '../../../../shared/constants/network'; import { GAS_LIMITS } from '../../../../shared/constants/gas'; import { ORIGIN_METAMASK } from '../../../../shared/constants/app'; @@ -49,8 +48,8 @@ function generateTransactions( } describe('TransactionStateManager', function () { let txStateManager; - const currentNetworkId = KOVAN_NETWORK_ID; - const currentChainId = KOVAN_CHAIN_ID; + const currentNetworkId = GOERLI_NETWORK_ID; + const currentChainId = GOERLI_CHAIN_ID; const otherNetworkId = '2'; beforeEach(function () { @@ -683,7 +682,7 @@ describe('TransactionStateManager', function () { if (i === 0 || i === 1) { return MAINNET_CHAIN_ID; } else if (i === 4 || i === 5) { - return RINKEBY_CHAIN_ID; + return GOERLI_CHAIN_ID; } return currentChainId; }, diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index e7a420a14527..4420f96206fd 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -16,10 +16,7 @@ import Web3 from 'web3'; import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'; import { MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, SEPOLIA_CHAIN_ID, - KOVAN_CHAIN_ID, GOERLI_CHAIN_ID, BSC_CHAIN_ID, OPTIMISM_CHAIN_ID, @@ -31,9 +28,6 @@ import { import { SINGLE_CALL_BALANCES_ADDRESS, - SINGLE_CALL_BALANCES_ADDRESS_RINKEBY, - SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN, - SINGLE_CALL_BALANCES_ADDRESS_KOVAN, SINGLE_CALL_BALANCES_ADDRESS_GOERLI, SINGLE_CALL_BALANCES_ADDRESS_SEPOLIA, SINGLE_CALL_BALANCES_ADDRESS_BSC, @@ -225,27 +219,6 @@ export default class AccountTracker { ); break; - case RINKEBY_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_RINKEBY, - ); - break; - - case ROPSTEN_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN, - ); - break; - - case KOVAN_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_KOVAN, - ); - break; - case GOERLI_CHAIN_ID: await this._updateAccountsViaBalanceChecker( addresses, diff --git a/app/scripts/lib/buy-url.js b/app/scripts/lib/buy-url.js index 47b7163ba866..f4bc06591e69 100644 --- a/app/scripts/lib/buy-url.js +++ b/app/scripts/lib/buy-url.js @@ -3,10 +3,7 @@ import log from 'loglevel'; import { SWAPS_API_V2_BASE_URL } from '../../../shared/constants/swaps'; import { GOERLI_CHAIN_ID, - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, SEPOLIA_CHAIN_ID, BUYABLE_CHAINS_MAP, } from '../../../shared/constants/network'; @@ -165,10 +162,6 @@ export default async function getBuyUrl({ chainId, address, service }) { return createCoinbasePayUrl(address, chainId); case 'metamask-faucet': return 'https://faucet.metamask.io/'; - case 'rinkeby-faucet': - return 'https://www.rinkeby.io/'; - case 'kovan-faucet': - return 'https://github.com/kovan-testnet/faucet'; case 'goerli-faucet': return 'https://goerli-faucet.slock.it/'; case 'sepolia-faucet': @@ -184,12 +177,6 @@ function getDefaultServiceForChain(chainId) { switch (chainId) { case MAINNET_CHAIN_ID: return 'wyre'; - case ROPSTEN_CHAIN_ID: - return 'metamask-faucet'; - case RINKEBY_CHAIN_ID: - return 'rinkeby-faucet'; - case KOVAN_CHAIN_ID: - return 'kovan-faucet'; case GOERLI_CHAIN_ID: return 'goerli-faucet'; case SEPOLIA_CHAIN_ID: diff --git a/app/scripts/lib/buy-url.test.js b/app/scripts/lib/buy-url.test.js index 21c3a3498883..e85dad8d8a59 100644 --- a/app/scripts/lib/buy-url.test.js +++ b/app/scripts/lib/buy-url.test.js @@ -1,9 +1,6 @@ import nock from 'nock'; import { - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, BSC_CHAIN_ID, POLYGON_CHAIN_ID, ETH_SYMBOL, @@ -20,15 +17,6 @@ const MAINNET = { amount: 5, address: ETH_ADDRESS, }; -const ROPSTEN = { - chainId: ROPSTEN_CHAIN_ID, -}; -const RINKEBY = { - chainId: RINKEBY_CHAIN_ID, -}; -const KOVAN = { - chainId: KOVAN_CHAIN_ID, -}; const BSC = { chainId: BSC_CHAIN_ID, amount: 5, @@ -100,21 +88,6 @@ describe('buy-url', () => { ); }); - it('returns metamask ropsten faucet for network 3', async () => { - const ropstenUrl = await getBuyUrl(ROPSTEN); - expect(ropstenUrl).toStrictEqual('https://faucet.metamask.io/'); - }); - - it('returns rinkeby dapp for network 4', async () => { - const rinkebyUrl = await getBuyUrl(RINKEBY); - expect(rinkebyUrl).toStrictEqual('https://www.rinkeby.io/'); - }); - - it('returns kovan github test faucet for network 42', async () => { - const kovanUrl = await getBuyUrl(KOVAN); - expect(kovanUrl).toStrictEqual('https://github.com/kovan-testnet/faucet'); - }); - it('returns a MoonPay url with a prefilled wallet address for the Ethereum network', async () => { const { moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {} } = BUYABLE_CHAINS_MAP[MAINNET.chainId]; diff --git a/app/scripts/lib/ens-ipfs/resolver.js b/app/scripts/lib/ens-ipfs/resolver.js index 94136c5e59e2..602134498ab9 100644 --- a/app/scripts/lib/ens-ipfs/resolver.js +++ b/app/scripts/lib/ens-ipfs/resolver.js @@ -80,7 +80,7 @@ function getRegistryForChainId(chainId) { case 4: case 5: case 6: - // Mainnet, Ropsten, Rinkeby, and Goerli, respectively, use the same address + // Mainnet and Goerli, respectively, use the same address return '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'; default: return null; diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 453f6cd1ea82..f2252d90fda0 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -2403,7 +2403,6 @@ export default class MetamaskController extends EventEmitter { * @type Identity * @property {string} name - The account nickname. * @property {string} address - The account's ethereum address, in lower case. - * @property {boolean} mayBeFauceting - Whether this account is currently * receiving funds from our automatic Ropsten faucet. */ diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index 21b697fd2a05..5deecd4864e9 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -120,7 +120,7 @@ const MetaMaskController = proxyquire('./metamask-controller', { './lib/createLoggerMiddleware': { default: createLoggerMiddlewareMock }, }).default; -const currentNetworkId = '42'; +const currentNetworkId = '5'; const DEFAULT_LABEL = 'Account 1'; const TEST_SEED = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium'; diff --git a/app/scripts/migrations/052.js b/app/scripts/migrations/052.js index f2469106e948..d2a474186878 100644 --- a/app/scripts/migrations/052.js +++ b/app/scripts/migrations/052.js @@ -2,15 +2,9 @@ import { cloneDeep } from 'lodash'; import { GOERLI, GOERLI_CHAIN_ID, - KOVAN, - KOVAN_CHAIN_ID, MAINNET, MAINNET_CHAIN_ID, NETWORK_TYPE_RPC, - RINKEBY, - RINKEBY_CHAIN_ID, - ROPSTEN, - ROPSTEN_CHAIN_ID, } from '../../../shared/constants/network'; const version = 52; @@ -55,21 +49,18 @@ function transformState(state = {}) { newAccountTokens[address][MAINNET_CHAIN_ID] = accountTokens[address][MAINNET]; break; - case ROPSTEN: - newAccountTokens[address][ROPSTEN_CHAIN_ID] = - accountTokens[address][ROPSTEN]; + case 'ropsten': + newAccountTokens[address]['0x3'] = accountTokens[address].ropsten; break; - case RINKEBY: - newAccountTokens[address][RINKEBY_CHAIN_ID] = - accountTokens[address][RINKEBY]; + case 'rinkeby': + newAccountTokens[address]['0x4'] = accountTokens[address].rinkeby; break; case GOERLI: newAccountTokens[address][GOERLI_CHAIN_ID] = accountTokens[address][GOERLI]; break; - case KOVAN: - newAccountTokens[address][KOVAN_CHAIN_ID] = - accountTokens[address][KOVAN]; + case 'kovan': + newAccountTokens[address]['0x2a'] = accountTokens[address].kovan; break; default: break; @@ -94,21 +85,21 @@ function transformState(state = {}) { newAccountHiddenTokens[address][MAINNET_CHAIN_ID] = accountHiddenTokens[address][MAINNET]; break; - case ROPSTEN: - newAccountHiddenTokens[address][ROPSTEN_CHAIN_ID] = - accountHiddenTokens[address][ROPSTEN]; + case 'ropsten': + newAccountHiddenTokens[address]['0x3'] = + accountHiddenTokens[address].ropsten; break; - case RINKEBY: - newAccountHiddenTokens[address][RINKEBY_CHAIN_ID] = - accountHiddenTokens[address][RINKEBY]; + case 'rinkeby': + newAccountHiddenTokens[address]['0x4'] = + accountHiddenTokens[address].rinkeby; break; case GOERLI: newAccountHiddenTokens[address][GOERLI_CHAIN_ID] = accountHiddenTokens[address][GOERLI]; break; - case KOVAN: - newAccountHiddenTokens[address][KOVAN_CHAIN_ID] = - accountHiddenTokens[address][KOVAN]; + case 'kovan': + newAccountHiddenTokens[address]['0x2a'] = + accountHiddenTokens[address].kovan; break; default: break; diff --git a/app/scripts/migrations/052.test.js b/app/scripts/migrations/052.test.js index 1a78374cb6e8..4bf2f5414b64 100644 --- a/app/scripts/migrations/052.test.js +++ b/app/scripts/migrations/052.test.js @@ -1,15 +1,9 @@ import { GOERLI, GOERLI_CHAIN_ID, - KOVAN, - KOVAN_CHAIN_ID, MAINNET, MAINNET_CHAIN_ID, NETWORK_TYPE_RPC, - RINKEBY, - RINKEBY_CHAIN_ID, - ROPSTEN, - ROPSTEN_CHAIN_ID, } from '../../../shared/constants/network'; import migration52 from './052'; @@ -85,25 +79,25 @@ describe('migration #52', () => { }); }); - it(`should move ${RINKEBY} tokens and hidden tokens to be keyed by ${RINKEBY_CHAIN_ID} for each address`, async () => { + it(`should move rinkeby tokens and hidden tokens to be keyed by '0x4' for each address`, async () => { const oldStorage = { meta: {}, data: { PreferencesController: { accountHiddenTokens: { '0x1111': { - [RINKEBY]: [TOKEN1], + rinkeby: [TOKEN1], }, '0x1112': { - [RINKEBY]: [TOKEN3], + rinkeby: [TOKEN3], }, }, accountTokens: { '0x1111': { - [RINKEBY]: [TOKEN1, TOKEN2], + rinkeby: [TOKEN1, TOKEN2], }, '0x1112': { - [RINKEBY]: [TOKEN1, TOKEN3], + rinkeby: [TOKEN1, TOKEN3], }, }, bar: 'baz', @@ -117,18 +111,18 @@ describe('migration #52', () => { PreferencesController: { accountHiddenTokens: { '0x1111': { - [RINKEBY_CHAIN_ID]: [TOKEN1], + '0x4': [TOKEN1], }, '0x1112': { - [RINKEBY_CHAIN_ID]: [TOKEN3], + '0x4': [TOKEN3], }, }, accountTokens: { '0x1111': { - [RINKEBY_CHAIN_ID]: [TOKEN1, TOKEN2], + '0x4': [TOKEN1, TOKEN2], }, '0x1112': { - [RINKEBY_CHAIN_ID]: [TOKEN1, TOKEN3], + '0x4': [TOKEN1, TOKEN3], }, }, bar: 'baz', @@ -137,25 +131,25 @@ describe('migration #52', () => { }); }); - it(`should move ${KOVAN} tokens and hidden tokens to be keyed by ${KOVAN_CHAIN_ID} for each address`, async () => { + it(`should move kovan tokens and hidden tokens to be keyed by 0x2a for each address`, async () => { const oldStorage = { meta: {}, data: { PreferencesController: { accountHiddenTokens: { '0x1111': { - [KOVAN]: [TOKEN1], + kovan: [TOKEN1], }, '0x1112': { - [KOVAN]: [TOKEN3], + kovan: [TOKEN3], }, }, accountTokens: { '0x1111': { - [KOVAN]: [TOKEN1, TOKEN2], + kovan: [TOKEN1, TOKEN2], }, '0x1112': { - [KOVAN]: [TOKEN1, TOKEN3], + kovan: [TOKEN1, TOKEN3], }, }, bar: 'baz', @@ -169,18 +163,18 @@ describe('migration #52', () => { PreferencesController: { accountHiddenTokens: { '0x1111': { - [KOVAN_CHAIN_ID]: [TOKEN1], + '0x2a': [TOKEN1], }, '0x1112': { - [KOVAN_CHAIN_ID]: [TOKEN3], + '0x2a': [TOKEN3], }, }, accountTokens: { '0x1111': { - [KOVAN_CHAIN_ID]: [TOKEN1, TOKEN2], + '0x2a': [TOKEN1, TOKEN2], }, '0x1112': { - [KOVAN_CHAIN_ID]: [TOKEN1, TOKEN3], + '0x2a': [TOKEN1, TOKEN3], }, }, bar: 'baz', @@ -241,25 +235,25 @@ describe('migration #52', () => { }); }); - it(`should move ${ROPSTEN} tokens and hidden tokens to be keyed by ${ROPSTEN_CHAIN_ID} for each address`, async () => { + it(`should move ropsten tokens and hidden tokens to be keyed by 0x3 for each address`, async () => { const oldStorage = { meta: {}, data: { PreferencesController: { accountHiddenTokens: { '0x1111': { - [ROPSTEN]: [TOKEN1], + ropsten: [TOKEN1], }, '0x1112': { - [ROPSTEN]: [TOKEN3], + ropsten: [TOKEN3], }, }, accountTokens: { '0x1111': { - [ROPSTEN]: [TOKEN1, TOKEN2], + ropsten: [TOKEN1, TOKEN2], }, '0x1112': { - [ROPSTEN]: [TOKEN1, TOKEN3], + ropsten: [TOKEN1, TOKEN3], }, }, bar: 'baz', @@ -273,18 +267,18 @@ describe('migration #52', () => { PreferencesController: { accountHiddenTokens: { '0x1111': { - [ROPSTEN_CHAIN_ID]: [TOKEN1], + '0x3': [TOKEN1], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [TOKEN3], + '0x3': [TOKEN3], }, }, accountTokens: { '0x1111': { - [ROPSTEN_CHAIN_ID]: [TOKEN1, TOKEN2], + '0x3': [TOKEN1, TOKEN2], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [TOKEN1, TOKEN3], + '0x3': [TOKEN1, TOKEN3], }, }, bar: 'baz', diff --git a/app/scripts/migrations/054.test.js b/app/scripts/migrations/054.test.js index 0e7cde9aeb51..70acabd0e38d 100644 --- a/app/scripts/migrations/054.test.js +++ b/app/scripts/migrations/054.test.js @@ -1,7 +1,4 @@ -import { - MAINNET_CHAIN_ID, - ROPSTEN_CHAIN_ID, -} from '../../../shared/constants/network'; +import { MAINNET_CHAIN_ID } from '../../../shared/constants/network'; import migration54 from './054'; describe('migration #54', () => { @@ -174,7 +171,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: '0', @@ -232,7 +229,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: 0, @@ -292,7 +289,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: 0, @@ -350,7 +347,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: 0, @@ -410,7 +407,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: '0', @@ -489,7 +486,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: 0, @@ -570,7 +567,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: '0', @@ -644,7 +641,7 @@ describe('migration #54', () => { ], }, '0x1112': { - [ROPSTEN_CHAIN_ID]: [ + '0x3': [ { address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', decimals: 0, diff --git a/app/scripts/migrations/055.js b/app/scripts/migrations/055.js index b0ab2a8442b7..f35b0a44f308 100644 --- a/app/scripts/migrations/055.js +++ b/app/scripts/migrations/055.js @@ -19,6 +19,24 @@ export default { const UNKNOWN_CHAIN_ID_KEY = 'UNKNOWN'; +const BUILT_IN_NETWORKS = {}; + +BUILT_IN_NETWORKS.rinkeby = { + networkId: '4', + chainId: '0x4', + ticker: 'ETH', +}; +BUILT_IN_NETWORKS.ropsten = { + networkId: '3', + chainId: '0x3', + ticker: 'ETH', +}; +BUILT_IN_NETWORKS.kovan = { + networkId: '42', + chainId: '0x2a', + ticker: 'ETH', +}; + function transformState(state) { if ( state?.IncomingTransactionsController?.incomingTxLastFetchedBlocksByNetwork diff --git a/app/scripts/migrations/055.test.js b/app/scripts/migrations/055.test.js index a481579b444e..c2d320acc3b1 100644 --- a/app/scripts/migrations/055.test.js +++ b/app/scripts/migrations/055.test.js @@ -1,14 +1,8 @@ import { GOERLI, GOERLI_CHAIN_ID, - KOVAN, - KOVAN_CHAIN_ID, MAINNET, MAINNET_CHAIN_ID, - RINKEBY, - RINKEBY_CHAIN_ID, - ROPSTEN, - ROPSTEN_CHAIN_ID, } from '../../../shared/constants/network'; import migration55 from './055'; @@ -42,10 +36,10 @@ describe('migration #55', () => { }, incomingTxLastFetchedBlocksByNetwork: { [MAINNET]: 1, - [ROPSTEN]: 2, - [RINKEBY]: 3, + ropsten: 2, + rinkeby: 3, [GOERLI]: 4, - [KOVAN]: 5, + kovan: 5, }, }, foo: 'bar', @@ -59,10 +53,10 @@ describe('migration #55', () => { oldStorage.data.IncomingTransactionsController.incomingTransactions, incomingTxLastFetchedBlockByChainId: { [MAINNET_CHAIN_ID]: 1, - [ROPSTEN_CHAIN_ID]: 2, - [RINKEBY_CHAIN_ID]: 3, + '0x3': 2, + '0x4': 3, [GOERLI_CHAIN_ID]: 4, - [KOVAN_CHAIN_ID]: 5, + '0x2a': 5, }, }, foo: 'bar', diff --git a/app/scripts/migrations/059.test.js b/app/scripts/migrations/059.test.js index dff53fcd1d77..4bb51f03cb2e 100644 --- a/app/scripts/migrations/059.test.js +++ b/app/scripts/migrations/059.test.js @@ -1,8 +1,6 @@ import { cloneDeep } from 'lodash'; import { - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, - RINKEBY_CHAIN_ID, GOERLI_CHAIN_ID, } from '../../../shared/constants/network'; import { @@ -33,7 +31,7 @@ const ERRONEOUS_TRANSACTION_STATE = { 2: { type: SENT_ETHER, id: 2, - chainId: KOVAN_CHAIN_ID, + chainId: '0x2a', txParams: { nonce: '0x2', }, @@ -41,7 +39,7 @@ const ERRONEOUS_TRANSACTION_STATE = { 3: { type: SENT_ETHER, id: 3, - chainId: RINKEBY_CHAIN_ID, + chainId: '0x4', txParams: { nonce: '0x3', }, @@ -49,7 +47,7 @@ const ERRONEOUS_TRANSACTION_STATE = { 4: { type: SENT_ETHER, id: 4, - chainId: RINKEBY_CHAIN_ID, + chainId: '0x4', txParams: { nonce: '0x4', }, @@ -65,7 +63,7 @@ const ERRONEOUS_TRANSACTION_STATE = { 6: { type: SENT_ETHER, id: 6, - chainId: KOVAN_CHAIN_ID, + chainId: '0x2a', txParams: { nonce: '0x6', }, @@ -73,7 +71,7 @@ const ERRONEOUS_TRANSACTION_STATE = { 7: { type: SENT_ETHER, id: 7, - chainId: RINKEBY_CHAIN_ID, + chainId: '0x4', txParams: { nonce: '0x7', }, @@ -81,7 +79,7 @@ const ERRONEOUS_TRANSACTION_STATE = { 8: { type: SENT_ETHER, id: 8, - chainId: RINKEBY_CHAIN_ID, + chainId: '0x4', txParams: { nonce: '0x8', }, @@ -89,7 +87,7 @@ const ERRONEOUS_TRANSACTION_STATE = { 9: { type: SENT_ETHER, id: 9, - chainId: RINKEBY_CHAIN_ID, + chainId: '0x4', status: TRANSACTION_STATUSES.UNAPPROVED, }, }; diff --git a/app/scripts/migrations/074.js b/app/scripts/migrations/074.js new file mode 100644 index 000000000000..0f687d7a0c60 --- /dev/null +++ b/app/scripts/migrations/074.js @@ -0,0 +1,132 @@ +import { cloneDeep, uniq } from 'lodash'; +import BigNumber from 'bignumber.js'; +import { getRpcUrl } from '../../../shared/constants/network'; + +const version = 74; + +const hexNumberIsGreaterThanZero = (hexNumber) => + new BigNumber(hexNumber || '0x0', 16).gt(0); + +const DEPRECATED_TEST_NET_CHAINIDS = ['0x3', '0x2a', '0x4']; +const DEPRECATED_TEST_NET_DETAILS = { + '0x3': { + rpcUrl: getRpcUrl({ network: 'ropsten' }), + nickname: 'Ropsten', + ticker: 'RopstenETH', + }, + '0x2a': { + rpcUrl: getRpcUrl({ network: 'kovan' }), + nickname: 'Kovan', + ticker: 'KovanETH', + }, + '0x4': { + rpcUrl: getRpcUrl({ network: 'rinkeby' }), + nickname: 'Rinkeby', + ticker: 'RinkebyETH', + }, +}; + +/** + * Migrates the user default but deprecated testnet networks to custom networks, and + * if the current network is one such network, updates the network provider details so that it + * will work as a custom rpc + */ +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) { + const PreferencesController = state?.PreferencesController || {}; + const preferences = PreferencesController.preferences || {}; + const NetworkController = state?.NetworkController || {}; + const provider = NetworkController?.provider || {}; + + const currentlyOnDeprecatedNetwork = DEPRECATED_TEST_NET_CHAINIDS.filter( + (chainId) => chainId === provider?.chainId, + ); + + // If the user does not want to see test networks, and if the the user is not on a deprecated test network, then + // no need to migrate the test network data to a custom network + if ( + !preferences.showTestNetworks && + currentlyOnDeprecatedNetwork.length === 0 + ) { + return state; + } + + const transactions = state?.TransactionController?.transactions || {}; + const cachedBalances = state.CachedBalancesController?.cachedBalances || {}; + + const deprecatedTestnetsOnWhichTheUserHasMadeATransaction = Object.values( + transactions, + ) + .filter(({ chainId }) => DEPRECATED_TEST_NET_CHAINIDS.includes(chainId)) + .map(({ chainId }) => chainId); + const deprecatedTestnetsOnWhichTheUserHasCachedBalance = + DEPRECATED_TEST_NET_CHAINIDS.filter((chainId) => { + const cachedBalancesForChain = Object.values( + cachedBalances[chainId] || {}, + ); + const userHasABalanceGreaterThanZeroOnThisChain = + cachedBalancesForChain.some(hexNumberIsGreaterThanZero); + return userHasABalanceGreaterThanZeroOnThisChain; + }); + const deprecatedTestnetsThatHaveBeenUsed = uniq([ + ...deprecatedTestnetsOnWhichTheUserHasCachedBalance, + ...deprecatedTestnetsOnWhichTheUserHasMadeATransaction, + ...currentlyOnDeprecatedNetwork, + ]); + + const newFrequentRpcListDetail = + PreferencesController.frequentRpcListDetail ?? []; + + deprecatedTestnetsThatHaveBeenUsed.forEach((chainId) => { + if ( + !newFrequentRpcListDetail.find( + (rpcDetails) => rpcDetails.chainId === chainId, + ) + ) { + newFrequentRpcListDetail.unshift({ + rpcUrl: DEPRECATED_TEST_NET_DETAILS[chainId].rpcUrl, + chainId, + ticker: DEPRECATED_TEST_NET_DETAILS[chainId].ticker, + nickname: DEPRECATED_TEST_NET_DETAILS[chainId].nickname, + rpcPrefs: {}, + }); + } + }); + + if (newFrequentRpcListDetail.length) { + PreferencesController.frequentRpcListDetail = newFrequentRpcListDetail; + } + + if (currentlyOnDeprecatedNetwork.length) { + const selectedNetworkChainId = currentlyOnDeprecatedNetwork[0]; + NetworkController.provider = { + ...NetworkController.provider, + type: 'rpc', + rpcUrl: DEPRECATED_TEST_NET_DETAILS[selectedNetworkChainId].rpcUrl, + chainId: selectedNetworkChainId, + nickname: DEPRECATED_TEST_NET_DETAILS[selectedNetworkChainId].nickname, + ticker: DEPRECATED_TEST_NET_DETAILS[selectedNetworkChainId].ticker, + }; + } + + return { + ...state, + PreferencesController: { + ...PreferencesController, + }, + NetworkController: { + ...NetworkController, + }, + }; +} diff --git a/app/scripts/migrations/074.test.js b/app/scripts/migrations/074.test.js new file mode 100644 index 000000000000..bdb03d3867f7 --- /dev/null +++ b/app/scripts/migrations/074.test.js @@ -0,0 +1,561 @@ +import migration74 from './074'; + +describe('migration #74', () => { + it('should update the version metadata', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: {}, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage.meta).toStrictEqual({ + version: 74, + }); + }); + + it('should add a deprecated testnet to custom networks if that network is currently selected and modify the provider', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0x4', + type: 'rinkeby', + }, + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + chainId: '0x4', + type: 'rpc', + rpcUrl: `https://rinkeby.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + nickname: 'Rinkeby', + ticker: 'RinkebyETH', + }, + }, + PreferencesController: { + frequentRpcListDetail: [ + { + rpcUrl: `https://rinkeby.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x4', + nickname: 'Rinkeby', + ticker: 'RinkebyETH', + rpcPrefs: {}, + }, + ], + }, + }, + }); + }); + + it('should not add a deprecated testnet to custom networks if no deprecated testnet is selected', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0xabc', + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: true, + }, + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + chainId: '0xabc', + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: true, + }, + }, + }, + }); + }); + + it('should add a deprecated testnet to custom networks if a transaction has been sent from that network', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0x1', + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + 2: { + chainId: '0x4', + }, + 3: { + chainId: '0xabc', + }, + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: true, + }, + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + chainId: '0x1', + }, + }, + PreferencesController: { + frequentRpcListDetail: [ + { + rpcUrl: `https://rinkeby.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x4', + nickname: 'Rinkeby', + ticker: 'RinkebyETH', + rpcPrefs: {}, + }, + { + rpcUrl: `https://ropsten.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x3', + nickname: 'Ropsten', + ticker: 'RopstenETH', + rpcPrefs: {}, + }, + ], + preferences: { + showTestNetworks: true, + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + 2: { + chainId: '0x4', + }, + 3: { + chainId: '0xabc', + }, + }, + }, + }, + }); + }); + + it('should add a deprecated testnet to custom networks if there is balance on that network', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0x1', + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: true, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x2a': { + '0x123456789': '0x1', + }, + }, + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + chainId: '0x1', + }, + }, + PreferencesController: { + frequentRpcListDetail: [ + { + rpcUrl: `https://kovan.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x2a', + nickname: 'Kovan', + ticker: 'KovanETH', + rpcPrefs: {}, + }, + ], + preferences: { + showTestNetworks: true, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x2a': { + '0x123456789': '0x1', + }, + }, + }, + }, + }); + }); + + it('should add all three deprecated testnets to custom networks if each has a different reason for being added', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0x2a', + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: true, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x4': { + '0x123456789': '0x1', + }, + }, + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + rpcUrl: `https://kovan.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x2a', + nickname: 'Kovan', + ticker: 'KovanETH', + type: 'rpc', + }, + }, + PreferencesController: { + frequentRpcListDetail: [ + { + rpcUrl: `https://kovan.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x2a', + nickname: 'Kovan', + ticker: 'KovanETH', + rpcPrefs: {}, + }, + { + rpcUrl: `https://ropsten.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x3', + nickname: 'Ropsten', + ticker: 'RopstenETH', + rpcPrefs: {}, + }, + { + rpcUrl: `https://rinkeby.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + chainId: '0x4', + nickname: 'Rinkeby', + ticker: 'RinkebyETH', + rpcPrefs: {}, + }, + ], + preferences: { + showTestNetworks: true, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x4': { + '0x123456789': '0x1', + }, + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + }, + }); + }); + + it('should not add deprecated testnets to custom networks if none is selected and showTestNetworks is false', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0xabc', + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: false, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x4': { + '0x123456789': '0x1', + }, + }, + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + chainId: '0xabc', + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: false, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x4': { + '0x123456789': '0x1', + }, + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + }, + }); + }); + + it('should not alter or remove existing custom networks when no deprecated testnets are being added', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0xabc', + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + PreferencesController: { + frequentRpcListDetail: [ + { + rpcUrl: `https://example.com`, + chainId: '0xdef', + ticker: 'ETH', + nickname: 'Kovan', + rpcPrefs: {}, + }, + ], + preferences: { + showTestNetworks: false, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x4': { + '0x123456789': '0x1', + }, + }, + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + chainId: '0xabc', + }, + }, + PreferencesController: { + frequentRpcListDetail: [ + { + rpcUrl: `https://example.com`, + chainId: '0xdef', + ticker: 'ETH', + nickname: 'Kovan', + rpcPrefs: {}, + }, + ], + preferences: { + showTestNetworks: false, + }, + }, + CachedBalancesController: { + cachedBalances: { + '0x4': { + '0x123456789': '0x1', + }, + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + }, + }); + }); + + it('should not modify an existing custom network with the same chainId as a deprecated testnet', async () => { + const oldStorage = { + meta: { + version: 73, + }, + data: { + NetworkController: { + provider: { + chainId: '0x1', + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: true, + }, + frequentRpcListDetail: [ + { + rpcUrl: `https://example.com`, + chainId: '0x3', + ticker: 'ETH', + nickname: 'Ropsten', + rpcPrefs: {}, + }, + ], + }, + }, + }; + + const newStorage = await migration74.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 74, + }, + data: { + NetworkController: { + provider: { + chainId: '0x1', + }, + }, + TransactionController: { + transactions: { + 1: { + chainId: '0x3', + }, + }, + }, + PreferencesController: { + preferences: { + showTestNetworks: true, + }, + frequentRpcListDetail: [ + { + rpcUrl: `https://example.com`, + chainId: '0x3', + ticker: 'ETH', + nickname: 'Ropsten', + rpcPrefs: {}, + }, + ], + }, + }, + }); + }); +}); diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index f8a6db8141b3..1fafb65bdd83 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -77,6 +77,7 @@ import m070 from './070'; import m071 from './071'; import m072 from './072'; import m073 from './073'; +import m074 from './074'; const migrations = [ m002, @@ -151,6 +152,7 @@ const migrations = [ m071, m072, m073, + m074, ]; export default migrations; diff --git a/app/scripts/migrations/migrations.test.js b/app/scripts/migrations/migrations.test.js index f1f860d903cf..4832adac5b57 100644 --- a/app/scripts/migrations/migrations.test.js +++ b/app/scripts/migrations/migrations.test.js @@ -149,11 +149,6 @@ describe('wallet1 is migrated successfully', () => { 'testnet', ); return migration13.migrate(twelfthResult); - }) - .then((thirteenthResult) => { - expect(thirteenthResult.data.config.provider.type).toStrictEqual( - 'ropsten', - ); }); }); }); diff --git a/development/states/navigate-txs.json b/development/states/navigate-txs.json index bf39420c1f24..24850ddccc70 100644 --- a/development/states/navigate-txs.json +++ b/development/states/navigate-txs.json @@ -229,7 +229,7 @@ "useETHAsPrimaryCurrency": true }, "provider": { - "type": "rinkeby" + "type": "goerli" }, "network": "4", "accounts": { @@ -276,7 +276,7 @@ "0x8cf82b5aa41ff2282427be151dd328568684007a": {}, "0xbe1a00e10ec68b154adb84e8119167146a71c9a2": {}, "0xe2f12a09ba1098312a7d1cad7581ed253ca5f4b2": { - "rinkeby": [ + "goerli": [ { "address": "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a", "decimals": 9, @@ -305,10 +305,7 @@ "conversionDate": 1538859376, "shapeShiftTxList": [], "infuraNetworkStatus": { - "kovan": "ok", "mainnet": "ok", - "rinkeby": "ok", - "ropsten": "ok", "goerli": "ok", "sepolia": "ok" } diff --git a/shared/constants/network.ts b/shared/constants/network.ts new file mode 100644 index 000000000000..759ad694e3cc --- /dev/null +++ b/shared/constants/network.ts @@ -0,0 +1,930 @@ +import { capitalize } from 'lodash'; +/** + * A type representing any valid value for 'type' for setProviderType and other + * methods that add or manipulate networks in MetaMask state. + */ +export type NetworkType = typeof NETWORK_TYPES[keyof typeof NETWORK_TYPES]; + +/** + * A union type of all possible hard-coded chain ids. This type is not + * exhaustive and cannot be used for typing chainId in areas where the user or + * dapp may specify any chainId. + */ +export type ChainId = typeof CHAIN_IDS[keyof typeof CHAIN_IDS]; + +/** + * A type that is a union type of all possible hardcoded currency symbols. + * This type is non-exhaustive, and cannot be used for areas where the user + * or dapp may supply their own symbol. + */ +type CurrencySymbol = typeof CURRENCY_SYMBOLS[keyof typeof CURRENCY_SYMBOLS]; +/** + * A type that is a union type for the supported symbols on different onramp providers. + */ +type SupportedCurrencySymbol = + typeof SUPPORTED_CURRENCY_SYMBOLS[keyof typeof SUPPORTED_CURRENCY_SYMBOLS]; +/** + * Test networks have special symbols that combine the network name and 'ETH' + * so that they are distinct from mainnet and other networks that use 'ETH'. + */ +export type TestNetworkCurrencySymbol = + typeof TEST_NETWORK_TICKER_MAP[keyof typeof TEST_NETWORK_TICKER_MAP]; + +/** + * MoonPay is a fiat onramp provider, and there are some special strings that + * inform the MoonPay API which network the user is attempting to onramp into. + * This type reflects those possible values. + */ +type MoonPayNetworkAbbreviation = 'BSC' | 'CCHAIN' | 'POLYGON'; + +/** + * MoonPay requires some settings that are configured per network that it is + * enabled on. This type describes those settings. + */ +type MoonPayChainSettings = { + /** + * What should the default onramp currency be, for example 'eth' on 'mainnet' + * This type matches a single SupportedCurrencySymbol or a + * SupportedCurrencySymbol and a MoonPayNetworkAbbreviation joined by a '_'. + */ + defaultCurrencyCode: + | SupportedCurrencySymbol + | `${SupportedCurrencySymbol}_${MoonPayNetworkAbbreviation}`; + /** + * We must also configure all possible onramp currencies we wish to support. + * This type matches either an array of SupportedCurrencySymbol or + * an array of SupportedCurrencySymbol and a MoonPayNetworkAbbreviation joined by a '_'. + */ + showOnlyCurrencies: + | SupportedCurrencySymbol[] + | `${SupportedCurrencySymbol}_${MoonPayNetworkAbbreviation}`[]; +}; + +/** + * An object containing preferences for an RPC definition + */ +type RPCPreferences = { + /** + * A URL for the block explorer for the RPC's network + */ + blockExplorerUrl: `https://${string}`; + /** + * A image reflecting the asset symbol for the network + */ + imageUrl: string; +}; + +/** + * An object that describes a network to be used inside of MetaMask + */ +type RPCDefinition = { + /** + * The hex encoded ChainId for the network + */ + chainId: ChainId; + /** + * The nickname for the network + */ + nickname: string; + /** + * The URL for the client to send network requests to + */ + rpcUrl: `https://${string}`; + /** + * The Currency Symbol for the network + */ + ticker: string; + /** + * Additional preferences for the network, such as blockExplorerUrl + */ + rpcPrefs: RPCPreferences; +}; + +/** + * Wyre is a fiat onramp provider. We must provide some settings for networks + * that support Wyre. + */ +type WyreChainSettings = { + /** + * The network name + */ + srn: string; + /** + * The native currency for the network + */ + currencyCode: CurrencySymbol; + /** + * The list of supported currencies for the Wyre onramp provider + */ + currencies: SupportedCurrencySymbol[]; +}; + +/** + * For each chain that we support fiat onramps for, we provide a set of + * configuration options that help for initializing the connectiong to the + * onramp providers. + */ +type BuyableChainSettings = { + /** + * The native currency for the given chain + */ + nativeCurrency: CurrencySymbol | TestNetworkCurrencySymbol; + /** + * The network name or identifier + */ + network: string; + /** + * The list of supported currencies for the Transak onramp provider + */ + transakCurrencies?: SupportedCurrencySymbol[]; + /** + * A configuration object for the MoonPay onramp provider + */ + moonPay?: MoonPayChainSettings; + /** + * A configuration object for the Wyre onramp provider + */ + wyre?: WyreChainSettings; + /** + * The list of supported currencies for the CoinbasePay onramp provider + */ + coinbasePayCurrencies?: SupportedCurrencySymbol[]; +}; + +/** + * Throughout the extension we set the current provider by referencing its + * "type", which can be any of the values in the below object. These values + * represent the built-in networks of MetaMask, including test nets, as well + * as "rpc" which is the "type" of a custom network added by the user or via + * wallet_addEthereumChain. + */ +export const NETWORK_TYPES = { + GOERLI: 'goerli', + LOCALHOST: 'localhost', + MAINNET: 'mainnet', + RPC: 'rpc', + SEPOLIA: 'sepolia', +} as const; + +/** + * An object containing shortcut names for any non-builtin network. We need + * this to be able to differentiate between networks that require custom + * sections of code for our various features, such as swaps or token lists. + */ +export const NETWORK_NAMES = { + HOMESTEAD: 'homestead', +}; + +/** + * The Network ID for our builtin networks. This is the decimal equivalent of + * the chain id for the network, but is expresssed as a string. Many moons ago + * the decision was made on the extension team to expressly use chainId with + * hex encoding over network id. Consider that when accessing this object. Note + * for cross product purposes: alignment with mobile on this matter has not + * been fully achieved, thus it is possible for some dependencies to still + * ask for or require network id. + */ +export const NETWORK_IDS = { + MAINNET: '1', + GOERLI: '5', + LOCALHOST: '1337', + SEPOLIA: '11155111', +} as const; + +/** + * An object containing all of the chain ids for networks both built in and + * those that we have added custom code to support our feature set. + */ +export const CHAIN_IDS = { + MAINNET: '0x1', + GOERLI: '0x5', + LOCALHOST: '0x539', + BSC: '0x38', + OPTIMISM: '0xa', + OPTIMISM_TESTNET: '0x1a4', + POLYGON: '0x89', + AVALANCHE: '0xa86a', + FANTOM: '0xfa', + CELO: '0xa4ec', + ARBITRUM: '0xa4b1', + HARMONY: '0x63564c40', + PALM: '0x2a15c308d', + SEPOLIA: '0xaa36a7', +} as const; + +/** + * The largest possible chain ID we can handle. + * Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553 + */ +export const MAX_SAFE_CHAIN_ID = 4503599627370476; + +export const MAINNET_DISPLAY_NAME = 'Ethereum Mainnet'; +export const GOERLI_DISPLAY_NAME = 'Goerli'; +export const SEPOLIA_DISPLAY_NAME = 'Sepolia'; +export const LOCALHOST_DISPLAY_NAME = 'Localhost 8545'; +export const BSC_DISPLAY_NAME = 'Binance Smart Chain'; +export const POLYGON_DISPLAY_NAME = 'Polygon'; +export const AVALANCHE_DISPLAY_NAME = 'Avalanche Network C-Chain'; +export const ARBITRUM_DISPLAY_NAME = 'Arbitrum One'; +export const BNB_DISPLAY_NAME = + 'BNB Smart Chain (previously Binance Smart Chain Mainnet)'; +export const OPTIMISM_DISPLAY_NAME = 'Optimism'; +export const FANTOM_DISPLAY_NAME = 'Fantom Opera'; +export const HARMONY_DISPLAY_NAME = 'Harmony Mainnet Shard 0'; +export const PALM_DISPLAY_NAME = 'Palm'; + +export const infuraProjectId = process.env.INFURA_PROJECT_ID; +export const getRpcUrl = ({ + network, + excludeProjectId = false, +}: { + network: NetworkType; + excludeProjectId?: boolean; +}) => + `https://${network}.infura.io/v3/${excludeProjectId ? '' : infuraProjectId}`; + +export const MAINNET_RPC_URL = getRpcUrl({ + network: NETWORK_TYPES.MAINNET, +}); +export const GOERLI_RPC_URL = getRpcUrl({ network: NETWORK_TYPES.GOERLI }); +export const SEPOLIA_RPC_URL = getRpcUrl({ network: NETWORK_TYPES.SEPOLIA }); +export const LOCALHOST_RPC_URL = 'http://localhost:8545'; + +/** + * An object containing the token symbols for various tokens that are either + * native currencies or those that have been special cased by the extension + * for supporting our feature set. + */ +export const CURRENCY_SYMBOLS = { + ARBITRUM: 'ETH', + AVALANCHE: 'AVAX', + BNB: 'BNB', + BUSD: 'BUSD', + CELO: 'CELO', + DAI: 'DAI', + ETH: 'ETH', + FANTOM: 'FTM', + HARMONY: 'ONE', + PALM: 'PALM', + MATIC: 'MATIC', + TEST_ETH: 'TESTETH', + USDC: 'USDC', + USDT: 'USDT', + WETH: 'WETH', +} as const; + +/** + * An object containing the token symbols for various tokens that are supported + * on different on ramp providers. This object is meant for internal consumption, + * hence why it is not exported. + */ +const SUPPORTED_CURRENCY_SYMBOLS = { + ...CURRENCY_SYMBOLS, + '1INCH': '1INCH', + AAVE: 'AAVE', + ABT: 'ABT', + ACH: 'ACH', + AGEUR: 'AGEUR', + AGLD: 'AGLD', + AMP: 'AMP', + ANKR: 'ANKR', + APE: 'APE', + ARPA: 'ARPA', + ASM: 'ASM', + AUCTION: 'AUCTION', + AXS: 'AXS', + AVAX: 'AVAX', + AVAXC: 'AVAXC', + AVAXCUSDC: 'AVAXCUSDC', + BADGER: 'BADGER', + BAL: 'BAL', + BAND: 'BAND', + BAT: 'BAT', + BNT: 'BNT', + BOBA: 'BOBA', + BOND: 'BOND', + BTRST: 'BTRST', + CHAIN: 'CHAIN', + CHZ: 'CHZ', + CLV: 'CLV', + COMP: 'COMP', + COTI: 'COTI', + CRO: 'CRO', + CRV: 'CRV', + CTSI: 'CTSI', + CVC: 'CVC', + DAO: 'DAO', + DDX: 'DDX', + DNT: 'DNT', + ENJ: 'ENJ', + ENS: 'ENS', + EURT: 'EURT', + FARM: 'FARM', + FET: 'FET', + FORTH: 'FORTH', + FX: 'FX', + GNO: 'GNO', + GRT: 'GRT', + GTC: 'GTC', + GTH: 'GTH', + GUSD: 'GUSD', + GYEN: 'GYEN', + HEX: 'HEX', + IOTX: 'IOTX', + IMX: 'IMX', + JASMY: 'JASMY', + KEEP: 'KEEP', + KNC: 'KNC', + KRL: 'KRL', + LCX: 'LCX', + LINK: 'LINK', + LPT: 'LPT', + LRC: 'LRC', + MANA: 'MANA', + MASK: 'MASK', + MINDS: 'MINDS', + MIR: 'MIR', + MKR: 'MKR', + MLN: 'MLN', + MTL: 'MTL', + MUSDC: 'mUSDC', + NKN: 'NKN', + NMR: 'NMR', + NU: 'NU', + OGN: 'OGN', + OMG: 'OMG', + ORN: 'ORN', + OXT: 'OXT', + PAX: 'PAX', + PERP: 'PERP', + PLA: 'PLA', + POLS: 'POLS', + POLY: 'POLY', + QNT: 'QNT', + QUICK: 'QUICK', + RAD: 'RAD', + RAI: 'RAI', + RARI: 'RARI', + REN: 'REN', + REP: 'REP', + REQ: 'REQ', + RLC: 'RLC', + RLY: 'RLY', + SAND: 'SAND', + SHIB: 'SHIB', + SKL: 'SKL', + SNX: 'SNX', + STETH: 'STETH', + STORJ: 'STORJ', + SUKU: 'SUKU', + SUSHI: 'SUSHI', + SWAP: 'SWAP', + SWFTC: 'SWFTC', + TRAC: 'TRAC', + TRB: 'TRB', + TRIBE: 'TRIBE', + TRU: 'TRU', + TXL: 'TXL', + UMA: 'UMA', + UNI: 'UNI', + USDS: 'USDS', + VRA: 'VRA', + WBTC: 'WBTC', + WCFG: 'WCFG', + XYO: 'XYO', + YFII: 'YFII', + YFI: 'YFI', + YLD: 'YLD', + ZRX: 'ZRX', + ZUSD: 'ZUSD', +} as const; + +export const ETH_TOKEN_IMAGE_URL = './images/eth_logo.svg'; +export const TEST_ETH_TOKEN_IMAGE_URL = './images/black-eth-logo.svg'; +export const BNB_TOKEN_IMAGE_URL = './images/bnb.png'; +export const MATIC_TOKEN_IMAGE_URL = './images/matic-token.png'; +export const AVAX_TOKEN_IMAGE_URL = './images/avax-token.png'; +export const AETH_TOKEN_IMAGE_URL = './images/arbitrum.svg'; +export const FTM_TOKEN_IMAGE_URL = './images/fantom-opera.svg'; +export const HARMONY_ONE_TOKEN_IMAGE_URL = './images/harmony-one.svg'; +export const OPTIMISM_TOKEN_IMAGE_URL = './images/optimism.svg'; +export const PALM_TOKEN_IMAGE_URL = './images/palm.svg'; + +export const INFURA_PROVIDER_TYPES = [ + NETWORK_TYPES.MAINNET, + NETWORK_TYPES.GOERLI, + NETWORK_TYPES.SEPOLIA, +]; + +export const TEST_CHAINS = [ + CHAIN_IDS.GOERLI, + CHAIN_IDS.SEPOLIA, + CHAIN_IDS.LOCALHOST, +]; + +const typedCapitalize = (k: K): Capitalize => + capitalize(k) as Capitalize; + +export const TEST_NETWORK_TICKER_MAP: { + [K in Exclude< + NetworkType, + 'localhost' | 'mainnet' | 'rpc' + >]: `${Capitalize}${typeof CURRENCY_SYMBOLS.ETH}`; +} = { + [NETWORK_TYPES.GOERLI]: `${typedCapitalize(NETWORK_TYPES.GOERLI)}${ + CURRENCY_SYMBOLS.ETH + }`, + [NETWORK_TYPES.SEPOLIA]: `${typedCapitalize(NETWORK_TYPES.SEPOLIA)}${ + CURRENCY_SYMBOLS.ETH + }`, +}; + +/** + * Map of all build-in Infura networks to their network, ticker and chain IDs. + */ +export const BUILT_IN_NETWORKS = { + [NETWORK_TYPES.GOERLI]: { + networkId: NETWORK_IDS.GOERLI, + chainId: CHAIN_IDS.GOERLI, + ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.GOERLI], + }, + [NETWORK_TYPES.SEPOLIA]: { + networkId: NETWORK_IDS.SEPOLIA, + chainId: CHAIN_IDS.SEPOLIA, + ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.SEPOLIA], + }, + [NETWORK_TYPES.MAINNET]: { + networkId: NETWORK_IDS.MAINNET, + chainId: CHAIN_IDS.MAINNET, + }, + [NETWORK_TYPES.LOCALHOST]: { + networkId: NETWORK_IDS.LOCALHOST, + chainId: CHAIN_IDS.LOCALHOST, + }, +} as const; + +export const NETWORK_TO_NAME_MAP = { + [NETWORK_TYPES.MAINNET]: MAINNET_DISPLAY_NAME, + [NETWORK_TYPES.GOERLI]: GOERLI_DISPLAY_NAME, + [NETWORK_TYPES.SEPOLIA]: SEPOLIA_DISPLAY_NAME, + [NETWORK_TYPES.LOCALHOST]: LOCALHOST_DISPLAY_NAME, + + [NETWORK_IDS.GOERLI]: GOERLI_DISPLAY_NAME, + [NETWORK_IDS.SEPOLIA]: SEPOLIA_DISPLAY_NAME, + [NETWORK_IDS.MAINNET]: MAINNET_DISPLAY_NAME, + [NETWORK_IDS.LOCALHOST]: LOCALHOST_DISPLAY_NAME, + + [CHAIN_IDS.GOERLI]: GOERLI_DISPLAY_NAME, + [CHAIN_IDS.SEPOLIA]: SEPOLIA_DISPLAY_NAME, + [CHAIN_IDS.MAINNET]: MAINNET_DISPLAY_NAME, + [CHAIN_IDS.LOCALHOST]: LOCALHOST_DISPLAY_NAME, +} as const; + +export const CHAIN_ID_TO_TYPE_MAP = { + [CHAIN_IDS.MAINNET]: NETWORK_TYPES.MAINNET, + [CHAIN_IDS.GOERLI]: NETWORK_TYPES.GOERLI, + [CHAIN_IDS.SEPOLIA]: NETWORK_TYPES.SEPOLIA, + [CHAIN_IDS.LOCALHOST]: NETWORK_TYPES.LOCALHOST, +} as const; + +export const CHAIN_ID_TO_RPC_URL_MAP = { + [CHAIN_IDS.GOERLI]: GOERLI_RPC_URL, + [CHAIN_IDS.SEPOLIA]: SEPOLIA_RPC_URL, + [CHAIN_IDS.MAINNET]: MAINNET_RPC_URL, + [CHAIN_IDS.LOCALHOST]: LOCALHOST_RPC_URL, +} as const; + +export const CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP = { + [CHAIN_IDS.MAINNET]: ETH_TOKEN_IMAGE_URL, + [CHAIN_IDS.AVALANCHE]: AVAX_TOKEN_IMAGE_URL, + [CHAIN_IDS.BSC]: BNB_TOKEN_IMAGE_URL, + [CHAIN_IDS.POLYGON]: MATIC_TOKEN_IMAGE_URL, + [CHAIN_IDS.ARBITRUM]: AETH_TOKEN_IMAGE_URL, + [CHAIN_IDS.FANTOM]: FTM_TOKEN_IMAGE_URL, + [CHAIN_IDS.HARMONY]: HARMONY_ONE_TOKEN_IMAGE_URL, + [CHAIN_IDS.OPTIMISM]: OPTIMISM_TOKEN_IMAGE_URL, + [CHAIN_IDS.PALM]: PALM_TOKEN_IMAGE_URL, +} as const; + +export const NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = { + [NETWORK_IDS.GOERLI]: NETWORK_TYPES.GOERLI, + [NETWORK_IDS.SEPOLIA]: NETWORK_TYPES.SEPOLIA, + [NETWORK_IDS.MAINNET]: NETWORK_NAMES.HOMESTEAD, +} as const; + +export const CHAIN_ID_TO_NETWORK_ID_MAP = { + [CHAIN_IDS.MAINNET]: NETWORK_IDS.MAINNET, + [CHAIN_IDS.GOERLI]: NETWORK_IDS.GOERLI, + [CHAIN_IDS.SEPOLIA]: NETWORK_IDS.SEPOLIA, + [CHAIN_IDS.LOCALHOST]: NETWORK_IDS.LOCALHOST, +} as const; + +export const NATIVE_CURRENCY_TOKEN_IMAGE_MAP = { + [CURRENCY_SYMBOLS.ETH]: ETH_TOKEN_IMAGE_URL, + [CURRENCY_SYMBOLS.TEST_ETH]: TEST_ETH_TOKEN_IMAGE_URL, + [CURRENCY_SYMBOLS.BNB]: BNB_TOKEN_IMAGE_URL, + [CURRENCY_SYMBOLS.MATIC]: MATIC_TOKEN_IMAGE_URL, + [CURRENCY_SYMBOLS.AVALANCHE]: AVAX_TOKEN_IMAGE_URL, +} as const; + +export const INFURA_BLOCKED_KEY = 'countryBlocked'; + +/** + * Hardforks are points in the chain where logic is changed significantly + * enough where there is a fork and the new fork becomes the active chain. + * These constants are presented in chronological order starting with BERLIN + * because when we first needed to track the hardfork we had launched support + * for EIP-2718 (where transactions can have types and different shapes) and + * EIP-2930 (optional access lists), which were included in BERLIN. + * + * BERLIN - forked at block number 12,244,000, included typed transactions and + * optional access lists + * LONDON - future, upcoming fork that introduces the baseFeePerGas, an amount + * of the ETH transaction fees that will be burned instead of given to the + * miner. This change necessitated the third type of transaction envelope to + * specify maxFeePerGas and maxPriorityFeePerGas moving the fee bidding system + * to a second price auction model. + */ +export const HARDFORKS = { + BERLIN: 'berlin', + LONDON: 'london', +} as const; + +export const CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP = { + [CHAIN_IDS.OPTIMISM]: 1, + [CHAIN_IDS.OPTIMISM_TESTNET]: 1, +}; + +/** + * Ethereum JSON-RPC methods that are known to exist but that we intentionally + * do not support. + */ +export const UNSUPPORTED_RPC_METHODS = new Set([ + // This is implemented later in our middleware stack – specifically, in + // eth-json-rpc-middleware – but our UI does not support it. + 'eth_signTransaction' as const, +]); + +export const IPFS_DEFAULT_GATEWAY_URL = 'dweb.link'; + +// The first item in transakCurrencies must be the +// default crypto currency for the network +const BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME = 'ethereum'; + +export const BUYABLE_CHAINS_MAP: { + [K in Exclude< + ChainId, + | typeof CHAIN_IDS.LOCALHOST + | typeof CHAIN_IDS.PALM + | typeof CHAIN_IDS.HARMONY + | typeof CHAIN_IDS.OPTIMISM + | typeof CHAIN_IDS.OPTIMISM_TESTNET + | typeof CHAIN_IDS.ARBITRUM + >]: BuyableChainSettings; +} = { + [CHAIN_IDS.MAINNET]: { + nativeCurrency: CURRENCY_SYMBOLS.ETH, + network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, + transakCurrencies: [ + SUPPORTED_CURRENCY_SYMBOLS.ETH, + SUPPORTED_CURRENCY_SYMBOLS['1INCH'], + SUPPORTED_CURRENCY_SYMBOLS.AAVE, + SUPPORTED_CURRENCY_SYMBOLS.AGEUR, + SUPPORTED_CURRENCY_SYMBOLS.BUSD, + SUPPORTED_CURRENCY_SYMBOLS.CHAIN, + SUPPORTED_CURRENCY_SYMBOLS.CLV, + SUPPORTED_CURRENCY_SYMBOLS.COMP, + SUPPORTED_CURRENCY_SYMBOLS.CTSI, + SUPPORTED_CURRENCY_SYMBOLS.DAI, + SUPPORTED_CURRENCY_SYMBOLS.DAO, + SUPPORTED_CURRENCY_SYMBOLS.ENJ, + SUPPORTED_CURRENCY_SYMBOLS.EURT, + SUPPORTED_CURRENCY_SYMBOLS.GTH, + SUPPORTED_CURRENCY_SYMBOLS.HEX, + SUPPORTED_CURRENCY_SYMBOLS.LINK, + SUPPORTED_CURRENCY_SYMBOLS.MANA, + SUPPORTED_CURRENCY_SYMBOLS.MASK, + SUPPORTED_CURRENCY_SYMBOLS.MINDS, + SUPPORTED_CURRENCY_SYMBOLS.MKR, + SUPPORTED_CURRENCY_SYMBOLS.PLA, + SUPPORTED_CURRENCY_SYMBOLS.POLS, + SUPPORTED_CURRENCY_SYMBOLS.SAND, + SUPPORTED_CURRENCY_SYMBOLS.STETH, + SUPPORTED_CURRENCY_SYMBOLS.SUSHI, + SUPPORTED_CURRENCY_SYMBOLS.SWAP, + SUPPORTED_CURRENCY_SYMBOLS.TXL, + SUPPORTED_CURRENCY_SYMBOLS.UNI, + SUPPORTED_CURRENCY_SYMBOLS.USDC, + SUPPORTED_CURRENCY_SYMBOLS.USDT, + SUPPORTED_CURRENCY_SYMBOLS.VRA, + SUPPORTED_CURRENCY_SYMBOLS.WBTC, + SUPPORTED_CURRENCY_SYMBOLS.YLD, + ], + moonPay: { + defaultCurrencyCode: SUPPORTED_CURRENCY_SYMBOLS.ETH, + showOnlyCurrencies: [ + SUPPORTED_CURRENCY_SYMBOLS.ETH, + SUPPORTED_CURRENCY_SYMBOLS.USDT, + SUPPORTED_CURRENCY_SYMBOLS.USDC, + SUPPORTED_CURRENCY_SYMBOLS.DAI, + SUPPORTED_CURRENCY_SYMBOLS.MATIC, + SUPPORTED_CURRENCY_SYMBOLS.ORN, + SUPPORTED_CURRENCY_SYMBOLS.WETH, + SUPPORTED_CURRENCY_SYMBOLS.IMX, + ], + }, + wyre: { + srn: 'ethereum', + currencyCode: CURRENCY_SYMBOLS.ETH, + currencies: [ + SUPPORTED_CURRENCY_SYMBOLS.ETH, + SUPPORTED_CURRENCY_SYMBOLS.AAVE, + SUPPORTED_CURRENCY_SYMBOLS.BAT, + SUPPORTED_CURRENCY_SYMBOLS.BUSD, + SUPPORTED_CURRENCY_SYMBOLS.COMP, + SUPPORTED_CURRENCY_SYMBOLS.CRV, + SUPPORTED_CURRENCY_SYMBOLS.DAI, + SUPPORTED_CURRENCY_SYMBOLS.GUSD, + SUPPORTED_CURRENCY_SYMBOLS.GYEN, + SUPPORTED_CURRENCY_SYMBOLS.LINK, + SUPPORTED_CURRENCY_SYMBOLS.MKR, + SUPPORTED_CURRENCY_SYMBOLS.PAX, + SUPPORTED_CURRENCY_SYMBOLS.RAI, + SUPPORTED_CURRENCY_SYMBOLS.SNX, + SUPPORTED_CURRENCY_SYMBOLS.UMA, + SUPPORTED_CURRENCY_SYMBOLS.UNI, + SUPPORTED_CURRENCY_SYMBOLS.USDC, + SUPPORTED_CURRENCY_SYMBOLS.USDS, + SUPPORTED_CURRENCY_SYMBOLS.USDT, + SUPPORTED_CURRENCY_SYMBOLS.WBTC, + SUPPORTED_CURRENCY_SYMBOLS.WETH, + SUPPORTED_CURRENCY_SYMBOLS.YFI, + SUPPORTED_CURRENCY_SYMBOLS.ZUSD, + ], + }, + coinbasePayCurrencies: [ + SUPPORTED_CURRENCY_SYMBOLS.ETH, + SUPPORTED_CURRENCY_SYMBOLS['1INCH'], + SUPPORTED_CURRENCY_SYMBOLS.AAVE, + SUPPORTED_CURRENCY_SYMBOLS.ABT, + SUPPORTED_CURRENCY_SYMBOLS.ACH, + SUPPORTED_CURRENCY_SYMBOLS.AGLD, + SUPPORTED_CURRENCY_SYMBOLS.AMP, + SUPPORTED_CURRENCY_SYMBOLS.ANKR, + SUPPORTED_CURRENCY_SYMBOLS.APE, + SUPPORTED_CURRENCY_SYMBOLS.ARPA, + SUPPORTED_CURRENCY_SYMBOLS.ASM, + SUPPORTED_CURRENCY_SYMBOLS.AUCTION, + SUPPORTED_CURRENCY_SYMBOLS.AXS, + SUPPORTED_CURRENCY_SYMBOLS.BADGER, + SUPPORTED_CURRENCY_SYMBOLS.BAL, + SUPPORTED_CURRENCY_SYMBOLS.BAND, + SUPPORTED_CURRENCY_SYMBOLS.BAT, + SUPPORTED_CURRENCY_SYMBOLS.BNT, + SUPPORTED_CURRENCY_SYMBOLS.BOBA, + SUPPORTED_CURRENCY_SYMBOLS.BOND, + SUPPORTED_CURRENCY_SYMBOLS.BTRST, + SUPPORTED_CURRENCY_SYMBOLS.CHZ, + SUPPORTED_CURRENCY_SYMBOLS.CLV, + SUPPORTED_CURRENCY_SYMBOLS.COMP, + SUPPORTED_CURRENCY_SYMBOLS.COTI, + SUPPORTED_CURRENCY_SYMBOLS.CRO, + SUPPORTED_CURRENCY_SYMBOLS.CRV, + SUPPORTED_CURRENCY_SYMBOLS.CTSI, + SUPPORTED_CURRENCY_SYMBOLS.CVC, + SUPPORTED_CURRENCY_SYMBOLS.DAI, + SUPPORTED_CURRENCY_SYMBOLS.DDX, + SUPPORTED_CURRENCY_SYMBOLS.DNT, + SUPPORTED_CURRENCY_SYMBOLS.ENJ, + SUPPORTED_CURRENCY_SYMBOLS.ENS, + SUPPORTED_CURRENCY_SYMBOLS.FARM, + SUPPORTED_CURRENCY_SYMBOLS.FET, + SUPPORTED_CURRENCY_SYMBOLS.FORTH, + SUPPORTED_CURRENCY_SYMBOLS.FX, + SUPPORTED_CURRENCY_SYMBOLS.GNO, + SUPPORTED_CURRENCY_SYMBOLS.GRT, + SUPPORTED_CURRENCY_SYMBOLS.GTC, + SUPPORTED_CURRENCY_SYMBOLS.IOTX, + SUPPORTED_CURRENCY_SYMBOLS.JASMY, + SUPPORTED_CURRENCY_SYMBOLS.KEEP, + SUPPORTED_CURRENCY_SYMBOLS.KNC, + SUPPORTED_CURRENCY_SYMBOLS.KRL, + SUPPORTED_CURRENCY_SYMBOLS.LCX, + SUPPORTED_CURRENCY_SYMBOLS.LINK, + SUPPORTED_CURRENCY_SYMBOLS.LPT, + SUPPORTED_CURRENCY_SYMBOLS.LRC, + SUPPORTED_CURRENCY_SYMBOLS.MANA, + SUPPORTED_CURRENCY_SYMBOLS.MASK, + SUPPORTED_CURRENCY_SYMBOLS.MATIC, + SUPPORTED_CURRENCY_SYMBOLS.MIR, + SUPPORTED_CURRENCY_SYMBOLS.MKR, + SUPPORTED_CURRENCY_SYMBOLS.MLN, + SUPPORTED_CURRENCY_SYMBOLS.MTL, + SUPPORTED_CURRENCY_SYMBOLS.NKN, + SUPPORTED_CURRENCY_SYMBOLS.NMR, + SUPPORTED_CURRENCY_SYMBOLS.NU, + SUPPORTED_CURRENCY_SYMBOLS.OGN, + SUPPORTED_CURRENCY_SYMBOLS.OMG, + SUPPORTED_CURRENCY_SYMBOLS.OXT, + SUPPORTED_CURRENCY_SYMBOLS.PAX, + SUPPORTED_CURRENCY_SYMBOLS.PERP, + SUPPORTED_CURRENCY_SYMBOLS.PLA, + SUPPORTED_CURRENCY_SYMBOLS.POLY, + SUPPORTED_CURRENCY_SYMBOLS.QNT, + SUPPORTED_CURRENCY_SYMBOLS.QUICK, + SUPPORTED_CURRENCY_SYMBOLS.RAD, + SUPPORTED_CURRENCY_SYMBOLS.RAI, + SUPPORTED_CURRENCY_SYMBOLS.RARI, + SUPPORTED_CURRENCY_SYMBOLS.REN, + SUPPORTED_CURRENCY_SYMBOLS.REP, + SUPPORTED_CURRENCY_SYMBOLS.REQ, + SUPPORTED_CURRENCY_SYMBOLS.RLC, + SUPPORTED_CURRENCY_SYMBOLS.RLY, + SUPPORTED_CURRENCY_SYMBOLS.SAND, + SUPPORTED_CURRENCY_SYMBOLS.SHIB, + SUPPORTED_CURRENCY_SYMBOLS.SKL, + SUPPORTED_CURRENCY_SYMBOLS.SNX, + SUPPORTED_CURRENCY_SYMBOLS.STORJ, + SUPPORTED_CURRENCY_SYMBOLS.SUKU, + SUPPORTED_CURRENCY_SYMBOLS.SUSHI, + SUPPORTED_CURRENCY_SYMBOLS.SWFTC, + SUPPORTED_CURRENCY_SYMBOLS.TRAC, + SUPPORTED_CURRENCY_SYMBOLS.TRB, + SUPPORTED_CURRENCY_SYMBOLS.TRIBE, + SUPPORTED_CURRENCY_SYMBOLS.TRU, + SUPPORTED_CURRENCY_SYMBOLS.UMA, + SUPPORTED_CURRENCY_SYMBOLS.UNI, + SUPPORTED_CURRENCY_SYMBOLS.USDC, + SUPPORTED_CURRENCY_SYMBOLS.USDT, + SUPPORTED_CURRENCY_SYMBOLS.WBTC, + SUPPORTED_CURRENCY_SYMBOLS.WCFG, + SUPPORTED_CURRENCY_SYMBOLS.XYO, + SUPPORTED_CURRENCY_SYMBOLS.YFII, + SUPPORTED_CURRENCY_SYMBOLS.ZRX, + ], + }, + [CHAIN_IDS.GOERLI]: { + nativeCurrency: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.GOERLI], + network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, + }, + [CHAIN_IDS.SEPOLIA]: { + nativeCurrency: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.SEPOLIA], + network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, + }, + [CHAIN_IDS.BSC]: { + nativeCurrency: CURRENCY_SYMBOLS.BNB, + network: 'bsc', + transakCurrencies: [ + SUPPORTED_CURRENCY_SYMBOLS.BNB, + SUPPORTED_CURRENCY_SYMBOLS.BUSD, + ], + moonPay: { + defaultCurrencyCode: `${SUPPORTED_CURRENCY_SYMBOLS.BNB}_BSC`, + showOnlyCurrencies: [ + `${SUPPORTED_CURRENCY_SYMBOLS.BNB}_BSC`, + `${SUPPORTED_CURRENCY_SYMBOLS.BUSD}_BSC`, + ], + }, + }, + [CHAIN_IDS.POLYGON]: { + nativeCurrency: CURRENCY_SYMBOLS.MATIC, + network: 'polygon', + transakCurrencies: [ + SUPPORTED_CURRENCY_SYMBOLS.MATIC, + SUPPORTED_CURRENCY_SYMBOLS.USDT, + SUPPORTED_CURRENCY_SYMBOLS.USDC, + SUPPORTED_CURRENCY_SYMBOLS.DAI, + ], + moonPay: { + defaultCurrencyCode: `${SUPPORTED_CURRENCY_SYMBOLS.BNB}_POLYGON`, + showOnlyCurrencies: [ + `${SUPPORTED_CURRENCY_SYMBOLS.MATIC}_POLYGON`, + `${SUPPORTED_CURRENCY_SYMBOLS.USDC}_POLYGON`, + ], + }, + wyre: { + srn: 'matic', + currencyCode: CURRENCY_SYMBOLS.MATIC, + currencies: [ + SUPPORTED_CURRENCY_SYMBOLS.MATIC, + SUPPORTED_CURRENCY_SYMBOLS.MUSDC, + ], + }, + }, + [CHAIN_IDS.AVALANCHE]: { + nativeCurrency: CURRENCY_SYMBOLS.AVALANCHE, + network: 'avaxcchain', + transakCurrencies: [SUPPORTED_CURRENCY_SYMBOLS.AVALANCHE], + moonPay: { + defaultCurrencyCode: `${SUPPORTED_CURRENCY_SYMBOLS.AVAX}_CCHAIN`, + showOnlyCurrencies: [`${SUPPORTED_CURRENCY_SYMBOLS.AVAX}_CCHAIN`], + }, + wyre: { + srn: 'avalanche', + currencyCode: CURRENCY_SYMBOLS.AVALANCHE, + currencies: [ + SUPPORTED_CURRENCY_SYMBOLS.AVALANCHE, + SUPPORTED_CURRENCY_SYMBOLS.AVAXC, + SUPPORTED_CURRENCY_SYMBOLS.AVAXCUSDC, + ], + }, + coinbasePayCurrencies: [SUPPORTED_CURRENCY_SYMBOLS.AVALANCHE], + }, + [CHAIN_IDS.FANTOM]: { + nativeCurrency: CURRENCY_SYMBOLS.FANTOM, + network: 'fantom', + transakCurrencies: [SUPPORTED_CURRENCY_SYMBOLS.FANTOM], + }, + [CHAIN_IDS.CELO]: { + nativeCurrency: CURRENCY_SYMBOLS.CELO, + network: 'celo', + transakCurrencies: [SUPPORTED_CURRENCY_SYMBOLS.CELO], + moonPay: { + defaultCurrencyCode: SUPPORTED_CURRENCY_SYMBOLS.CELO, + showOnlyCurrencies: [SUPPORTED_CURRENCY_SYMBOLS.CELO], + }, + }, +}; + +export const FEATURED_RPCS: RPCDefinition[] = [ + { + chainId: CHAIN_IDS.ARBITRUM, + nickname: ARBITRUM_DISPLAY_NAME, + rpcUrl: `https://arbitrum-mainnet.infura.io/v3/${infuraProjectId}`, + ticker: CURRENCY_SYMBOLS.ARBITRUM, + rpcPrefs: { + blockExplorerUrl: 'https://explorer.arbitrum.io', + imageUrl: AETH_TOKEN_IMAGE_URL, + }, + }, + { + chainId: CHAIN_IDS.AVALANCHE, + nickname: AVALANCHE_DISPLAY_NAME, + rpcUrl: `https://avalanche-mainnet.infura.io/v3/${infuraProjectId}`, + ticker: CURRENCY_SYMBOLS.AVALANCHE, + rpcPrefs: { + blockExplorerUrl: 'https://snowtrace.io/', + imageUrl: AVAX_TOKEN_IMAGE_URL, + }, + }, + { + chainId: CHAIN_IDS.BSC, + nickname: BNB_DISPLAY_NAME, + rpcUrl: 'https://bsc-dataseed.binance.org/', + ticker: CURRENCY_SYMBOLS.BNB, + rpcPrefs: { + blockExplorerUrl: 'https://bscscan.com/', + imageUrl: BNB_TOKEN_IMAGE_URL, + }, + }, + { + chainId: CHAIN_IDS.FANTOM, + nickname: FANTOM_DISPLAY_NAME, + rpcUrl: 'https://rpc.ftm.tools/', + ticker: CURRENCY_SYMBOLS.FANTOM, + rpcPrefs: { + blockExplorerUrl: 'https://ftmscan.com/', + imageUrl: FTM_TOKEN_IMAGE_URL, + }, + }, + { + chainId: CHAIN_IDS.HARMONY, + nickname: HARMONY_DISPLAY_NAME, + rpcUrl: 'https://api.harmony.one/', + ticker: CURRENCY_SYMBOLS.HARMONY, + rpcPrefs: { + blockExplorerUrl: 'https://explorer.harmony.one/', + imageUrl: HARMONY_ONE_TOKEN_IMAGE_URL, + }, + }, + { + chainId: CHAIN_IDS.OPTIMISM, + nickname: OPTIMISM_DISPLAY_NAME, + rpcUrl: `https://optimism-mainnet.infura.io/v3/${infuraProjectId}`, + ticker: CURRENCY_SYMBOLS.ETH, + rpcPrefs: { + blockExplorerUrl: 'https://optimistic.etherscan.io/', + imageUrl: OPTIMISM_TOKEN_IMAGE_URL, + }, + }, + { + chainId: CHAIN_IDS.PALM, + nickname: PALM_DISPLAY_NAME, + rpcUrl: `https://palm-mainnet.infura.io/v3/${infuraProjectId}`, + ticker: CURRENCY_SYMBOLS.PALM, + rpcPrefs: { + blockExplorerUrl: 'https://explorer.palm.io/', + imageUrl: PALM_TOKEN_IMAGE_URL, + }, + }, + { + chainId: CHAIN_IDS.POLYGON, + nickname: `${POLYGON_DISPLAY_NAME} ${capitalize(NETWORK_TYPES.MAINNET)}`, + rpcUrl: `https://polygon-mainnet.infura.io/v3/${infuraProjectId}`, + ticker: CURRENCY_SYMBOLS.MATIC, + rpcPrefs: { + blockExplorerUrl: 'https://polygonscan.com/', + imageUrl: MATIC_TOKEN_IMAGE_URL, + }, + }, +]; diff --git a/test/data/mock-pending-transaction-data.json b/test/data/mock-pending-transaction-data.json index 62f072c10965..26ce780eb027 100644 --- a/test/data/mock-pending-transaction-data.json +++ b/test/data/mock-pending-transaction-data.json @@ -5,8 +5,8 @@ "id": 6854191329910881, "time": 1631558469046, "status": "approved", - "metamaskNetworkId": "42", - "chainId": "0x2a", + "metamaskNetworkId": "5", + "chainId": "0x5", "loadingDefaults": false, "dappSuggestedGasFees": null, "txParams": { @@ -25,8 +25,8 @@ "id": 6854191329910881, "time": 1631558469046, "status": "unapproved", - "metamaskNetworkId": "42", - "chainId": "0x2a", + "metamaskNetworkId": "5", + "chainId": "0x5", "loadingDefaults": true, "dappSuggestedGasFees": null, "txParams": { @@ -81,8 +81,8 @@ "id": 6854191329910881, "time": 1631558469046, "status": "approved", - "metamaskNetworkId": "42", - "chainId": "0x2a", + "metamaskNetworkId": "5", + "chainId": "0x5", "loadingDefaults": false, "dappSuggestedGasFees": null, "txParams": { @@ -101,8 +101,8 @@ "id": 6854191329910881, "time": 1631558469046, "status": "unapproved", - "metamaskNetworkId": "42", - "chainId": "0x2a", + "metamaskNetworkId": "5", + "chainId": "0x5", "loadingDefaults": true, "dappSuggestedGasFees": null, "txParams": { @@ -158,8 +158,8 @@ "id": 6854191329910881, "time": 1631558469046, "status": "approved", - "metamaskNetworkId": "42", - "chainId": "0x2a", + "metamaskNetworkId": "5", + "chainId": "0x5", "loadingDefaults": false, "dappSuggestedGasFees": null, "txParams": { @@ -178,8 +178,8 @@ "id": 6854191329910881, "time": 1631558469046, "status": "unapproved", - "metamaskNetworkId": "42", - "chainId": "0x2a", + "metamaskNetworkId": "5", + "chainId": "0x5", "loadingDefaults": true, "dappSuggestedGasFees": null, "txParams": { diff --git a/test/data/mock-state.json b/test/data/mock-state.json index b378b37c4559..96a16826c422 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -49,9 +49,10 @@ "featureFlags": { "showIncomingTransactions": true }, - "network": "4", + "network": "5", "provider": { - "chainId": "0x4" + "type": "rpc", + "chainId": "0x5" }, "keyrings": [ { @@ -181,10 +182,10 @@ "nativeCurrency": "ETH", "conversionRate": 556.12, "addressBook": { - "0x4": { + "0x5": { "0xc42edfcc21ed14dda456aa0756c153f7985d8813": { "address": "0xc42edfcc21ed14dda456aa0756c153f7985d8813", - "chainId": "0x4", + "chainId": "0x5", "isEns": false, "memo": "", "name": "Address Book Account 1" diff --git a/test/data/mock-tx-history.json b/test/data/mock-tx-history.json index 5a78af315065..790dd44fae5d 100644 --- a/test/data/mock-tx-history.json +++ b/test/data/mock-tx-history.json @@ -5,21 +5,21 @@ "id": 6616756286038869, "time": 1502438908445, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "history": [ { "id": 6616756286038869, "time": 1502438908445, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -32,7 +32,7 @@ "id": 6616756286038869, "time": 1502438908445, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -45,7 +45,7 @@ "id": 6616756286038869, "time": 1502438908445, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -58,7 +58,7 @@ "id": 6616756286038869, "time": 1502438908445, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -71,7 +71,7 @@ "id": 6616756286038869, "time": 1502438908445, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -91,7 +91,7 @@ "id": 6616756286038869, "time": 1502438908445, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -111,14 +111,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -131,14 +131,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -151,14 +151,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -172,14 +172,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -193,14 +193,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -215,14 +215,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -237,14 +237,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -259,14 +259,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -281,14 +281,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -304,14 +304,14 @@ "id": 6616756286038869, "time": 1502438908445, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "value": "0x0", "gasPrice": "0x3b9aca00", "gas": "0x7b0d", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16643c", @@ -338,7 +338,7 @@ "id": 6616756286038870, "time": 1502573153664, "status": "rejected", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -351,7 +351,7 @@ "id": 6616756286038870, "time": 1502573153664, "status": "rejected", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -364,7 +364,7 @@ "id": 6616756286038870, "time": 1502573153664, "status": "rejected", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -379,7 +379,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -387,14 +387,14 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "history": [ { "id": 6616756286038871, "time": 1502573157128, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -407,7 +407,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -420,7 +420,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -433,7 +433,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -446,7 +446,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -466,7 +466,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -486,7 +486,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -494,7 +494,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -507,7 +507,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -515,7 +515,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -528,7 +528,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -536,7 +536,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -550,7 +550,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -558,7 +558,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -572,7 +572,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -580,7 +580,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -595,7 +595,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -603,7 +603,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -618,7 +618,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -626,7 +626,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -641,7 +641,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -649,7 +649,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -664,7 +664,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -672,7 +672,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -688,7 +688,7 @@ "id": 6616756286038871, "time": 1502573157128, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -696,7 +696,7 @@ "gasPrice": "0x28fa6ae00", "gas": "0x7b0d", "nonce": "0x01", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x168739", @@ -723,7 +723,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -731,14 +731,14 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "history": [ { "id": 6616756286038872, "time": 1502734903652, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -751,7 +751,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -764,7 +764,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -777,7 +777,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -790,7 +790,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -810,7 +810,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -830,7 +830,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -838,7 +838,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -851,7 +851,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -859,7 +859,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -872,7 +872,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -880,7 +880,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -894,7 +894,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -902,7 +902,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -916,7 +916,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -924,7 +924,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -939,7 +939,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -947,7 +947,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -962,7 +962,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -970,7 +970,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -985,7 +985,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -993,7 +993,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -1008,7 +1008,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1016,7 +1016,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -1032,7 +1032,7 @@ "id": 6616756286038872, "time": 1502734903652, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1040,7 +1040,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x02", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b066", @@ -1067,7 +1067,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1075,14 +1075,14 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "history": [ { "id": 6616756286038873, "time": 1502734910224, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1095,7 +1095,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1108,7 +1108,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1121,7 +1121,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1134,7 +1134,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1154,7 +1154,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1174,7 +1174,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1182,7 +1182,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1195,7 +1195,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1203,7 +1203,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1216,7 +1216,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1224,7 +1224,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1238,7 +1238,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1246,7 +1246,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1260,7 +1260,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1268,7 +1268,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1283,7 +1283,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1291,7 +1291,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1306,7 +1306,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1314,7 +1314,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1329,7 +1329,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1337,7 +1337,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1352,7 +1352,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1360,7 +1360,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1376,7 +1376,7 @@ "id": 6616756286038873, "time": 1502734910224, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1384,7 +1384,7 @@ "gasPrice": "0x3b9aca00", "gas": "0x7b0d", "nonce": "0x03", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1411,7 +1411,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1419,14 +1419,14 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "history": [ { "id": 6616756286038874, "time": 1502734917414, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1439,7 +1439,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1452,7 +1452,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1465,7 +1465,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1478,7 +1478,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1498,7 +1498,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1518,7 +1518,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1526,7 +1526,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1539,7 +1539,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1547,7 +1547,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1560,7 +1560,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1568,7 +1568,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1582,7 +1582,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1590,7 +1590,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1604,7 +1604,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1612,7 +1612,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1627,7 +1627,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1635,7 +1635,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1650,7 +1650,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1658,7 +1658,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1673,7 +1673,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1681,7 +1681,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1696,7 +1696,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1704,7 +1704,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1720,7 +1720,7 @@ "id": 6616756286038874, "time": 1502734917414, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1728,7 +1728,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x04", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b067", @@ -1755,7 +1755,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1763,14 +1763,14 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "history": [ { "id": 6616756286038875, "time": 1502734922745, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1783,7 +1783,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "unapproved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1796,7 +1796,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1809,7 +1809,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1822,7 +1822,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1842,7 +1842,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "approved", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1862,7 +1862,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1870,7 +1870,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -1883,7 +1883,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1891,7 +1891,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -1904,7 +1904,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1912,7 +1912,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -1926,7 +1926,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1934,7 +1934,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -1948,7 +1948,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1956,7 +1956,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -1971,7 +1971,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "signed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -1979,7 +1979,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -1994,7 +1994,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -2002,7 +2002,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -2017,7 +2017,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "submitted", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -2025,7 +2025,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -2040,7 +2040,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -2048,7 +2048,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", @@ -2064,7 +2064,7 @@ "id": 6616756286038875, "time": 1502734922745, "status": "confirmed", - "metamaskNetworkId": "3", + "metamaskNetworkId": "5", "txParams": { "from": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", "to": "0x3ae39e89dc7e736cce53091057a45bf44b1a566c", @@ -2072,7 +2072,7 @@ "gasPrice": "0x4a817c800", "gas": "0x7b0d", "nonce": "0x05", - "chainId": 3 + "chainId": 5 }, "nonceDetails": { "blockNumber": "0x16b068", diff --git a/test/data/transaction-data.json b/test/data/transaction-data.json index b3f2b05c5fe8..24d1deaf7ac7 100644 --- a/test/data/transaction-data.json +++ b/test/data/transaction-data.json @@ -864,10 +864,10 @@ "id": 1441203963845330, "time": 1652206763566, "status": "confirmed", - "metamaskNetworkId": "4", + "metamaskNetworkId": "5", "originalGasEstimate": "0x118e0", "userEditedGasLimit": false, - "chainId": "0x4", + "chainId": "0x5", "loadingDefaults": false, "dappSuggestedGasFees": { "maxPriorityFeePerGas": "0x3B9ACA00", @@ -884,7 +884,7 @@ "maxFeePerGas": "0x7be830aec", "maxPriorityFeePerGas": "0x3B9ACA00" }, - "origin": "https://rinkeby.etherscan.io", + "origin": "https://goerli.etherscan.io", "type": "safetransferfrom", "userFeeLevel": "dappSuggested", "defaultGasEstimates": { @@ -980,10 +980,10 @@ "id": 1441203963845330, "time": 1652206763566, "status": "confirmed", - "metamaskNetworkId": "4", + "metamaskNetworkId": "5", "originalGasEstimate": "0x118e0", "userEditedGasLimit": false, - "chainId": "0x4", + "chainId": "0x5", "loadingDefaults": false, "dappSuggestedGasFees": { "maxPriorityFeePerGas": "0x3B9ACA00", @@ -1000,7 +1000,7 @@ "maxFeePerGas": "0x7be830aec", "maxPriorityFeePerGas": "0x3B9ACA00" }, - "origin": "https://rinkeby.etherscan.io", + "origin": "https://goerli.etherscan.io", "type": "safetransferfrom", "userFeeLevel": "dappSuggested", "defaultGasEstimates": { @@ -1095,10 +1095,10 @@ "id": 1441203963845330, "time": 1652206763566, "status": "confirmed", - "metamaskNetworkId": "4", + "metamaskNetworkId": "5", "originalGasEstimate": "0x118e0", "userEditedGasLimit": false, - "chainId": "0x4", + "chainId": "0x5", "loadingDefaults": false, "dappSuggestedGasFees": { "maxPriorityFeePerGas": "0x3B9ACA00", @@ -1115,7 +1115,7 @@ "maxFeePerGas": "0x7be830aec", "maxPriorityFeePerGas": "0x3B9ACA00" }, - "origin": "https://rinkeby.etherscan.io", + "origin": "https://goerli.etherscan.io", "type": "safetransferfrom", "userFeeLevel": "dappSuggested", "defaultGasEstimates": { diff --git a/test/e2e/fixtures/address-entry/state.json b/test/e2e/fixtures/address-entry/state.json index 5fbf10276bc8..ac1a8ebe549d 100644 --- a/test/e2e/fixtures/address-entry/state.json +++ b/test/e2e/fixtures/address-entry/state.json @@ -33,10 +33,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -128,8 +126,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/connected-state/state.json b/test/e2e/fixtures/connected-state/state.json index 28a20607193f..d2d00fb4a777 100644 --- a/test/e2e/fixtures/connected-state/state.json +++ b/test/e2e/fixtures/connected-state/state.json @@ -22,10 +22,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, "sepolia": null, - "rinkeby": 5570536, "localhost": 98 } }, @@ -130,8 +128,8 @@ "frequentRpcListDetail": [], "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/custom-rpc/state.json b/test/e2e/fixtures/custom-rpc/state.json index 8088a1799dc1..0019533a1f9b 100644 --- a/test/e2e/fixtures/custom-rpc/state.json +++ b/test/e2e/fixtures/custom-rpc/state.json @@ -19,10 +19,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -130,8 +128,8 @@ ], "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/custom-token/state.json b/test/e2e/fixtures/custom-token/state.json index 5f447420b251..50dc7d9b0e02 100644 --- a/test/e2e/fixtures/custom-token/state.json +++ b/test/e2e/fixtures/custom-token/state.json @@ -17,7 +17,7 @@ }, "CachedBalancesController": { "cachedBalances": { - "0x4": { + "0x5": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": "0x0" } } @@ -35,10 +35,7 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlockByChainId": { "0x1": null, - "0x2a": null, - "0x3": null, - "0x4": 8977934, - "0x5": null + "0x5": 8977934 } }, "KeyringController": { @@ -54,9 +51,9 @@ "EIPS": {} }, "previousProviderStore": { - "chainId": "0x4", + "chainId": "0x5", "ticker": "ETH", - "type": "rinkeby" + "type": "goerli" }, "provider": { "chainId": "0x539", diff --git a/test/e2e/fixtures/eip-1559-v2-dapp/state.json b/test/e2e/fixtures/eip-1559-v2-dapp/state.json index 1b01bc0778c9..5c6d28bed7d7 100644 --- a/test/e2e/fixtures/eip-1559-v2-dapp/state.json +++ b/test/e2e/fixtures/eip-1559-v2-dapp/state.json @@ -20,10 +20,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -115,8 +113,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/eip-1559-v2/state.json b/test/e2e/fixtures/eip-1559-v2/state.json index 0341d4ecbaa0..c39d6bfdc9d4 100644 --- a/test/e2e/fixtures/eip-1559-v2/state.json +++ b/test/e2e/fixtures/eip-1559-v2/state.json @@ -20,10 +20,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -115,8 +113,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/imported-account/state.json b/test/e2e/fixtures/imported-account/state.json index d89d6e2cf7b2..260316da3a88 100644 --- a/test/e2e/fixtures/imported-account/state.json +++ b/test/e2e/fixtures/imported-account/state.json @@ -19,10 +19,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -114,8 +112,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/localization/state.json b/test/e2e/fixtures/localization/state.json index d5ba38d28493..632f3d6f16c0 100644 --- a/test/e2e/fixtures/localization/state.json +++ b/test/e2e/fixtures/localization/state.json @@ -19,10 +19,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -114,8 +112,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/metrics-enabled/state.json b/test/e2e/fixtures/metrics-enabled/state.json index 683f6cda6d4f..22f1602203a8 100644 --- a/test/e2e/fixtures/metrics-enabled/state.json +++ b/test/e2e/fixtures/metrics-enabled/state.json @@ -22,10 +22,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, "sepolia": null, - "rinkeby": 5570536, "localhost": 98 } }, @@ -130,8 +128,8 @@ "frequentRpcListDetail": [], "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/navigate-transactions/state.json b/test/e2e/fixtures/navigate-transactions/state.json index 8d4734d54e08..6549e2de8919 100644 --- a/test/e2e/fixtures/navigate-transactions/state.json +++ b/test/e2e/fixtures/navigate-transactions/state.json @@ -19,10 +19,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -114,8 +112,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/send-edit-v2/state.json b/test/e2e/fixtures/send-edit-v2/state.json index b414cf8d3a0b..c5ec33d5105e 100644 --- a/test/e2e/fixtures/send-edit-v2/state.json +++ b/test/e2e/fixtures/send-edit-v2/state.json @@ -20,10 +20,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -115,8 +113,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/send-edit/state.json b/test/e2e/fixtures/send-edit/state.json index 30eee4e908a8..14795e55e2e8 100644 --- a/test/e2e/fixtures/send-edit/state.json +++ b/test/e2e/fixtures/send-edit/state.json @@ -20,10 +20,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -115,8 +113,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/special-settings/state.json b/test/e2e/fixtures/special-settings/state.json index 57a4cd2c9dc8..b1bdad525619 100644 --- a/test/e2e/fixtures/special-settings/state.json +++ b/test/e2e/fixtures/special-settings/state.json @@ -19,10 +19,8 @@ "incomingTransactions": {}, "incomingTxLastFetchedBlocksByNetwork": { "goerli": null, - "kovan": null, "mainnet": null, - "sepolia": null, - "rinkeby": 5570536 + "sepolia": null } }, "KeyringController": { @@ -108,8 +106,8 @@ "PreferencesController": { "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] + "goerli": [], + "sepolia": [] } }, "assetImages": {}, diff --git a/test/e2e/fixtures/threebox-enabled/state.json b/test/e2e/fixtures/threebox-enabled/state.json index e7b7d10a42b9..ea1ab3b37e89 100644 --- a/test/e2e/fixtures/threebox-enabled/state.json +++ b/test/e2e/fixtures/threebox-enabled/state.json @@ -22,10 +22,9 @@ "IncomingTransactionsController": { "incomingTransactions": {}, "incomingTxLastFetchedBlockByChainId": { - "0x5": null, - "0x2a": null, + "0xaa36a7": null, "0x1": null, - "0x4": 5570536 + "0x5": 5570536 } }, "KeyringController": { @@ -101,8 +100,8 @@ ], "accountTokens": { "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "0x4": [], - "0x3": [] + "0x5": [], + "0xaa36a7": [] } }, "accountHiddenTokens": {}, diff --git a/test/e2e/mock-e2e.js b/test/e2e/mock-e2e.js index 785ec4c00b98..a2391b1cab7d 100644 --- a/test/e2e/mock-e2e.js +++ b/test/e2e/mock-e2e.js @@ -1,9 +1,6 @@ const blacklistedHosts = [ 'goerli.infura.io', - 'kovan.infura.io', 'mainnet.infura.io', - 'rinkeby.infura.io', - 'ropsten.infura.io', 'sepolia.infura.io', ]; diff --git a/test/stub/tx-meta-stub.js b/test/stub/tx-meta-stub.js index c33ab758c152..8640998f4275 100644 --- a/test/stub/tx-meta-stub.js +++ b/test/stub/tx-meta-stub.js @@ -11,7 +11,7 @@ export const txMetaStub = { { id: 405984854664302, loadingDefaults: true, - metamaskNetworkId: '4', + metamaskNetworkId: '5', status: TRANSACTION_STATUSES.UNAPPROVED, time: 1572395156620, type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -56,7 +56,7 @@ export const txMetaStub = { op: 'add', path: '/txParams/nonce', timestamp: 1572395158261, - value: '0x4', + value: '0x5', }, { op: 'add', @@ -163,7 +163,7 @@ export const txMetaStub = { ], id: 405984854664302, loadingDefaults: false, - metamaskNetworkId: '4', + metamaskNetworkId: '5', nonceDetails: { local: { details: { @@ -200,7 +200,7 @@ export const txMetaStub = { from: '0xf231d46dd78806e1dd93442cf33c7671f8538748', gas: GAS_LIMITS.SIMPLE, gasPrice: '0x1e8480', - nonce: '0x4', + nonce: '0x5', to: '0xf231d46dd78806e1dd93442cf33c7671f8538748', value: '0x0', }, diff --git a/test/test-results/junit.xml b/test/test-results/junit.xml new file mode 100644 index 000000000000..400f40ec76ef --- /dev/null +++ b/test/test-results/junit.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js b/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js index cc5f64a9f0df..651e2feadacf 100644 --- a/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js +++ b/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js @@ -10,7 +10,6 @@ import { tick } from '../../../../../test/lib/tick'; import { renderWithProvider } from '../../../../../test/lib/render-helpers'; import * as actions from '../../../../store/actions'; -import { KOVAN_CHAIN_ID } from '../../../../../shared/constants/network'; import UnconnectedAccountAlert from '.'; describe('Unconnected Account Alert', () => { @@ -39,7 +38,7 @@ describe('Unconnected Account Alert', () => { }; const cachedBalances = { - [KOVAN_CHAIN_ID]: { + '0x2a': { '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': '0x0', '0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b': '0x0', }, @@ -63,7 +62,7 @@ describe('Unconnected Account Alert', () => { cachedBalances, keyrings, provider: { - chainId: KOVAN_CHAIN_ID, + chainId: '0x2a', }, permissionHistory: { 'https://test.dapp': { diff --git a/ui/components/app/collectible-details/collectible-details.js b/ui/components/app/collectible-details/collectible-details.js index 7ad4b26220f6..c81770259d38 100644 --- a/ui/components/app/collectible-details/collectible-details.js +++ b/ui/components/app/collectible-details/collectible-details.js @@ -35,11 +35,8 @@ import { } from '../../../store/actions'; import { GOERLI_CHAIN_ID, - KOVAN_CHAIN_ID, MAINNET_CHAIN_ID, POLYGON_CHAIN_ID, - RINKEBY_CHAIN_ID, - ROPSTEN_CHAIN_ID, SEPOLIA_CHAIN_ID, } from '../../../../shared/constants/network'; import { getEnvironmentType } from '../../../../app/scripts/lib/util'; @@ -105,9 +102,6 @@ export default function CollectibleDetails({ collectible }) { case POLYGON_CHAIN_ID: return `https://opensea.io/assets/matic/${address}/${tokenId}`; case GOERLI_CHAIN_ID: - case KOVAN_CHAIN_ID: - case ROPSTEN_CHAIN_ID: - case RINKEBY_CHAIN_ID: case SEPOLIA_CHAIN_ID: return `https://testnets.opensea.io/assets/${address}/${tokenId}`; default: diff --git a/ui/components/app/collectibles-tab/collectibles-tab.test.js b/ui/components/app/collectibles-tab/collectibles-tab.test.js index 4d9494b88ed9..2e1b6b692846 100644 --- a/ui/components/app/collectibles-tab/collectibles-tab.test.js +++ b/ui/components/app/collectibles-tab/collectibles-tab.test.js @@ -299,7 +299,7 @@ describe('Collectible Items', () => { it('should render a link "Refresh list" when some collectibles are present on a non-mainnet chain, which, when clicked calls a method checkAndUpdateCollectiblesOwnershipStatus', () => { render({ - chainId: '0x4', + chainId: '0x5', selectedAddress: ACCOUNT_1, collectibles: COLLECTIBLES, useCollectibleDetection: true, diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js index 65ef0e606b6e..20db18839d31 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js @@ -11,15 +11,15 @@ describe('Confirm Page Container Content', () => { metamask: { provider: { type: 'test', - chainId: '0x3', + chainId: '0x5', }, eip1559V2Enabled: false, addressBook: { - '0x3': { + '0x5': { '0x06195827297c7A80a443b6894d3BDB8824b43896': { address: '0x06195827297c7A80a443b6894d3BDB8824b43896', name: 'Address Book Account 1', - chainId: '0x3', + chainId: '0x5', }, }, }, diff --git a/ui/components/app/dropdowns/network-dropdown.js b/ui/components/app/dropdowns/network-dropdown.js index db35c3009c2b..0d3f6087b36c 100644 --- a/ui/components/app/dropdowns/network-dropdown.js +++ b/ui/components/app/dropdowns/network-dropdown.js @@ -217,12 +217,6 @@ class NetworkDropdown extends Component { if (providerName === 'mainnet') { name = this.context.t('mainnet'); - } else if (providerName === 'ropsten') { - name = this.context.t('ropsten'); - } else if (providerName === 'kovan') { - name = this.context.t('kovan'); - } else if (providerName === 'rinkeby') { - name = this.context.t('rinkeby'); } else if (providerName === 'goerli') { name = this.context.t('goerli'); } else if (providerName === 'sepolia') { @@ -356,9 +350,6 @@ class NetworkDropdown extends Component { {shouldShowTestNetworks && ( <> - {this.renderNetworkEntry('ropsten')} - {this.renderNetworkEntry('kovan')} - {this.renderNetworkEntry('rinkeby')} {this.renderNetworkEntry('goerli')} {this.renderNetworkEntry('sepolia')} {this.renderCustomRpcList( diff --git a/ui/components/app/dropdowns/network-dropdown.test.js b/ui/components/app/dropdowns/network-dropdown.test.js index 61a19bd96ba8..727b8fadcdc8 100644 --- a/ui/components/app/dropdowns/network-dropdown.test.js +++ b/ui/components/app/dropdowns/network-dropdown.test.js @@ -80,33 +80,17 @@ describe('Network Dropdown', () => { expect(mainnetColorIndicator).toBeInTheDocument(); }); - it('checks background color for second ColorIndicator', () => { - // find where test networks start in case there are custom RPCs - const ropstenColorIndicator = screen.queryByTestId('color-icon-ropsten'); - expect(ropstenColorIndicator).toBeInTheDocument(); - }); - - it('checks background color for third ColorIndicator', () => { - const kovanColorIndicator = screen.queryByTestId('color-icon-kovan'); - expect(kovanColorIndicator).toBeInTheDocument(); - }); - it('checks background color for fourth ColorIndicator', () => { - const rinkebyColorIndicator = screen.queryByTestId('color-icon-rinkeby'); - expect(rinkebyColorIndicator).toBeInTheDocument(); - }); - - it('checks background color for fifth ColorIndicator', () => { const goerliColorIndicator = screen.queryByTestId('color-icon-goerli'); expect(goerliColorIndicator).toBeInTheDocument(); }); - it('checks background color for sixth ColorIndicator', () => { + it('checks background color for fifth ColorIndicator', () => { const sepoliaColorIndicator = screen.queryByTestId('color-icon-sepolia'); expect(sepoliaColorIndicator).toBeInTheDocument(); }); - it('checks background color for seventh ColorIndicator', () => { + it('checks background color for sixth ColorIndicator', () => { const localhostColorIndicator = screen.queryByTestId( 'color-icon-localhost', ); @@ -121,7 +105,7 @@ describe('Network Dropdown', () => { it('shows test networks in the dropdown', () => { const networkItems = screen.queryAllByTestId(/network-item/u); - expect(networkItems).toHaveLength(9); + expect(networkItems).toHaveLength(6); }); }); diff --git a/ui/components/app/import-token-link/__snapshots__/import-token-link.test.js.snap b/ui/components/app/import-token-link/__snapshots__/import-token-link.test.js.snap index a3d8b9e7d17f..37dab0c3ded5 100644 --- a/ui/components/app/import-token-link/__snapshots__/import-token-link.test.js.snap +++ b/ui/components/app/import-token-link/__snapshots__/import-token-link.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Import Token Link should match snapshot for mainnet chainId 1`] = ` +exports[`Import Token Link should match snapshot for goerli chainId 1`] = `