Skip to content

Commit

Permalink
fix: cow on gnosis & arbitrum (#7397)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis authored Jul 22, 2024
1 parent 9664f63 commit e628750
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 29 deletions.
2 changes: 0 additions & 2 deletions .env.base
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ REACT_APP_FEATURE_READ_ONLY_ASSETS=true

# swapper feature flags - other .env files will override these
REACT_APP_FEATURE_COWSWAP=true
REACT_APP_FEATURE_COWSWAP_GNOSIS=true
REACT_APP_FEATURE_COWSWAP_ARBITRUM=true
REACT_APP_FEATURE_LIFI_SWAP=true
REACT_APP_FEATURE_ONE_INCH=false
REACT_APP_FEATURE_THOR_SWAP=true
Expand Down
18 changes: 1 addition & 17 deletions packages/swapper/src/swappers/CowSwapper/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,7 @@ export const SUPPORTED_CHAIN_IDS: ChainId[] = [
KnownChainIds.EthereumMainnet,
KnownChainIds.GnosisMainnet,
KnownChainIds.ArbitrumMainnet,
].filter(chainId => {
if (
process.env['REACT_APP_FEATURE_COWSWAP_GNOSIS'] !== 'true' &&
chainId === KnownChainIds.GnosisMainnet
) {
return false
}

if (
process.env['REACT_APP_FEATURE_COWSWAP_ARBITRUM'] !== 'true' &&
chainId === KnownChainIds.ArbitrumMainnet
) {
return false
}

return true
})
]

export const COW_SWAP_SUPPORTED_CHAIN_IDS: SupportedChainIds = {
sell: SUPPORTED_CHAIN_IDS,
Expand Down
2 changes: 0 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ const validators = {
REACT_APP_COVALENT_API_KEY: str(),
REACT_APP_FEATURE_LIFI_SWAP: bool({ default: false }),
REACT_APP_FEATURE_COWSWAP: bool({ default: false }),
REACT_APP_FEATURE_COWSWAP_GNOSIS: bool({ default: false }),
REACT_APP_FEATURE_COWSWAP_ARBITRUM: bool({ default: false }),
REACT_APP_FEATURE_JAYPEGZ: bool({ default: false }),
REACT_APP_FEATURE_OPTIMISM: bool({ default: false }),
REACT_APP_FEATURE_BNBSMARTCHAIN: bool({ default: false }),
Expand Down
2 changes: 0 additions & 2 deletions src/setupVitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ moduleAlias.addAlias('ethers', (fromPath: string) => {

vi.hoisted(() => {
vi.stubEnv('REACT_APP_FEATURE_MIXPANEL', 'false')
vi.stubEnv('REACT_APP_FEATURE_COWSWAP_GNOSIS', 'true')
vi.stubEnv('REACT_APP_FEATURE_COWSWAP_ARBITRUM', 'true')
})

beforeAll(() => {
Expand Down
4 changes: 0 additions & 4 deletions src/state/slices/preferencesSlice/preferencesSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export type FeatureFlags = {
SaversVaultsWithdraw: boolean
DefiDashboard: boolean
Cowswap: boolean
CowswapGnosis: boolean
CowswapArbitrum: boolean
ZrxSwap: boolean
Mixpanel: boolean
LifiSwap: boolean
Expand Down Expand Up @@ -118,8 +116,6 @@ const initialState: Preferences = {
SaversVaultsWithdraw: getConfig().REACT_APP_FEATURE_SAVERS_VAULTS_WITHDRAW,
DefiDashboard: getConfig().REACT_APP_FEATURE_DEFI_DASHBOARD,
Cowswap: getConfig().REACT_APP_FEATURE_COWSWAP,
CowswapGnosis: getConfig().REACT_APP_FEATURE_COWSWAP_GNOSIS,
CowswapArbitrum: getConfig().REACT_APP_FEATURE_COWSWAP_ARBITRUM,
ZrxSwap: getConfig().REACT_APP_FEATURE_ZRX_SWAP,
LifiSwap: getConfig().REACT_APP_FEATURE_LIFI_SWAP,
CovalentJaypegs: getConfig().REACT_APP_FEATURE_COVALENT_JAYPEGS,
Expand Down
2 changes: 0 additions & 2 deletions src/test/mocks/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ export const mockStore: ReduxState = {
ThorSwap: false,
ThorSwapStreamingSwaps: false,
Cowswap: false,
CowswapGnosis: false,
CowswapArbitrum: false,
Yat: false,
WalletConnectToDapps: false,
WalletConnectToDappsV2: false,
Expand Down

0 comments on commit e628750

Please sign in to comment.