From da9cb1948d8f3659bb9627335a75dbf7f486155f Mon Sep 17 00:00:00 2001 From: michael1011 Date: Tue, 19 Feb 2019 17:50:45 +0100 Subject: [PATCH 1/2] fix: Joule make invoice amounts --- src/views/swap/steps/inputInvoice.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/swap/steps/inputInvoice.js b/src/views/swap/steps/inputInvoice.js index 715f4c6..2dcdfce 100644 --- a/src/views/swap/steps/inputInvoice.js +++ b/src/views/swap/steps/inputInvoice.js @@ -4,7 +4,11 @@ import injectSheet from 'react-jss'; import { FaBolt } from 'react-icons/fa'; import View from '../../../components/view'; import InputArea from '../../../components/inputarea'; -import { getCurrencyName, getSampleInvoice } from '../../../scripts/utils'; +import { + getCurrencyName, + getSampleInvoice, + toSatoshi, +} from '../../../scripts/utils'; const InputInvoiceStyles = () => ({ wrapper: { @@ -38,7 +42,7 @@ class StyledInputInvoice extends React.Component { const { swapInfo, webln } = this.props; if (webln) { - webln.makeInvoice(swapInfo.quoteAmount).then(response => { + webln.makeInvoice(toSatoshi(swapInfo.quoteAmount)).then(response => { const invoice = response.paymentRequest; this.setState({ value: invoice }); From f1bdb5ae81b167741d6576ea6aba1a1dd2c5931b Mon Sep 17 00:00:00 2001 From: michael1011 Date: Tue, 19 Feb 2019 18:28:29 +0100 Subject: [PATCH 2/2] fix: show errors for broadcasttransaction requests --- src/views/reverse/reverseActions.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/reverse/reverseActions.js b/src/views/reverse/reverseActions.js index 51344a4..96fdd74 100644 --- a/src/views/reverse/reverseActions.js +++ b/src/views/reverse/reverseActions.js @@ -127,8 +127,10 @@ const broadcastClaim = (currency, claimTransaction, cb) => { }) .then(() => cb()) .catch(error => { - window.alert(`Failed to broadcast claim transaction`); - dispatch(reverseSwapResponse(false, error.data)); + const message = error.response.data.error; + + window.alert(`Failed to broadcast claim transaction: ${message}`); + dispatch(reverseSwapResponse(false, message)); }); }; };