Skip to content

Commit

Permalink
fix(Sell): address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Jul 7, 2018
1 parent 2351bbc commit 62fa6a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import * as service from 'services/CoinifyService'
import settings from 'config'
import { promptForSecondPassword } from 'services/SagaService'

export const sellDescription = `Exchange Trade CNY-`

export default ({ coreSagas }) => {
const logLocation = 'modules/coinify/sagas'

Expand Down Expand Up @@ -102,11 +104,11 @@ export default ({ coreSagas }) => {
payment = yield payment.to(path(['transferIn', 'details', 'account'], trade))
}

payment = yield payment.description(`Exchange Trade CNY-${trade.id}`)
payment = yield payment.description(`${sellDescription}${trade.id}`)
try {
payment = yield payment.build()
} catch (e) {
yield put(actions.logs.logErrorMessage(logLocation, 'sell', e))
throw new Error('could not build payment')
}

payment = yield payment.sign(password)
Expand All @@ -118,7 +120,7 @@ export default ({ coreSagas }) => {
yield put(A.coinifySuccess())
yield put(actions.form.change('buySellTabStatus', 'status', 'order_history'))
yield put(actions.modals.showModal('CoinifyTradeDetails', { trade }))
yield call(initializePayment)
yield put(A.initializePayment())
} catch (e) {
yield put(A.coinifyFailure(e))
yield put(actions.logs.logErrorMessage(logLocation, 'sell', e))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { promptForSecondPassword } from 'services/SagaService'
import { path, prop, equals, head } from 'ramda'
import { Remote } from 'blockchain-wallet-v4/src'

export const sellDescription = `Exchange Trade SFX-`

export default ({ coreSagas }) => {
const logLocation = 'modules/sfox/sagas'

Expand Down Expand Up @@ -169,12 +171,12 @@ export default ({ coreSagas }) => {
payment = yield payment.to(trade.receiveAddress)
}

payment = yield payment.description(`Exchange Trade SFX-${trade.id}`)
payment = yield payment.description(`${sellDescription}${trade.id}`)

try {
payment = yield payment.build()
} catch (e) {
yield put(actions.logs.logErrorMessage(logLocation, 'submitSellQuote', e))
throw new Error('could not build payment')
}

payment = yield payment.sign(password)
Expand All @@ -186,7 +188,7 @@ export default ({ coreSagas }) => {
yield put(A.sfoxSuccess())
yield put(actions.form.change('buySellTabStatus', 'status', 'order_history'))
yield put(modalActions.showModal('SfoxTradeDetails', { trade }))
yield call(initializePayment)
yield put(A.initializePayment())
} catch (e) {
yield put(A.sfoxFailure(e))
yield put(actions.logs.logErrorMessage(logLocation, 'submitSellQuote', e))
Expand Down

0 comments on commit 62fa6a0

Please sign in to comment.