Skip to content

Commit

Permalink
fix(nc-send): rebuild payment after form chance
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Apr 15, 2021
1 parent 28fb717 commit 9d31a10
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export default ({
coin
)
payment = yield payment.amount(paymentAmount)
payment = yield payment.build()
yield put(A.setPaymentSuccess(payment.value()))
}
break
Expand Down Expand Up @@ -281,7 +282,6 @@ export default ({
const defaultAccount = isFromBuySell
? yield call(getCustodialAccountForCoin, coin)
: yield call(getDefaultAccountForCoin, coin)

const payment: PaymentValue = yield call(createPayment, {
...defaultAccount,
address: getAccountIndexOrAccount(coin, defaultAccount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ export default ({
account.coin
)
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 @@ -393,6 +393,7 @@ export default ({
Number(swapAmountValues?.cryptoAmount)
)
payment = yield payment.amount(paymentAmount)
payment = yield payment.build()
yield put(A.updatePaymentSuccess(payment.value()))
} catch (error) {
yield put(A.updatePaymentFailure(error))
Expand Down
3 changes: 3 additions & 0 deletions packages/blockchain-wallet-v4/src/redux/payment/btc/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ export default ({ api }) => {
? Coin.fromJS({ script: target.script, value })
: Coin.fromJS({ address: target.address, value })
)
// logs inputs
// const inputs = CoinSelection.descentDraw(targets, fee, coins, change)
// console.log(inputs, 'inputs change')
return CoinSelection.descentDraw(targets, fee, coins, change)
}

Expand Down

0 comments on commit 9d31a10

Please sign in to comment.