Skip to content

Commit

Permalink
feat: Remove 'Improved transactions requests' toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronfigueiredo committed Jan 15, 2025
1 parent d8ce2c7 commit 2d01514
Show file tree
Hide file tree
Showing 80 changed files with 4,901 additions and 12,556 deletions.
6 changes: 0 additions & 6 deletions app/_locales/de/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/el/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/es/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/fr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/hi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/id/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/ja/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/ko/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/pt/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/ru/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/tl/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/tr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/vi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/zh_CN/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/scripts/constants/sentry-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ export const SENTRY_BACKGROUND_STATE = {
autoLockTimeLimit: true,
hideZeroBalanceTokens: true,
redesignedConfirmationsEnabled: true,
redesignedTransactionsEnabled: false,
isRedesignedConfirmationsDeveloperEnabled: false,
showExtensionInFullSizeView: true,
showFiatInTestnets: true,
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/controllers/preferences-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ describe('preferences controller', () => {
hideZeroBalanceTokens: false,
petnamesEnabled: true,
redesignedConfirmationsEnabled: true,
redesignedTransactionsEnabled: true,
shouldShowAggregatedBalancePopover: true,
featureNotificationsEnabled: false,
isRedesignedConfirmationsDeveloperEnabled: false,
Expand Down Expand Up @@ -757,7 +756,6 @@ describe('preferences controller', () => {
petnamesEnabled: true,
privacyMode: false,
redesignedConfirmationsEnabled: true,
redesignedTransactionsEnabled: true,
shouldShowAggregatedBalancePopover: true,
featureNotificationsEnabled: false,
isRedesignedConfirmationsDeveloperEnabled: false,
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/controllers/preferences-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export type Preferences = {
hideZeroBalanceTokens: boolean;
petnamesEnabled: boolean;
redesignedConfirmationsEnabled: boolean;
redesignedTransactionsEnabled: boolean;
featureNotificationsEnabled: boolean;
showMultiRpcModal: boolean;
privacyMode: boolean;
Expand Down Expand Up @@ -223,7 +222,6 @@ export const getDefaultPreferencesControllerState =
hideZeroBalanceTokens: false,
petnamesEnabled: true,
redesignedConfirmationsEnabled: true,
redesignedTransactionsEnabled: true,
featureNotificationsEnabled: false,
isRedesignedConfirmationsDeveloperEnabled: false,
showConfirmationAdvancedDetails: false,
Expand Down
1 change: 0 additions & 1 deletion app/scripts/lib/transaction/metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const mockTransactionMetricsRequest = {
trackEvent: jest.fn(),
getIsSmartTransaction: jest.fn(),
getSmartTransactionByMinedTxHash: jest.fn(),
getRedesignedTransactionsEnabled: jest.fn(),
getMethodData: jest.fn(),
getIsRedesignedConfirmationsDeveloperEnabled: jest.fn(),
getIsConfirmationAdvancedDetailsOpen: jest.fn(),
Expand Down
3 changes: 0 additions & 3 deletions app/scripts/lib/transaction/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export type TransactionMetricsRequest = {
getSmartTransactionByMinedTxHash: (
txhash: string | undefined,
) => SmartTransaction;
getRedesignedTransactionsEnabled: () => boolean;
getMethodData: (data: string) => Promise<{ name: string }>;
getIsRedesignedConfirmationsDeveloperEnabled: () => boolean;
getIsConfirmationAdvancedDetailsOpen: () => boolean;
Expand Down Expand Up @@ -1014,8 +1013,6 @@ async function buildEventFragmentProperties({

const isRedesignedForTransaction = shouldUseRedesignForTransactions({
transactionMetadataType: transactionMeta.type as TransactionType,
isRedesignedTransactionsUserSettingEnabled:
transactionMetricsRequest.getRedesignedTransactionsEnabled(),
isRedesignedConfirmationsDeveloperEnabled:
transactionMetricsRequest.getIsRedesignedConfirmationsDeveloperEnabled(),
});
Expand Down
7 changes: 0 additions & 7 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6664,11 +6664,6 @@ export default class MetamaskController extends EventEmitter {
.redesignedConfirmationsEnabled;
}

isTransactionsRedesignEnabled() {
return this.preferencesController.state.preferences
.redesignedTransactionsEnabled;
}

isConfirmationRedesignDeveloperEnabled() {
return this.preferencesController.state.preferences
.isRedesignedConfirmationsDeveloperEnabled;
Expand Down Expand Up @@ -6860,8 +6855,6 @@ export default class MetamaskController extends EventEmitter {
},
getRedesignedConfirmationsEnabled:
this.isConfirmationRedesignEnabled.bind(this),
getRedesignedTransactionsEnabled:
this.isTransactionsRedesignEnabled.bind(this),
getMethodData: (data) => {
if (!data) {
return null;
Expand Down
79 changes: 79 additions & 0 deletions app/scripts/migrations/138.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { migrate, version } from './138';

const oldVersion = 137;

describe(`migration #${version}`, () => {
it('updates the version metadata', async () => {
const oldStorage = {
meta: { version: oldVersion },
data: {},
};
const newStorage = await migrate(oldStorage);
expect(newStorage.meta).toStrictEqual({ version });
});

describe(`migration #${version}`, () => {
it('removes the redesignedTransactionsEnabled preference if it is set to true', async () => {
const oldStorage = {
meta: { version: oldVersion },
data: {
PreferencesController: {
preferences: {
redesignedTransactionsEnabled: true,
},
},
},
};
const expectedData = {
PreferencesController: {
preferences: {},
},
};
const newStorage = await migrate(oldStorage);

expect(newStorage.data).toStrictEqual(expectedData);
});

it('removes the redesignedTransactionsEnabled preference if it is set to false', async () => {
const oldStorage = {
meta: { version: oldVersion },
data: {
PreferencesController: {
preferences: {
redesignedTransactionsEnabled: false,
},
},
},
};
const expectedData = {
PreferencesController: {
preferences: {},
},
};
const newStorage = await migrate(oldStorage);

expect(newStorage.data).toStrictEqual(expectedData);
});

it('does nothing to other PreferencesController state if there is not a redesignedTransactionsEnabled preference', async () => {
const oldStorage = {
meta: { version: oldVersion },
data: {
PreferencesController: {
existingPreference: true,
},
},
};

const expectedData = {
PreferencesController: {
existingPreference: true,
},
};

const newStorage = await migrate(oldStorage);

expect(newStorage.data).toStrictEqual(expectedData);
});
});
});
Loading

0 comments on commit 2d01514

Please sign in to comment.