Skip to content

Commit

Permalink
fix(prov-payment): use payment.build only for btc and bch
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Apr 19, 2021
1 parent 9d31a10 commit 4e57882
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,12 @@ export default ({
Number(cryptoAmt),
account.coin
)
payment = yield payment.amount(paymentAmount)
payment = yield payment.build()
if (payment.coin === 'BTC' || payment.coin === 'BCH') {
payment = yield payment.build()
} else {
payment = yield payment.amount(paymentAmount)
}

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 @@ -392,8 +392,11 @@ export default ({
BASE.coin,
Number(swapAmountValues?.cryptoAmount)
)
payment = yield payment.amount(paymentAmount)
payment = yield payment.build()
if (BASE.coin === 'BTC' || BASE.coin === 'BCH') {
payment = yield payment.build()
} else {
payment = yield payment.amount(paymentAmount)
}
yield put(A.updatePaymentSuccess(payment.value()))
} catch (error) {
yield put(A.updatePaymentFailure(error))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export const getData = (state: RootState) => {
walletCurrency: ExtractSuccess<typeof walletCurrencyR>
) => {
const depositFee =
coin in Erc20CoinsEnum
? Number(propOr('0', 'fee', payment))
: Number(pathOr('0', ['selection', 'fee'], payment))
coin === 'BCH' || coin === 'BTC'
? Number(pathOr('0', ['selection', 'fee'], payment))
: Number(propOr('0', 'fee', payment))

const feeCrypto =
coin in Erc20CoinsEnum
Expand Down

0 comments on commit 4e57882

Please sign in to comment.