mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 09:23:21 +01:00
Deprecate snake case from feature flags (#15994)
This commit is contained in:
parent
455735c5ce
commit
f3465c9485
@ -121,37 +121,25 @@ async function setupMocking(server, testSpecificMock) {
|
||||
json: [
|
||||
{
|
||||
ethereum: {
|
||||
mobile_active: true,
|
||||
extension_active: true,
|
||||
fallback_to_v1: false,
|
||||
fallbackToV1: false,
|
||||
mobileActive: true,
|
||||
extensionActive: true,
|
||||
},
|
||||
bsc: {
|
||||
mobile_active: true,
|
||||
extension_active: true,
|
||||
fallback_to_v1: false,
|
||||
fallbackToV1: false,
|
||||
mobileActive: true,
|
||||
extensionActive: true,
|
||||
},
|
||||
polygon: {
|
||||
mobile_active: true,
|
||||
extension_active: true,
|
||||
fallback_to_v1: false,
|
||||
fallbackToV1: false,
|
||||
mobileActive: true,
|
||||
extensionActive: true,
|
||||
},
|
||||
avalanche: {
|
||||
mobile_active: true,
|
||||
extension_active: true,
|
||||
fallback_to_v1: false,
|
||||
fallbackToV1: false,
|
||||
mobileActive: true,
|
||||
extensionActive: true,
|
||||
},
|
||||
smart_transactions: {
|
||||
mobile_active: false,
|
||||
extension_active: false,
|
||||
},
|
||||
smartTransactions: {
|
||||
mobileActive: false,
|
||||
extensionActive: false,
|
||||
|
@ -68,19 +68,19 @@ export const TOKENS_GET_RESPONSE = [
|
||||
export const createFeatureFlagsResponse = () => {
|
||||
return {
|
||||
bsc: {
|
||||
mobile_active: false,
|
||||
extension_active: true,
|
||||
fallback_to_v1: true,
|
||||
mobileActive: false,
|
||||
extensionActive: true,
|
||||
fallbackToV1: true,
|
||||
},
|
||||
ethereum: {
|
||||
mobile_active: false,
|
||||
extension_active: true,
|
||||
fallback_to_v1: true,
|
||||
mobileActive: false,
|
||||
extensionActive: true,
|
||||
fallbackToV1: true,
|
||||
},
|
||||
polygon: {
|
||||
mobile_active: false,
|
||||
extension_active: true,
|
||||
fallback_to_v1: false,
|
||||
mobileActive: false,
|
||||
extensionActive: true,
|
||||
fallbackToV1: false,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -92,7 +92,7 @@ describe('Ducks - Swaps', () => {
|
||||
swapsFeatureIsLive: true,
|
||||
};
|
||||
const featureFlagsResponse = MOCKS.createFeatureFlagsResponse();
|
||||
featureFlagsResponse.ethereum.extension_active = false;
|
||||
featureFlagsResponse.ethereum.extensionActive = false;
|
||||
const featureFlagApiNock = mockFeatureFlagsApiResponse({
|
||||
featureFlagsResponse,
|
||||
});
|
||||
@ -113,8 +113,8 @@ describe('Ducks - Swaps', () => {
|
||||
swapsFeatureIsLive: false,
|
||||
};
|
||||
const featureFlagsResponse = MOCKS.createFeatureFlagsResponse();
|
||||
featureFlagsResponse.ethereum.extension_active = false;
|
||||
featureFlagsResponse.ethereum.fallback_to_v1 = false;
|
||||
featureFlagsResponse.ethereum.extensionActive = false;
|
||||
featureFlagsResponse.ethereum.fallbackToV1 = false;
|
||||
const featureFlagApiNock = mockFeatureFlagsApiResponse({
|
||||
featureFlagsResponse,
|
||||
});
|
||||
|
@ -638,14 +638,14 @@ export const getSwapsLivenessForNetwork = (swapsFeatureFlags = {}, chainId) => {
|
||||
};
|
||||
}
|
||||
const isNetworkEnabledForNewApi =
|
||||
swapsFeatureFlags[networkName].extension_active;
|
||||
swapsFeatureFlags[networkName].extensionActive;
|
||||
if (isNetworkEnabledForNewApi) {
|
||||
return {
|
||||
swapsFeatureIsLive: true,
|
||||
};
|
||||
}
|
||||
return {
|
||||
swapsFeatureIsLive: swapsFeatureFlags[networkName].fallback_to_v1,
|
||||
swapsFeatureIsLive: swapsFeatureFlags[networkName].fallbackToV1,
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -373,7 +373,7 @@ describe('Swaps Util', () => {
|
||||
swapsFeatureIsLive: true,
|
||||
};
|
||||
const swapsFeatureFlags = MOCKS.createFeatureFlagsResponse();
|
||||
swapsFeatureFlags[ETHEREUM].extension_active = false;
|
||||
swapsFeatureFlags[ETHEREUM].extensionActive = false;
|
||||
expect(
|
||||
getSwapsLivenessForNetwork(swapsFeatureFlags, CHAIN_IDS.MAINNET),
|
||||
).toMatchObject(expectedSwapsLiveness);
|
||||
|
Loading…
Reference in New Issue
Block a user