Skip to content

Commit

Permalink
feat: replace experimental add solana account with remote flag
Browse files Browse the repository at this point in the history
  • Loading branch information
aganglada committed Feb 21, 2025
1 parent dc2249c commit 483e133
Show file tree
Hide file tree
Showing 27 changed files with 5 additions and 299 deletions.
9 changes: 0 additions & 9 deletions app/_locales/de/messages.json

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

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

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

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

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

9 changes: 0 additions & 9 deletions app/_locales/en_GB/messages.json

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

15 changes: 0 additions & 15 deletions app/scripts/controllers/preferences-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,19 +845,4 @@ describe('preferences controller', () => {
);
});
});

describe('setSolanaSupportEnabled', () => {
const { controller } = setupController({});
it('has the default value as false', () => {
expect(controller.state.solanaSupportEnabled).toStrictEqual(false);
});

it('sets the solanaSupportEnabled property in state to true and then false', () => {
controller.setSolanaSupportEnabled(true);
expect(controller.state.solanaSupportEnabled).toStrictEqual(true);

controller.setSolanaSupportEnabled(false);
expect(controller.state.solanaSupportEnabled).toStrictEqual(false);
});
});
});
24 changes: 0 additions & 24 deletions app/scripts/controllers/preferences-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ export type PreferencesControllerState = Omit<
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
watchEthereumAccountEnabled: boolean;
///: END:ONLY_INCLUDE_IF
///: BEGIN:ONLY_INCLUDE_IF(solana)
solanaSupportEnabled: boolean;
///: END:ONLY_INCLUDE_IF
bitcoinSupportEnabled: boolean;
bitcoinTestnetSupportEnabled: boolean;
addSnapAccountEnabled?: boolean;
Expand Down Expand Up @@ -187,9 +184,6 @@ export const getDefaultPreferencesControllerState =
openSeaEnabled: true,
securityAlertsEnabled: true,
watchEthereumAccountEnabled: false,
///: BEGIN:ONLY_INCLUDE_IF(solana)
solanaSupportEnabled: false,
///: END:ONLY_INCLUDE_IF
bitcoinSupportEnabled: false,
bitcoinTestnetSupportEnabled: false,
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
Expand Down Expand Up @@ -340,10 +334,6 @@ const controllerMetadata = {
persist: true,
anonymous: false,
},
solanaSupportEnabled: {
persist: true,
anonymous: false,
},
bitcoinSupportEnabled: {
persist: true,
anonymous: false,
Expand Down Expand Up @@ -663,20 +653,6 @@ export class PreferencesController extends BaseController<
}
///: END:ONLY_INCLUDE_IF

///: BEGIN:ONLY_INCLUDE_IF(solana)
/**
* Setter for the `solanaSupportEnabled` property.
*
* @param solanaSupportEnabled - Whether or not the user wants to
* enable the "Add a new Solana account" button.
*/
setSolanaSupportEnabled(solanaSupportEnabled: boolean): void {
this.update((state) => {
state.solanaSupportEnabled = solanaSupportEnabled;
});
}
///: END:ONLY_INCLUDE_IF

/**
* Setter for the `bitcoinSupportEnabled` property.
*
Expand Down
6 changes: 0 additions & 6 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3224,12 +3224,6 @@ export default class MetamaskController extends EventEmitter {
preferencesController,
),
///: END:ONLY_INCLUDE_IF
///: BEGIN:ONLY_INCLUDE_IF(solana)
setSolanaSupportEnabled:
preferencesController.setSolanaSupportEnabled.bind(
preferencesController,
),
///: END:ONLY_INCLUDE_IF
setBitcoinSupportEnabled:
preferencesController.setBitcoinSupportEnabled.bind(
preferencesController,
Expand Down
1 change: 0 additions & 1 deletion shared/constants/metametrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ export enum MetaMetricsEventName {
BridgeLinkClicked = 'Bridge Link Clicked',
BitcoinSupportToggled = 'Bitcoin Support Toggled',
BitcoinTestnetSupportToggled = 'Bitcoin Testnet Support Toggled',
SolanaSupportToggled = 'Solana Support Toggled',
CurrentCurrency = 'Current Currency',
DappViewed = 'Dapp Viewed',
DecryptionApproved = 'Decryption Approved',
Expand Down
6 changes: 1 addition & 5 deletions test/e2e/flask/solana/common-solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,12 @@ export async function mockGetFeeForMessage(mockServer: Mockttp) {
export async function withSolanaAccountSnap(
{
title,
solanaSupportEnabled,
showNativeTokenAsMainBalance,
mockCalls,
mockSendTransaction,
importAccount,
}: {
title?: string;
solanaSupportEnabled?: boolean;
showNativeTokenAsMainBalance?: boolean;
mockCalls?: boolean;
mockSendTransaction?: boolean;
Expand All @@ -455,9 +453,7 @@ export async function withSolanaAccountSnap(
test: (driver: Driver, mockServer: Mockttp) => Promise<void>,
) {
console.log('Starting withSolanaAccountSnap');
let fixtures = new FixtureBuilder().withPreferencesController({
solanaSupportEnabled: solanaSupportEnabled ?? true,
});
let fixtures = new FixtureBuilder();
if (!showNativeTokenAsMainBalance) {
fixtures =
fixtures.withPreferencesControllerShowNativeTokenAsMainBalanceDisabled();
Expand Down
Loading

0 comments on commit 483e133

Please sign in to comment.