From 834c752b39ca3e693af2eb9d45f65ff0357a3e07 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 13 Sep 2018 13:13:09 +0200 Subject: [PATCH 1/3] Set invoice as not private to add routing hint --- src/action/invoice.js | 3 +++ test/unit/action/invoice.spec.js | 1 + 2 files changed, 4 insertions(+) diff --git a/src/action/invoice.js b/src/action/invoice.js index a6e908607..eb93b3476 100644 --- a/src/action/invoice.js +++ b/src/action/invoice.js @@ -52,6 +52,8 @@ class InvoiceAction { * which can be rendered in a QR code for scanning. After the values * are set on the store the user is navigated to the invoice QR view * which displays the QR for consumption by the payer. + * The invoice is set to not private since it should contain routing + * information for private channels. * This action can be called from a view event handler as does all * the necessary error handling and notification display. * @return {Promise} @@ -62,6 +64,7 @@ class InvoiceAction { const response = await this._grpc.sendCommand('addInvoice', { value: toSatoshis(invoice.amount, settings), memo: invoice.note, + private: false, }); invoice.encoded = response.payment_request; invoice.uri = `${PREFIX_URI}${invoice.encoded}`; diff --git a/test/unit/action/invoice.spec.js b/test/unit/action/invoice.spec.js index f19018cc9..a2e067f93 100644 --- a/test/unit/action/invoice.spec.js +++ b/test/unit/action/invoice.spec.js @@ -60,6 +60,7 @@ describe('Action Invoice Unit Tests', () => { .withArgs('addInvoice', { value: 1000, memo: 'foo', + private: false, }) .resolves({ payment_request: 'some-request', From c181e31de84f80d373efedda3a8dcc9bdf1642d7 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 13 Sep 2018 17:14:45 +0200 Subject: [PATCH 2/3] Set private to true instead of false --- src/action/invoice.js | 2 +- test/unit/action/invoice.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/action/invoice.js b/src/action/invoice.js index eb93b3476..e3917a38c 100644 --- a/src/action/invoice.js +++ b/src/action/invoice.js @@ -64,7 +64,7 @@ class InvoiceAction { const response = await this._grpc.sendCommand('addInvoice', { value: toSatoshis(invoice.amount, settings), memo: invoice.note, - private: false, + private: true, }); invoice.encoded = response.payment_request; invoice.uri = `${PREFIX_URI}${invoice.encoded}`; diff --git a/test/unit/action/invoice.spec.js b/test/unit/action/invoice.spec.js index a2e067f93..64bfea1de 100644 --- a/test/unit/action/invoice.spec.js +++ b/test/unit/action/invoice.spec.js @@ -60,7 +60,7 @@ describe('Action Invoice Unit Tests', () => { .withArgs('addInvoice', { value: 1000, memo: 'foo', - private: false, + private: true, }) .resolves({ payment_request: 'some-request', From 0b8dda0635d467fff1d062a27a3173528eecadb3 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 13 Sep 2018 17:16:44 +0200 Subject: [PATCH 3/3] Fix docs --- src/action/invoice.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/action/invoice.js b/src/action/invoice.js index e3917a38c..d7f31d2e7 100644 --- a/src/action/invoice.js +++ b/src/action/invoice.js @@ -52,8 +52,8 @@ class InvoiceAction { * which can be rendered in a QR code for scanning. After the values * are set on the store the user is navigated to the invoice QR view * which displays the QR for consumption by the payer. - * The invoice is set to not private since it should contain routing - * information for private channels. + * The invoice is set private since it should contain a routing hint + * for private channels. * This action can be called from a view event handler as does all * the necessary error handling and notification display. * @return {Promise}