ln-service 53.4.0 → 53.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Versions
2
2
 
3
+ ## 53.5.1
4
+
5
+ - `getPayments`: Correct paging issue that prevented paging through all results
6
+
7
+ ## 53.5.0
8
+
9
+ - `createWallet`: Add support for returning the admin `macaroon`
10
+
11
+ ## 53.4.2
12
+
13
+ - `pay`, `payViaPaymentRequest`: Fix support for `outgoing_channels` constraint
14
+
3
15
  ## 53.4.0
4
16
 
5
17
  - `deletePendingChannel`: Add method to remove a stuck pending channel open
package/README.md CHANGED
@@ -762,6 +762,9 @@ Requires unlocked lnd and unauthenticated LND API Object
762
762
  }
763
763
 
764
764
  @returns via cbk or Promise
765
+ {
766
+ macaroon: <Base64 Encoded Admin Macaroon String>
767
+ }
765
768
 
766
769
  Example:
767
770
 
package/package.json CHANGED
@@ -10,23 +10,23 @@
10
10
  "bolt07": "1.8.0",
11
11
  "cors": "2.8.5",
12
12
  "express": "4.17.2",
13
- "invoices": "2.0.2",
14
- "lightning": "5.3.1",
13
+ "invoices": "2.0.3",
14
+ "lightning": "5.3.4",
15
15
  "macaroon": "3.0.4",
16
16
  "morgan": "1.10.0",
17
- "ws": "8.4.0"
17
+ "ws": "8.4.2"
18
18
  },
19
19
  "description": "Interaction helper for your Lightning Network daemon",
20
20
  "devDependencies": {
21
21
  "@alexbosworth/tap": "15.0.10",
22
22
  "@alexbosworth/node-fetch": "2.6.2",
23
23
  "async": "3.2.3",
24
- "asyncjs-util": "1.2.7",
24
+ "asyncjs-util": "1.2.8",
25
25
  "bip66": "1.1.5",
26
26
  "bitcoinjs-lib": "6.0.1",
27
27
  "bn.js": "5.2.0",
28
28
  "ecpair": "2.0.1",
29
- "ln-docker-daemons": "2.1.0",
29
+ "ln-docker-daemons": "2.2.0",
30
30
  "portfinder": "1.0.28",
31
31
  "psbt": "1.1.10",
32
32
  "rimraf": "3.0.2",
@@ -55,5 +55,5 @@
55
55
  "scripts": {
56
56
  "test": "echo $DOCKER_LND_VERSION && tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 200 test/autopilotrpc-integration/*.js test/chainrpc-integration/*.js test/integration/*.js test/invoicesrpc-integration/*.js test/routerrpc-integration/*.js test/signerrpc-integration/*.js test/tower_clientrpc-integration/*.js test/tower_serverrpc-integration/*.js test/walletrpc-integration/*.js"
57
57
  },
58
- "version": "53.4.0"
58
+ "version": "53.5.1"
59
59
  }
@@ -8,6 +8,7 @@ const {test} = require('@alexbosworth/tap');
8
8
 
9
9
  const {addPeer} = require('./../../');
10
10
  const {broadcastChainTransaction} = require('./../../');
11
+ const {cancelPendingChannel} = require('./../../');
11
12
  const {createCluster} = require('./../macros');
12
13
  const {delay} = require('./../macros');
13
14
  const {deletePendingChannel} = require('./../../');
@@ -60,7 +61,7 @@ test(`Forfeit pending channel`, async ({end, equal}) => {
60
61
  // Sign the funding to the target
61
62
  const signTarget = await signPsbt({lnd, psbt: fundTarget.psbt});
62
63
 
63
- // Fund the target channel
64
+ // Fund the target channel that will get stuck
64
65
  await fundPendingChannels({
65
66
  lnd,
66
67
  channels: proposeToTarget.pending.map(n => n.id),
@@ -124,6 +125,17 @@ test(`Forfeit pending channel`, async ({end, equal}) => {
124
125
 
125
126
  const stuckTx = extractTransaction({psbt: signTarget.psbt});
126
127
 
128
+ const [stuckPending] = proposeToTarget.pending;
129
+
130
+ // Try to cancel the pending channel, it will fail
131
+ try {
132
+ await cancelPendingChannel({lnd, id: stuckPending.id});
133
+ } catch (err) {
134
+ const [code] = err;
135
+
136
+ equal(code, 503, 'Pending channel cannot be canceled');
137
+ }
138
+
127
139
  await deletePendingChannel({
128
140
  lnd,
129
141
  confirmed_transaction: transaction,
@@ -9,7 +9,7 @@ const {setupChannel} = require('./../macros');
9
9
 
10
10
  const interval = 100;
11
11
  const size = 3;
12
- const times = 300;
12
+ const times = 800;
13
13
 
14
14
  // Getting the network centrality should return the centrality scores
15
15
  test(`Get network centrality`, async ({end, equal, strictSame}) => {
@@ -19,42 +19,48 @@ test(`Get network centrality`, async ({end, equal, strictSame}) => {
19
19
 
20
20
  const {lnd} = control;
21
21
 
22
- await setupChannel({lnd, generate: control.generate, to: target});
22
+ try {
23
+ await control.generate({count: 100});
23
24
 
24
- await setupChannel({
25
- generate: target.generate,
26
- lnd: target.lnd,
27
- to: remote,
28
- });
25
+ await setupChannel({lnd, generate: control.generate, to: target});
29
26
 
30
- await asyncRetry({interval, times}, async () => {
31
- await addPeer({lnd, public_key: remote.id, socket: remote.socket});
27
+ await setupChannel({
28
+ generate: target.generate,
29
+ lnd: target.lnd,
30
+ to: remote,
31
+ });
32
32
 
33
- const {nodes} = await getNetworkCentrality({lnd});
33
+ await asyncRetry({interval, times}, async () => {
34
+ await addPeer({lnd, public_key: remote.id, socket: remote.socket});
34
35
 
35
- const controlScore = nodes.find(n => n.public_key === control.id);
36
- const remoteScore = nodes.find(n => n.public_key === remote.id);
37
- const targetScore = nodes.find(n => n.public_key === target.id);
36
+ const {nodes} = await getNetworkCentrality({lnd});
38
37
 
39
- if (!targetScore.betweenness || !targetScore.betweenness_normalized) {
40
- throw new Error('UnexpectedValueForTargetScoreBetweenness');
41
- }
38
+ const controlScore = nodes.find(n => n.public_key === control.id);
39
+ const remoteScore = nodes.find(n => n.public_key === remote.id);
40
+ const targetScore = nodes.find(n => n.public_key === target.id);
42
41
 
43
- if (targetScore.betweenness !== 1e6) {
44
- throw new Error('WrongBetweennessScore');
45
- }
42
+ if (!targetScore.betweenness || !targetScore.betweenness_normalized) {
43
+ throw new Error('UnexpectedValueForTargetScoreBetweenness');
44
+ }
46
45
 
47
- equal(controlScore.betweenness, 0, 'No centrality on control');
48
- equal(controlScore.betweenness_normalized, 0, 'No centrality on control');
49
- equal(remoteScore.betweenness, 0, 'No centrality on remote');
50
- equal(remoteScore.betweenness_normalized, 0, 'No centrality on remote');
51
- equal(targetScore.betweenness, 1e6, 'Centrality around target');
52
- equal(targetScore.betweenness_normalized, 1e6, 'Centrality around target');
46
+ if (targetScore.betweenness !== 1e6) {
47
+ throw new Error('WrongBetweennessScore');
48
+ }
53
49
 
54
- return;
55
- });
50
+ equal(controlScore.betweenness, 0, 'No centrality on control');
51
+ equal(controlScore.betweenness_normalized, 0, 'No control centrality');
52
+ equal(remoteScore.betweenness, 0, 'No centrality on remote');
53
+ equal(remoteScore.betweenness_normalized, 0, 'No centrality on remote');
54
+ equal(targetScore.betweenness, 1e6, 'Centrality around target');
55
+ equal(targetScore.betweenness_normalized, 1e6, 'Centrality at target');
56
56
 
57
- await kill({});
57
+ return;
58
+ });
59
+ } catch (err) {
60
+ equal(err, null, 'Expected no error');
61
+ } finally {
62
+ await kill({});
63
+ }
58
64
 
59
65
  return end();
60
66
  });
@@ -9,9 +9,9 @@ const {spawnLnd} = require('./../macros');
9
9
  const {waitForTermination} = require('./../macros');
10
10
 
11
11
  const all = promise => Promise.all(promise);
12
- const interval = 100;
12
+ const interval = 200;
13
13
  const nodes = [{watchers: true}, {tower: true}];
14
- const times = 200;
14
+ const times = 1000;
15
15
 
16
16
  // Disconnecting a watchtower should remove a watchtower
17
17
  test(`Disconnect watchtower`, async ({end, equal, match}) => {