Skip to content

Commit

Permalink
chore(cleanup): Remove show_swap_and_deposit feature gate (#6303)
Browse files Browse the repository at this point in the history
### Description

Title

### Test plan

CI

### Related issues

- Part of ACT-1443

### Backwards compatibility

Yes
### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- N/A
  • Loading branch information
finnian0826 authored Dec 9, 2024
1 parent 0b43004 commit 35133b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
7 changes: 1 addition & 6 deletions src/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import { navigate } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import { EarnPosition } from 'src/positions/types'
import { NETWORK_NAMES } from 'src/shared/conts'
import { getFeatureGate } from 'src/statsig'
import { StatsigFeatureGates } from 'src/statsig/types'
import Colors from 'src/styles/colors'
import { typeScale } from 'src/styles/fonts'
import { Spacing } from 'src/styles/styles'
Expand Down Expand Up @@ -212,10 +210,7 @@ export default function BeforeDepositBottomSheet({
const { t } = useTranslation()

const { availableShortcutIds } = pool
const canSwapDeposit =
getFeatureGate(StatsigFeatureGates.SHOW_SWAP_AND_DEPOSIT) &&
availableShortcutIds.includes('swap-deposit') &&
hasTokensOnSameNetwork
const canSwapDeposit = availableShortcutIds.includes('swap-deposit') && hasTokensOnSameNetwork

const title = canSwapDeposit
? t('earnFlow.beforeDepositBottomSheet.youNeedTitle', {
Expand Down
10 changes: 3 additions & 7 deletions src/earn/poolInfoScreen/EarnPoolInfoScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ describe('EarnPoolInfoScreen', () => {
})
jest
.mocked(getFeatureGate)
.mockImplementation(
(gate) =>
gate === StatsigFeatureGates.ALLOW_CROSS_CHAIN_SWAPS ||
gate === StatsigFeatureGates.SHOW_SWAP_AND_DEPOSIT
)
.mockImplementation((gate) => gate === StatsigFeatureGates.ALLOW_CROSS_CHAIN_SWAPS)
jest.useFakeTimers({
now: new Date('2024-08-15T00:00:00.000Z'),
})
Expand Down Expand Up @@ -560,15 +556,15 @@ describe('EarnPoolInfoScreen', () => {
it('navigates correctly when swap action item is tapped', () => {
jest
.mocked(getFeatureGate)
.mockImplementation((gate) => gate === StatsigFeatureGates.ALLOW_CROSS_CHAIN_SWAPS) // Swap and deposit feature gate turned off
.mockImplementation((gate) => gate === StatsigFeatureGates.ALLOW_CROSS_CHAIN_SWAPS)
const { getByText, getByTestId } = render(
<Provider store={getStore({ includeSameChainToken: true, includeOtherChainToken: true })}>
<MockedNavigator
component={() => {
return (
<EarnPoolInfoScreen
{...getMockStackScreenProps(Screens.EarnPoolInfoScreen, {
pool: mockEarnPositions[0],
pool: { ...mockEarnPositions[0], availableShortcutIds: ['deposit', 'withdraw'] },
})}
/>
)
Expand Down
1 change: 0 additions & 1 deletion src/statsig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export enum StatsigFeatureGates {
SUBSIDIZE_STABLECOIN_EARN_GAS_FEES = 'subsidize_stablecoin_earn_gas_fees',
SHOW_CASH_IN_TOKEN_FILTERS = 'show_cash_in_token_filters',
ALLOW_CROSS_CHAIN_SWAPS = 'allow_cross_chain_swaps',
SHOW_SWAP_AND_DEPOSIT = 'show_swap_and_deposit',
SHOW_UK_COMPLIANT_VARIANT = 'show_uk_compliant_variant',
ALLOW_EARN_PARTIAL_WITHDRAWAL = 'allow_earn_partial_withdrawal',
SHOW_ZERION_TRANSACTION_FEED = 'show_zerion_transaction_feed',
Expand Down

0 comments on commit 35133b3

Please # to comment.