ln-service 56.7.0 → 56.7.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,9 @@
1
1
  # Versions
2
2
 
3
+ ## 56.7.1
4
+
5
+ - `isDestinationPayable`: Correct behavior for passing variations of amounts
6
+
3
7
  ## 56.7.0
4
8
 
5
9
  - `getPendingChannels`: Add `description` to return pending channel description
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.3",
14
- "lightning": "9.7.0",
14
+ "lightning": "9.7.1",
15
15
  "macaroon": "3.0.4",
16
16
  "morgan": "1.10.0",
17
17
  "ws": "8.13.0"
@@ -69,5 +69,5 @@
69
69
  "integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
70
70
  "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"
71
71
  },
72
- "version": "56.7.0"
72
+ "version": "56.7.1"
73
73
  }
@@ -0,0 +1,45 @@
1
+ const {setupChannel} = require('ln-docker-daemons');
2
+ const {spawnLightningCluster} = require('ln-docker-daemons');
3
+ const {test} = require('@alexbosworth/tap');
4
+
5
+ const {isDestinationPayable} = require('./../../');
6
+
7
+ const size = 2;
8
+ const tokens = 1e6 / 2;
9
+
10
+ // Determining if a route is payable should indicate if a route can be found
11
+ test('Is destination payable', async ({end, equal, strictSame}) => {
12
+ const {kill, nodes} = await spawnLightningCluster({size});
13
+
14
+ const [{generate, lnd}, target] = nodes;
15
+
16
+ try {
17
+ await setupChannel({generate, lnd, to: target});
18
+
19
+ const canPay = await isDestinationPayable({lnd, destination: target.id});
20
+
21
+ strictSame(canPay, {is_payable: true}, 'Can pay with default amount');
22
+
23
+ const canPayTokens = await isDestinationPayable({
24
+ lnd,
25
+ tokens,
26
+ destination: target.id,
27
+ });
28
+
29
+ strictSame(canPayTokens, {is_payable: true}, 'Can pay with tokens amount');
30
+
31
+ const canPayMtokens = await isDestinationPayable({
32
+ lnd,
33
+ mtokens: tokens,
34
+ destination: target.id,
35
+ });
36
+
37
+ strictSame(canPayMtokens, {is_payable: true}, 'Can pay with mtokens sum');
38
+ } catch (err) {
39
+ equal(err, null, 'Expected no error');
40
+ } finally {
41
+ await kill({});
42
+ }
43
+
44
+ return end();
45
+ });