ln-service 53.5.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
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"cors": "2.8.5",
|
|
12
12
|
"express": "4.17.2",
|
|
13
13
|
"invoices": "2.0.3",
|
|
14
|
-
"lightning": "5.3.
|
|
14
|
+
"lightning": "5.3.4",
|
|
15
15
|
"macaroon": "3.0.4",
|
|
16
16
|
"morgan": "1.10.0",
|
|
17
17
|
"ws": "8.4.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.5.
|
|
58
|
+
"version": "53.5.1"
|
|
59
59
|
}
|
|
@@ -9,7 +9,7 @@ const {setupChannel} = require('./../macros');
|
|
|
9
9
|
|
|
10
10
|
const interval = 100;
|
|
11
11
|
const size = 3;
|
|
12
|
-
const times =
|
|
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
|
-
|
|
22
|
+
try {
|
|
23
|
+
await control.generate({count: 100});
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
generate: target.generate,
|
|
26
|
-
lnd: target.lnd,
|
|
27
|
-
to: remote,
|
|
28
|
-
});
|
|
25
|
+
await setupChannel({lnd, generate: control.generate, to: target});
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
await setupChannel({
|
|
28
|
+
generate: target.generate,
|
|
29
|
+
lnd: target.lnd,
|
|
30
|
+
to: remote,
|
|
31
|
+
});
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
await asyncRetry({interval, times}, async () => {
|
|
34
|
+
await addPeer({lnd, public_key: remote.id, socket: remote.socket});
|
|
34
35
|
|
|
35
|
-
|
|
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
|
-
|
|
40
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
if (!targetScore.betweenness || !targetScore.betweenness_normalized) {
|
|
43
|
+
throw new Error('UnexpectedValueForTargetScoreBetweenness');
|
|
44
|
+
}
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
12
|
+
const interval = 200;
|
|
13
13
|
const nodes = [{watchers: true}, {tower: true}];
|
|
14
|
-
const times =
|
|
14
|
+
const times = 1000;
|
|
15
15
|
|
|
16
16
|
// Disconnecting a watchtower should remove a watchtower
|
|
17
17
|
test(`Disconnect watchtower`, async ({end, equal, match}) => {
|