From 8cb5e8bb79a2fae92fb30dd483f734a2a0384d81 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 7 Feb 2018 17:42:07 -0600 Subject: [PATCH] Use ShapeShift for all swaps (#1019) * Use shapeshift for all swaps. * fix snapshot --- .../Tabs/Swap/components/CurrencySwap.tsx | 22 +------------------ common/containers/Tabs/Swap/index.tsx | 2 -- common/reducers/swap/index.ts | 2 +- spec/pages/__snapshots__/Swap.spec.tsx.snap | 2 +- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/common/containers/Tabs/Swap/components/CurrencySwap.tsx b/common/containers/Tabs/Swap/components/CurrencySwap.tsx index fdad9a75..0c116756 100644 --- a/common/containers/Tabs/Swap/components/CurrencySwap.tsx +++ b/common/containers/Tabs/Swap/components/CurrencySwap.tsx @@ -110,31 +110,11 @@ export default class CurrencySwap extends PureComponent { public componentDidUpdate(prevProps: Props, prevState: State) { const { origin, destination } = this.state; - const { options, bityRates, shapeshiftRates } = this.props; + const { options } = this.props; if (origin !== prevState.origin) { this.setDisabled(origin, destination); } - const originCap = origin.id.toUpperCase(); - const destCap = destination.id.toUpperCase(); - const { provider } = this.props; - - const ensureCorrectProvider = - (originCap === 'BTC' && destCap === 'ETH') || (destCap === 'BTC' && originCap === 'ETH'); - const ensureBityRatesLoaded = - bityRates.allIds.includes('ETHBTC') && bityRates.allIds.includes('BTCETH'); - const ensureShapeshiftRatesLoaded = shapeshiftRates.allIds.length > 0; - - if (ensureBityRatesLoaded && ensureCorrectProvider) { - if (provider === 'shapeshift') { - this.props.swapProvider('bity'); - } - } else if (ensureShapeshiftRatesLoaded) { - if (provider !== 'shapeshift') { - this.props.swapProvider('shapeshift'); - } - } - if (options.allIds !== prevProps.options.allIds && options.byId) { const originKindOptions: any[] = Object.values(options.byId); const destinationKindOptions: any[] = Object.values( diff --git a/common/containers/Tabs/Swap/index.tsx b/common/containers/Tabs/Swap/index.tsx index af51b987..564b7f6d 100644 --- a/common/containers/Tabs/Swap/index.tsx +++ b/common/containers/Tabs/Swap/index.tsx @@ -113,12 +113,10 @@ class Swap extends Component