Skip to content

Commit

Permalink
fix(prov-payment): remove if checks
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Apr 20, 2021
1 parent 951836e commit c50b332
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -939,12 +939,8 @@ export default ({
Number(cryptoAmt),
account.coin
)
if (payment.coin === 'BTC' || payment.coin === 'BCH') {
payment = yield payment.build()
} else {
payment = yield payment.amount(paymentAmount)
}

payment = yield payment.amount(paymentAmount)
payment = yield payment.build()
yield put(A.updatePaymentSuccess(payment.value()))
} catch (e) {
// eslint-disable-next-line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,11 @@ export default ({
coin
)
payment = yield payment.amount(paymentAmount)
if (payment.coin === 'BTC' || payment.coin === 'BCH') {
return (yield payment
.chain()
.to(quote.sampleDepositAddress, 'ADDRESS')
.build()
.done()).value()
}

return payment.value()
return (yield payment
.chain()
.to(quote.sampleDepositAddress, 'ADDRESS')
.build()
.done()).value()
} catch (e) {
// eslint-disable-next-line
console.log(e)
Expand Down Expand Up @@ -392,11 +388,8 @@ export default ({
BASE.coin,
Number(swapAmountValues?.cryptoAmount)
)
if (BASE.coin === 'BTC' || BASE.coin === 'BCH') {
payment = yield payment.build()
} else {
payment = yield payment.amount(paymentAmount)
}
payment = yield payment.amount(paymentAmount)
payment = yield payment.build()
yield put(A.updatePaymentSuccess(payment.value()))
} catch (error) {
yield put(A.updatePaymentFailure(error))
Expand Down

0 comments on commit c50b332

Please sign in to comment.