feat: remove dead statsig flag (#7229)
* feat: remove dead statsig flag * fix: e2e test
This commit is contained in:
parent
366f4d98ef
commit
406d7fe964
@ -1,9 +1,8 @@
|
||||
import { FeatureFlag } from '../../../src/featureFlags'
|
||||
import { getTestSelector } from '../../utils'
|
||||
|
||||
describe('Swap settings', () => {
|
||||
it('Opens and closes the settings menu', () => {
|
||||
cy.visit('/swap', { featureFlags: [FeatureFlag.uniswapXEnabled] })
|
||||
cy.visit('/swap')
|
||||
cy.contains('Settings').should('not.exist')
|
||||
cy.get(getTestSelector('open-settings-dialog-button')).click()
|
||||
cy.get(getTestSelector('mobile-settings-menu')).should('not.exist')
|
||||
@ -17,7 +16,7 @@ describe('Swap settings', () => {
|
||||
|
||||
it('should open the mobile settings menu', () => {
|
||||
cy.viewport('iphone-6')
|
||||
cy.visit('/swap', { featureFlags: [FeatureFlag.uniswapXEnabled] })
|
||||
cy.visit('/swap')
|
||||
cy.get(getTestSelector('open-settings-dialog-button')).click()
|
||||
cy.get(getTestSelector('mobile-settings-menu')).should('exist')
|
||||
cy.contains('Max slippage').should('exist')
|
||||
|
@ -8,7 +8,6 @@ import { useInfoPoolPageFlag } from 'featureFlags/flags/infoPoolPage'
|
||||
import { useInfoTDPFlag } from 'featureFlags/flags/infoTDP'
|
||||
import { useMultichainUXFlag } from 'featureFlags/flags/multichainUx'
|
||||
import { TraceJsonRpcVariant, useTraceJsonRpcFlag } from 'featureFlags/flags/traceJsonRpc'
|
||||
import { UniswapXVariant, useUniswapXFlag } from 'featureFlags/flags/uniswapx'
|
||||
import { useUniswapXEthOutputFlag } from 'featureFlags/flags/uniswapXEthOutput'
|
||||
import { useUniswapXExactOutputFlag } from 'featureFlags/flags/uniswapXExactOutput'
|
||||
import { useUniswapXSyntheticQuoteFlag } from 'featureFlags/flags/uniswapXUseSyntheticQuote'
|
||||
@ -229,12 +228,6 @@ export default function FeatureFlagModal() {
|
||||
<X size={24} />
|
||||
</CloseButton>
|
||||
</Header>
|
||||
<FeatureFlagOption
|
||||
variant={UniswapXVariant}
|
||||
value={useUniswapXFlag()}
|
||||
featureFlag={FeatureFlag.uniswapXEnabled}
|
||||
label="Enable UniswapX on interface"
|
||||
/>
|
||||
<FeatureFlagOption
|
||||
variant={BaseVariant}
|
||||
value={useUniswapXSyntheticQuoteFlag()}
|
||||
|
@ -5,10 +5,6 @@ import { fireEvent, render, screen } from 'test-utils/render'
|
||||
|
||||
import RouterPreferenceSettings from '.'
|
||||
|
||||
jest.mock('featureFlags/flags/uniswapx', () => ({
|
||||
useUniswapXEnabled: () => true,
|
||||
}))
|
||||
|
||||
describe('RouterPreferenceSettings', () => {
|
||||
// Restore to default router preference before each unit test
|
||||
beforeEach(() => {
|
||||
|
@ -5,7 +5,6 @@ import UniswapXBrandMark from 'components/Logo/UniswapXBrandMark'
|
||||
import { RowBetween, RowFixed } from 'components/Row'
|
||||
import Toggle from 'components/Toggle'
|
||||
import { isUniswapXSupportedChain } from 'constants/chains'
|
||||
import { useUniswapXEnabled } from 'featureFlags/flags/uniswapx'
|
||||
import { useAppDispatch } from 'state/hooks'
|
||||
import { RouterPreference } from 'state/routing/types'
|
||||
import { useRouterPreference } from 'state/user/hooks'
|
||||
@ -25,7 +24,7 @@ const InlineLink = styled(ThemedText.BodySmall)`
|
||||
export default function RouterPreferenceSettings() {
|
||||
const { chainId } = useWeb3React()
|
||||
const [routerPreference, setRouterPreference] = useRouterPreference()
|
||||
const uniswapXEnabled = useUniswapXEnabled() && chainId && isUniswapXSupportedChain(chainId)
|
||||
const uniswapXEnabled = chainId && isUniswapXSupportedChain(chainId)
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
return (
|
||||
|
@ -1,11 +0,0 @@
|
||||
import { BaseVariant, FeatureFlag, useBaseFlag } from '../index'
|
||||
|
||||
export function useUniswapXFlag(): BaseVariant {
|
||||
return useBaseFlag(FeatureFlag.uniswapXEnabled)
|
||||
}
|
||||
|
||||
export function useUniswapXEnabled(): boolean {
|
||||
return useUniswapXFlag() === BaseVariant.Enabled
|
||||
}
|
||||
|
||||
export { BaseVariant as UniswapXVariant }
|
@ -8,7 +8,6 @@ import { useGate } from 'statsig-react'
|
||||
export enum FeatureFlag {
|
||||
traceJsonRpc = 'traceJsonRpc',
|
||||
debounceSwapQuote = 'debounce_swap_quote',
|
||||
uniswapXEnabled = 'uniswapx_enabled', // enables sending dutch_limit config to routing-api
|
||||
uniswapXSyntheticQuote = 'uniswapx_synthetic_quote',
|
||||
uniswapXEthOutputEnabled = 'uniswapx_eth_output_enabled',
|
||||
uniswapXExactOutputEnabled = 'uniswapx_exact_output_enabled',
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { SkipToken, skipToken } from '@reduxjs/toolkit/query/react'
|
||||
import { Currency, CurrencyAmount, TradeType } from '@uniswap/sdk-core'
|
||||
import { useFotAdjustmentsEnabled } from 'featureFlags/flags/fotAdjustments'
|
||||
import { useUniswapXEnabled } from 'featureFlags/flags/uniswapx'
|
||||
import { useUniswapXEthOutputEnabled } from 'featureFlags/flags/uniswapXEthOutput'
|
||||
import { useUniswapXExactOutputEnabled } from 'featureFlags/flags/uniswapXExactOutput'
|
||||
import { useUniswapXSyntheticQuoteEnabled } from 'featureFlags/flags/uniswapXUseSyntheticQuote'
|
||||
@ -30,7 +29,6 @@ export function useRoutingAPIArguments({
|
||||
tradeType: TradeType
|
||||
routerPreference: RouterPreference | typeof INTERNAL_ROUTER_PREFERENCE_PRICE
|
||||
}): GetQuoteArgs | SkipToken {
|
||||
const uniswapXEnabled = useUniswapXEnabled()
|
||||
const uniswapXForceSyntheticQuotes = useUniswapXSyntheticQuoteEnabled()
|
||||
const userDisabledUniswapX = useUserDisabledUniswapX()
|
||||
const uniswapXEthOutputEnabled = useUniswapXEthOutputEnabled()
|
||||
@ -55,7 +53,6 @@ export function useRoutingAPIArguments({
|
||||
routerPreference,
|
||||
tradeType,
|
||||
needsWrapIfUniswapX: tokenIn.isNative,
|
||||
uniswapXEnabled,
|
||||
uniswapXForceSyntheticQuotes,
|
||||
userDisabledUniswapX,
|
||||
uniswapXEthOutputEnabled,
|
||||
@ -69,7 +66,6 @@ export function useRoutingAPIArguments({
|
||||
tokenIn,
|
||||
tokenOut,
|
||||
tradeType,
|
||||
uniswapXEnabled,
|
||||
uniswapXExactOutputEnabled,
|
||||
uniswapXForceSyntheticQuotes,
|
||||
userDisabledUniswapX,
|
||||
|
@ -74,7 +74,6 @@ function getRoutingAPIConfig(args: GetQuoteArgs): RoutingConfig {
|
||||
// UniswapX doesn't support native out, exact-out, or non-mainnet trades (yet),
|
||||
// so even if the user has selected UniswapX as their router preference, force them to receive a Classic quote.
|
||||
if (
|
||||
!args.uniswapXEnabled ||
|
||||
(args.userDisabledUniswapX && routerPreference !== RouterPreference.X) ||
|
||||
(tokenOutIsNative && !uniswapXEthOutputEnabled) ||
|
||||
(!uniswapXExactOutputEnabled && tradeType === TradeType.EXACT_OUTPUT) ||
|
||||
|
@ -42,7 +42,6 @@ export interface GetQuoteArgs {
|
||||
routerPreference: RouterPreference | typeof INTERNAL_ROUTER_PREFERENCE_PRICE
|
||||
tradeType: TradeType
|
||||
needsWrapIfUniswapX: boolean
|
||||
uniswapXEnabled: boolean
|
||||
uniswapXForceSyntheticQuotes: boolean
|
||||
uniswapXEthOutputEnabled: boolean
|
||||
uniswapXExactOutputEnabled: boolean
|
||||
|
Loading…
Reference in New Issue
Block a user