1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00

Cleanup after TOKEN_DETECTION_V2 flag removal (#15564)

This commit is contained in:
Niranjana Binoy 2022-08-16 10:22:05 -04:00 committed by GitHub
parent 1a8d0c91f0
commit 650eac88a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 42 deletions

View File

@ -5,7 +5,6 @@ SEGMENT_WRITE_KEY=
ONBOARDING_V2=
SWAPS_USE_DEV_APIS=
COLLECTIBLES_V1=
TOKEN_DETECTION_V2=
; Set this to '1' to enable support for Sign-In with Ethereum [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361)
SIWE_V1=

View File

@ -47,7 +47,6 @@ const metamaskrc = {
ONBOARDING_V2: process.env.ONBOARDING_V2,
COLLECTIBLES_V1: process.env.COLLECTIBLES_V1,
PHISHING_WARNING_PAGE_URL: process.env.PHISHING_WARNING_PAGE_URL,
TOKEN_DETECTION_V2: process.env.TOKEN_DETECTION_V2,
SEGMENT_HOST: process.env.SEGMENT_HOST,
SEGMENT_WRITE_KEY: process.env.SEGMENT_WRITE_KEY,
SEGMENT_BETA_WRITE_KEY: process.env.SEGMENT_BETA_WRITE_KEY,
@ -1114,7 +1113,6 @@ function getEnvironmentVariables({ buildTarget, buildType, version }) {
SENTRY_DSN_DEV: metamaskrc.SENTRY_DSN_DEV,
SIWE_V1: metamaskrc.SIWE_V1 === '1',
SWAPS_USE_DEV_APIS: process.env.SWAPS_USE_DEV_APIS === '1',
TOKEN_DETECTION_V2: metamaskrc.TOKEN_DETECTION_V2 === '1',
};
}

View File

@ -165,10 +165,9 @@ export default class AdvancedTab extends PureComponent {
const { t } = this.context;
const { showResultMessage, restoreSuccessful } = this.state;
const settingsRefIndex = process.env.TOKEN_DETECTION_V2 ? 15 : 14;
return (
<div
ref={this.settingsRefs[settingsRefIndex]}
ref={this.settingsRefs[15]}
className="settings-page__content-row"
data-testid="advanced-setting-data-restore"
>
@ -209,10 +208,9 @@ export default class AdvancedTab extends PureComponent {
renderUserDataBackup() {
const { t } = this.context;
const settingsRefIndex = process.env.TOKEN_DETECTION_V2 ? 15 : 13;
return (
<div
ref={this.settingsRefs[settingsRefIndex]}
ref={this.settingsRefs[14]}
className="settings-page__content-row"
data-testid="advanced-setting-data-backup"
>

View File

@ -190,39 +190,4 @@ describe('AdvancedTab Component', () => {
toggleButton.first().simulate('toggle');
expect(toggleTokenDetection.calledOnce).toStrictEqual(true);
});
/** TODO: Remove during TOKEN_DETECTION_V2 feature flag clean up */
it('should not show token detection toggle', () => {
process.env.TOKEN_DETECTION_V2 = false;
component = shallow(
<AdvancedTab
ipfsGateway=""
setAutoLockTimeLimit={setAutoLockTimeLimitSpy}
setIpfsGateway={() => undefined}
setShowFiatConversionOnTestnetsPreference={() => undefined}
setThreeBoxSyncingPermission={() => undefined}
setShowTestNetworks={toggleTestnet}
showTestNetworks={false}
threeBoxDisabled
threeBoxSyncingAllowed={false}
ledgerTransportType={LEDGER_TRANSPORT_TYPES.U2F}
setLedgerTransportPreference={() => undefined}
setDismissSeedBackUpReminder={() => undefined}
dismissSeedBackUpReminder={false}
useTokenDetection
setUseTokenDetection={toggleTokenDetection}
userHasALedgerAccount
backupUserData={() => undefined}
restoreUserData={() => undefined}
/>,
{
context: {
trackEvent: () => undefined,
t: (s) => `_${s}`,
},
},
);
const tokenDetectionText = component.find({ text: 'Token detection' });
expect(tokenDetectionText).toHaveLength(0);
});
});