Skip to content

Commit

Permalink
chore: Dont use type assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
memoyil committed Sep 29, 2024
1 parent 5050c1f commit 9736769
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/farms/src/getLegacyFarmConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import { ChainId, getChainName } from '@pancakeswap/chains'
import { getStableSwapPools } from '@pancakeswap/stable-swap-sdk'
import { isAddressEqual } from 'viem'
import { supportedChainIdV4 } from './const'
import {
SerializedFarmConfig,
SerializedFarmPublicData,
UniversalFarmConfig,
UniversalFarmConfigStableSwap,
UniversalFarmConfigV2,
} from './types'
import { SerializedFarmConfig, SerializedFarmPublicData, UniversalFarmConfig } from './types'

/**
* @deprecated only used for legacy farms
Expand Down Expand Up @@ -36,8 +30,7 @@ export async function getLegacyFarmConfig(chainId?: ChainId): Promise<Serialized
return isAddressEqual(s.lpAddress, farm.lpAddress)
})
: undefined
const bCakeWrapperAddress = (farm as UniversalFarmConfigV2 | UniversalFarmConfigStableSwap)
.bCakeWrapperAddress
const bCakeWrapperAddress = 'bCakeWrapperAddress' in farm ? farm.bCakeWrapperAddress : undefined

return {
pid: farm.pid ?? 0,
Expand Down

0 comments on commit 9736769

Please sign in to comment.