ln-service 54.2.1 → 54.2.2

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,9 @@
1
1
  # Versions
2
2
 
3
+ ## 54.2.2
4
+
5
+ - `getWalletInfo`: Add support for LND 0.14.4
6
+
3
7
  ## 54.2.1
4
8
 
5
9
  - `getWalletInfo`: Add support for LND 0.15.2
package/README.md CHANGED
@@ -10,6 +10,7 @@ through npm.
10
10
  Supported LND versions:
11
11
 
12
12
  - v0.15.2-beta
13
+ - v0.14.4-beta
13
14
 
14
15
  For typescript-ready methods, check out https://github.com/alexbosworth/lightning#readme
15
16
 
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "cors": "2.8.5",
12
12
  "express": "4.18.2",
13
13
  "invoices": "2.2.0",
14
- "lightning": "6.2.2",
14
+ "lightning": "6.2.3",
15
15
  "macaroon": "3.0.4",
16
16
  "morgan": "1.10.0",
17
17
  "ws": "8.9.0"
@@ -57,7 +57,8 @@
57
57
  },
58
58
  "scripts": {
59
59
  "integration-test-0.15.2": "DOCKER_LND_VERSION=v0.15.2-beta npm run test",
60
+ "integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
60
61
  "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/peersrpc-integration/*.js test/routerrpc-integration/*.js test/signerrpc-integration/*.js test/tower_clientrpc-integration/*.js test/tower_serverrpc-integration/*.js test/walletrpc-integration/*.js"
61
62
  },
62
- "version": "54.2.1"
63
+ "version": "54.2.2"
63
64
  }
@@ -20,14 +20,14 @@ test(`Get chain transactions`, async ({end, equal, strictSame}) => {
20
20
  // Generate some funds for LND
21
21
  await generate({count});
22
22
 
23
- await asyncRetry({interval: 10, times: 2000}, async () => {
23
+ await asyncRetry({interval: 10, times: 3000}, async () => {
24
24
  const wallet = await getWalletInfo({lnd});
25
25
 
26
26
  if (!wallet.is_synced_to_chain) {
27
27
  throw new Error('ExpectedWalletSyncedToChain');
28
28
  }
29
29
 
30
- if (wallet.current_block_height !== count + 1) {
30
+ if (wallet.current_block_height < count + 1) {
31
31
  throw new Error('ExpectedFullySyncedToChain');
32
32
  }
33
33
  });
@@ -66,6 +66,10 @@ test(`Open channel`, async ({end, equal}) => {
66
66
 
67
67
  const policy = policies.find(n => n.public_key === id);
68
68
 
69
+ if (!policy.base_fee_mtokens) {
70
+ throw new Error('ExpectedKnownPolicyBaseFeeMtokens');
71
+ }
72
+
69
73
  // LND 0.15.3 and below do not support setting fees on open
70
74
  if (policy.base_fee_mtokens === defaultBaseFee) {
71
75
  return;
@@ -24,25 +24,29 @@ const times = 3000;
24
24
 
25
25
  // Using a channel backup should recover funds
26
26
  test(`Recover funds from channel`, async ({end, equal}) => {
27
- const control = await spawnLightningDocker({
28
- seed,
29
- chain_p2p_port: await getPort({port: 8000, stopPort: 9000}),
30
- chain_rpc_port: await getPort({port: 9001, stopPort: 10000}),
31
- chain_zmq_block_port: await getPort({port: 10001, stopPort: 11000}),
32
- chain_zmq_tx_port: await getPort({port: 11001, stopPort: 12000}),
33
- generate_address: generateAddress,
34
- lightning_p2p_port: await getPort({port: 12001, stopPort: 13000}),
35
- lightning_rpc_port: await getPort({port: 13001, stopPort: 14000}),
27
+ const control = await asyncRetry({interval, times}, async () => {
28
+ return await spawnLightningDocker({
29
+ seed,
30
+ chain_p2p_port: await getPort({port: 8000, stopPort: 9000}),
31
+ chain_rpc_port: await getPort({port: 9001, stopPort: 10000}),
32
+ chain_zmq_block_port: await getPort({port: 10001, stopPort: 11000}),
33
+ chain_zmq_tx_port: await getPort({port: 11001, stopPort: 12000}),
34
+ generate_address: generateAddress,
35
+ lightning_p2p_port: await getPort({port: 12001, stopPort: 13000}),
36
+ lightning_rpc_port: await getPort({port: 13001, stopPort: 14000}),
37
+ });
36
38
  });
37
39
 
38
- const target = await spawnLightningDocker({
39
- chain_p2p_port: await getPort({port: 8000, stopPort: 9000}),
40
- chain_rpc_port: await getPort({port: 9001, stopPort: 10000}),
41
- chain_zmq_block_port: await getPort({port: 10001, stopPort: 11000}),
42
- chain_zmq_tx_port: await getPort({port: 11001, stopPort: 12000}),
43
- generate_address: generateAddress,
44
- lightning_p2p_port: await getPort({port: 12001, stopPort: 13000}),
45
- lightning_rpc_port: await getPort({port: 13001, stopPort: 14000}),
40
+ const target = await asyncRetry({interval, times}, async () => {
41
+ return await spawnLightningDocker({
42
+ chain_p2p_port: await getPort({port: 8000, stopPort: 9000}),
43
+ chain_rpc_port: await getPort({port: 9001, stopPort: 10000}),
44
+ chain_zmq_block_port: await getPort({port: 10001, stopPort: 11000}),
45
+ chain_zmq_tx_port: await getPort({port: 11001, stopPort: 12000}),
46
+ generate_address: generateAddress,
47
+ lightning_p2p_port: await getPort({port: 12001, stopPort: 13000}),
48
+ lightning_rpc_port: await getPort({port: 13001, stopPort: 14000}),
49
+ });
46
50
  });
47
51
 
48
52
  await control.add_chain_peer({socket: target.chain_socket});
@@ -102,15 +106,17 @@ test(`Recover funds from channel`, async ({end, equal}) => {
102
106
 
103
107
  await control.kill({});
104
108
 
105
- const clone = await spawnLightningDocker({
106
- seed,
107
- chain_p2p_port: await getPort({port: 8000, stopPort: 9000}),
108
- chain_rpc_port: await getPort({port: 9001, stopPort: 10000}),
109
- chain_zmq_block_port: await getPort({port: 10001, stopPort: 11000}),
110
- chain_zmq_tx_port: await getPort({port: 11001, stopPort: 12000}),
111
- generate_address: generateAddress,
112
- lightning_p2p_port: await getPort({port: 12001, stopPort: 13000}),
113
- lightning_rpc_port: await getPort({port: 13001, stopPort: 14000}),
109
+ const clone = await asyncRetry({interval, times}, async () => {
110
+ return await spawnLightningDocker({
111
+ seed,
112
+ chain_p2p_port: await getPort({port: 8000, stopPort: 9000}),
113
+ chain_rpc_port: await getPort({port: 9001, stopPort: 10000}),
114
+ chain_zmq_block_port: await getPort({port: 10001, stopPort: 11000}),
115
+ chain_zmq_tx_port: await getPort({port: 11001, stopPort: 12000}),
116
+ generate_address: generateAddress,
117
+ lightning_p2p_port: await getPort({port: 12001, stopPort: 13000}),
118
+ lightning_rpc_port: await getPort({port: 13001, stopPort: 14000}),
119
+ });
114
120
  });
115
121
 
116
122
  await clone.add_chain_peer({socket: target.chain_socket});
@@ -12,8 +12,10 @@ const {sendMessageToPeer} = require('./../../');
12
12
  const {subscribeToInvoice} = require('./../../');
13
13
  const {subscribeToRpcRequests} = require('./../../');
14
14
 
15
+ const interval = 10;
15
16
  const message = '00';
16
17
  const subscribeInvoiceUri = '/invoicesrpc.Invoices/SubscribeSingleInvoice';
18
+ const times = 2000;
17
19
 
18
20
  // Subscribing to RPC requests should listen for RPC requests
19
21
  test(`Subscribe to RPC requests`, async ({end, equal, fail, strictSame}) => {
@@ -136,23 +138,31 @@ test(`Subscribe to RPC requests`, async ({end, equal, fail, strictSame}) => {
136
138
  }
137
139
  });
138
140
 
139
- try {
140
- // Gift some tokens in a channel
141
- await openChannel({
142
- lnd,
143
- give_tokens: 1e5,
144
- local_tokens: 1e6,
145
- partner_public_key: Buffer.alloc(33, 2).toString('hex'),
146
- });
147
-
148
- fail('ExpectedChannelRejected');
149
- } catch (err) {
150
- strictSame(
151
- err,
152
- [503, 'FailedToOpenChannel', {err: 'message'}],
153
- 'Channel open fails to execute'
154
- );
155
- }
141
+ await asyncRetry({interval, times}, async () => {
142
+ try {
143
+ // Gift some tokens in a channel
144
+ await openChannel({
145
+ lnd,
146
+ give_tokens: 1e5,
147
+ local_tokens: 1e6,
148
+ partner_public_key: Buffer.alloc(33, 2).toString('hex'),
149
+ });
150
+
151
+ fail('ExpectedChannelRejected');
152
+ } catch (err) {
153
+ const [code, message] = err;
154
+
155
+ if (message !== 'FailedToOpenChannel') {
156
+ throw err;
157
+ }
158
+
159
+ strictSame(
160
+ err,
161
+ [503, 'FailedToOpenChannel', {err: 'message'}],
162
+ 'Channel open fails to execute'
163
+ );
164
+ }
165
+ });
156
166
 
157
167
  subscription.removeAllListeners();
158
168
  }