ln-service 54.2.1 → 54.2.3
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 +8 -0
- package/README.md +2 -1
- package/package.json +5 -3
- package/test/integration/test_get_chain_transactions.js +2 -2
- package/test/integration/test_get_closed_channels.js +1 -1
- package/test/integration/test_open_channel.js +4 -0
- package/test/integration/test_recover_funds_from_channel.js +32 -26
- package/test/integration/test_subscribe_to_channels.js +1 -1
- package/test/integration/test_subscribe_to_rpc_requests.js +27 -17
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
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.
|
|
14
|
+
"lightning": "6.2.4",
|
|
15
15
|
"macaroon": "3.0.4",
|
|
16
16
|
"morgan": "1.10.0",
|
|
17
17
|
"ws": "8.9.0"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"bn.js": "5.2.1",
|
|
29
29
|
"bs58check": "2.1.2",
|
|
30
30
|
"ecpair": "2.1.0",
|
|
31
|
-
"ln-docker-daemons": "3.1.
|
|
31
|
+
"ln-docker-daemons": "3.1.2",
|
|
32
32
|
"p2tr": "1.3.2",
|
|
33
33
|
"portfinder": "1.0.32",
|
|
34
34
|
"psbt": "2.7.1",
|
|
@@ -56,8 +56,10 @@
|
|
|
56
56
|
"url": "https://github.com/alexbosworth/ln-service.git"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
|
+
"integration-test-0.15.3": "DOCKER_LND_VERSION=v0.15.3-beta npm run test",
|
|
59
60
|
"integration-test-0.15.2": "DOCKER_LND_VERSION=v0.15.2-beta npm run test",
|
|
61
|
+
"integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
|
|
60
62
|
"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
63
|
},
|
|
62
|
-
"version": "54.2.
|
|
64
|
+
"version": "54.2.3"
|
|
63
65
|
}
|
|
@@ -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:
|
|
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
|
|
30
|
+
if (wallet.current_block_height < count + 1) {
|
|
31
31
|
throw new Error('ExpectedFullySyncedToChain');
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -86,7 +86,7 @@ test(`Get closed channels`, async ({end, equal}) => {
|
|
|
86
86
|
|
|
87
87
|
// LND 0.11.1 and below do not use anchors
|
|
88
88
|
if (isAnchors) {
|
|
89
|
-
equal([53345, 2810].includes(spend), true, 'Final');
|
|
89
|
+
equal([53345, 28473, 2810].includes(spend), true, 'Final');
|
|
90
90
|
} else {
|
|
91
91
|
equal(spend, 9050, 'Final');
|
|
92
92
|
}
|
|
@@ -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
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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});
|
|
@@ -150,7 +150,7 @@ test('Subscribe to channels', async ({end, equal, fail}) => {
|
|
|
150
150
|
if (isAnchors) {
|
|
151
151
|
const final = closeEvent.final_local_balance;
|
|
152
152
|
|
|
153
|
-
equal([897190, 846655].includes(final), true, 'Close final
|
|
153
|
+
equal([897190, 846655, 863366].includes(final), true, 'Close final');
|
|
154
154
|
} else {
|
|
155
155
|
equal(closeEvent.final_local_balance, 890950, 'Close final local balance');
|
|
156
156
|
}
|
|
@@ -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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
err
|
|
152
|
-
|
|
153
|
-
|
|
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
|
}
|