ln-service 52.16.1 → 53.0.0

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -8
  3. package/package.json +4 -12
  4. package/test/autopilotrpc-integration/test_autopilot.js +9 -15
  5. package/test/chainrpc-integration/test_get_height.js +7 -10
  6. package/test/chainrpc-integration/test_subscribe_to_blocks.js +52 -31
  7. package/test/chainrpc-integration/test_subscribe_to_chain_address.js +72 -66
  8. package/test/chainrpc-integration/test_subscribe_to_chain_spend.js +47 -16
  9. package/test/{integration → extra-integration}/test_recover_funds_from_channel.js +0 -0
  10. package/test/{integration → extra-integration}/test_recover_funds_from_channels.js +0 -0
  11. package/test/{integration → extra-integration}/test_restrict_macaroon.js +0 -0
  12. package/test/{integration → extra-integration}/test_revoke_access.js +0 -0
  13. package/test/{integration → extra-integration}/test_subscribe_to_rpc_requests.js +1 -1
  14. package/test/integration/test_add_peer.js +16 -12
  15. package/test/integration/test_cancel_pending_channel.js +20 -6
  16. package/test/integration/test_close_channel.js +15 -10
  17. package/test/integration/test_create_chain_address.js +3 -6
  18. package/test/integration/test_create_invoice.js +27 -23
  19. package/test/integration/test_decode_payment_request.js +30 -29
  20. package/test/integration/test_delete_payment.js +11 -8
  21. package/test/integration/test_delete_payments.js +13 -16
  22. package/test/integration/test_get_access_ids.js +4 -7
  23. package/test/integration/test_get_backup.js +12 -8
  24. package/test/integration/test_get_backups.js +8 -10
  25. package/test/integration/test_get_chain_balance.js +9 -53
  26. package/test/integration/test_get_chain_fee_estimate.js +21 -10
  27. package/test/integration/test_get_chain_transactions.js +30 -52
  28. package/test/integration/test_get_channel.js +7 -7
  29. package/test/integration/test_get_channel_balance.js +5 -6
  30. package/test/integration/test_get_channels.js +11 -10
  31. package/test/integration/test_get_closed_channels.js +169 -139
  32. package/test/integration/test_get_failed_payments.js +36 -39
  33. package/test/integration/test_get_fee_rates.js +6 -9
  34. package/test/integration/test_get_forwards.js +34 -35
  35. package/test/integration/test_get_invoice.js +7 -11
  36. package/test/integration/test_get_invoices.js +33 -30
  37. package/test/integration/test_get_methods.js +4 -7
  38. package/test/integration/test_get_network_centrality.js +14 -17
  39. package/test/integration/test_get_network_graph.js +12 -15
  40. package/test/integration/test_get_network_info.js +5 -6
  41. package/test/integration/test_get_node.js +15 -31
  42. package/test/integration/test_get_payments.js +10 -10
  43. package/test/integration/test_get_peers.js +10 -13
  44. package/test/integration/test_get_pending_coop.js +13 -18
  45. package/test/integration/test_get_pending_force.js +29 -21
  46. package/test/integration/test_get_route_to_destination.js +47 -40
  47. package/test/integration/test_get_utxos.js +17 -42
  48. package/test/integration/test_get_wallet_info.js +5 -12
  49. package/test/integration/test_open_channel.js +16 -9
  50. package/test/integration/test_open_channels.js +66 -66
  51. package/test/integration/test_pay.js +39 -36
  52. package/test/integration/test_pay_private_invoice.js +78 -71
  53. package/test/integration/test_payment_errors.js +13 -11
  54. package/test/integration/test_propose_channel.js +74 -53
  55. package/test/integration/test_push_funds.js +11 -15
  56. package/test/integration/test_rebalance.js +11 -22
  57. package/test/integration/test_remove_peer.js +13 -48
  58. package/test/integration/test_send_message_to_peer.js +20 -14
  59. package/test/integration/test_send_to_chain_address.js +60 -51
  60. package/test/integration/test_send_to_chain_addresses.js +30 -18
  61. package/test/integration/test_sign_message.js +3 -6
  62. package/test/integration/test_stop_daemon.js +3 -9
  63. package/test/integration/test_subscribe_to_backups.js +19 -11
  64. package/test/integration/test_subscribe_to_channels.js +28 -20
  65. package/test/integration/test_subscribe_to_graph.js +43 -22
  66. package/test/integration/test_subscribe_to_invoices.js +89 -103
  67. package/test/integration/test_subscribe_to_open_requests.js +47 -31
  68. package/test/integration/test_subscribe_to_peer_messages.js +51 -21
  69. package/test/integration/test_subscribe_to_peers.js +11 -16
  70. package/test/integration/test_subscribe_to_transactions.js +49 -45
  71. package/test/integration/test_update_routing_fees.js +12 -16
  72. package/test/integration/test_verify_access.js +5 -10
  73. package/test/integration/test_verify_backup.js +10 -8
  74. package/test/integration/test_verify_backups.js +11 -16
  75. package/test/integration/test_verify_message.js +6 -9
  76. package/test/invoicesrpc-integration/test_cancel_invoice.js +15 -22
  77. package/test/invoicesrpc-integration/test_get_sweep_transactions.js +15 -11
  78. package/test/invoicesrpc-integration/test_push_payment.js +53 -55
  79. package/test/invoicesrpc-integration/test_settle_invoice.js +25 -19
  80. package/test/invoicesrpc-integration/test_subscribe_cancel_invoice.js +13 -11
  81. package/test/invoicesrpc-integration/test_subscribe_settle_invoice.js +20 -15
  82. package/test/macros/change_password.js +14 -12
  83. package/test/macros/generate_blocks.js +23 -28
  84. package/test/macros/rpc.js +1 -0
  85. package/test/macros/setup_channel.js +23 -9
  86. package/test/macros/spawn_lnd.js +2 -0
  87. package/test/macros/wait_for_channel.js +8 -3
  88. package/test/macros/wait_for_route.js +2 -2
  89. package/test/routerrpc-integration/test_delete_forwarding_reputations.js +15 -22
  90. package/test/routerrpc-integration/test_disable_channel.js +8 -12
  91. package/test/routerrpc-integration/test_get_forwarding_confidence.js +17 -37
  92. package/test/routerrpc-integration/test_get_forwarding_reputations.js +26 -23
  93. package/test/routerrpc-integration/test_get_pathfinding_settings.js +6 -12
  94. package/test/routerrpc-integration/test_get_payment.js +19 -26
  95. package/test/routerrpc-integration/test_get_route_confidence.js +15 -21
  96. package/test/routerrpc-integration/test_get_route_through_hops.js +29 -32
  97. package/test/routerrpc-integration/test_multipath_payment.js +18 -20
  98. package/test/routerrpc-integration/test_pay_via_payment_details.js +19 -34
  99. package/test/routerrpc-integration/test_pay_via_payment_request.js +17 -27
  100. package/test/routerrpc-integration/test_pay_via_routes.js +37 -37
  101. package/test/routerrpc-integration/test_probe_for_route.js +27 -33
  102. package/test/routerrpc-integration/test_subscribe_to_forward_requests.js +39 -44
  103. package/test/routerrpc-integration/test_subscribe_to_forwards.js +83 -77
  104. package/test/routerrpc-integration/test_subscribe_to_past_payments.js +34 -28
  105. package/test/routerrpc-integration/test_update_pathfinding_settings.js +7 -10
  106. package/test/signerrpc-integration/test_diffie_hellman_compute_secret.js +15 -14
  107. package/test/signerrpc-integration/test_sign_bytes.js +11 -15
  108. package/test/signerrpc-integration/test_sign_transaction.js +6 -7
  109. package/test/signerrpc-integration/test_verify_bytes_signature.js +11 -12
  110. package/test/versionrpc-integration/test_get_wallet_version.js +6 -7
  111. package/test/walletrpc-integration/test_fund_psbt.js +13 -12
  112. package/test/walletrpc-integration/test_get_chain_fee_rate.js +4 -8
  113. package/test/walletrpc-integration/test_get_locked_utxos.js +11 -27
  114. package/test/walletrpc-integration/test_get_public_key.js +5 -13
  115. package/test/walletrpc-integration/test_lock_utxo.js +16 -23
  116. package/test/walletrpc-integration/test_send_to_chain_output_scripts.js +25 -6
  117. package/test/walletrpc-integration/test_sign_psbt.js +28 -19
  118. package/test/walletrpc-integration/test_unlock_utxo.js +16 -27
  119. package/test/walletrpc-integration/test_update_chain_transaction.js +6 -31
@@ -1,37 +1,19 @@
1
1
  const asyncRetry = require('async/retry');
2
+ const {spawnLightningCluster} = require('ln-docker-daemons');
2
3
  const {test} = require('@alexbosworth/tap');
3
4
 
4
- const {chainSendTransaction} = require('./../macros');
5
- const {createChainAddress} = require('./../../');
6
- const {generateBlocks} = require('./../macros');
7
5
  const {getChainBalance} = require('./../../');
8
- const {mineTransaction} = require('./../macros');
9
- const {spawnLnd} = require('./../macros');
10
- const {waitForTermination} = require('./../macros');
11
- const {waitForUtxo} = require('./../macros');
12
6
 
13
- const count = 100;
14
- const defaultFee = 1e3;
15
- const defaultVout = 0;
16
7
  const emptyChainBalance = 0;
17
- const format = 'np2wpkh';
18
- const interval = retryCount => 50 * Math.pow(2, retryCount);
19
- const times = 15;
20
- const tokens = 1e8;
8
+ const interval = 1;
9
+ const times = 150;
10
+ const tokens = 5000000000;
21
11
 
22
12
  // Getting chain balance should result in a chain balance
23
13
  test(`Get the chain balance`, async ({end, equal}) => {
24
- const node = await spawnLnd({});
14
+ const {kill, nodes} = await spawnLightningCluster({});
25
15
 
26
- const cert = node.chain_rpc_cert_file;
27
- const host = node.listen_ip;
28
- const {kill} = node;
29
- const pass = node.chain_rpc_pass;
30
- const port = node.chain_rpc_port;
31
- const {lnd} = node;
32
- const user = node.chain_rpc_user;
33
-
34
- const {address} = await createChainAddress({format, lnd});
16
+ const [{generate, lnd}] = nodes;
35
17
 
36
18
  // The initial chain balance should be zero
37
19
  {
@@ -41,40 +23,14 @@ test(`Get the chain balance`, async ({end, equal}) => {
41
23
  }
42
24
 
43
25
  // Generate some funds for LND
44
- const {blocks} = await node.generate({count});
45
-
46
- const [block] = blocks;
47
-
48
- const [coinbaseTransaction] = block.transaction_ids;
49
-
50
- const {transaction} = chainSendTransaction({
51
- tokens,
52
- destination: address,
53
- fee: defaultFee,
54
- private_key: node.mining_key,
55
- spend_transaction_id: coinbaseTransaction,
56
- spend_vout: defaultVout,
57
- });
58
-
59
- // Wait for generation to be over
60
- await asyncRetry({interval, times}, async () => {
61
- await mineTransaction({cert, host, pass, port, transaction, user});
62
-
63
- if (!(await getChainBalance({lnd})).chain_balance) {
64
- throw new Error('ExpectedChainBalanceReflected');
65
- }
66
-
67
- return;
68
- });
26
+ await generate({count: 100});
69
27
 
70
28
  // Check that the balance is updated
71
29
  const postDeposit = await getChainBalance({lnd});
72
30
 
73
- equal(postDeposit.chain_balance, tokens - defaultFee, 'Deposited funds');
74
-
75
- kill();
31
+ equal(postDeposit.chain_balance >= tokens, true, 'Got funds');
76
32
 
77
- await waitForTermination({lnd});
33
+ await kill({});
78
34
 
79
35
  return end();
80
36
  });
@@ -1,27 +1,38 @@
1
- const {address} = require('bitcoinjs-lib');
1
+ const asyncRetry = require('async/retry');
2
+ const {spawnLightningCluster} = require('ln-docker-daemons');
2
3
  const {test} = require('@alexbosworth/tap');
3
4
 
4
5
  const {createChainAddress} = require('./../../');
5
- const {createCluster} = require('./../macros');
6
- const {delay} = require('./../macros');
6
+ const {getChainBalance} = require('./../../');
7
7
  const {getChainFeeEstimate} = require('./../../');
8
8
 
9
- const expectedFee = 9750;
9
+ const expectedFee = 8650;
10
10
  const expectedFeeRate = 50;
11
- const format = 'p2wpkh';
11
+ const format = 'np2wpkh';
12
+ const size = 2;
13
+ const times = 200;
12
14
  const tokens = 1e6;
13
15
 
14
16
  // Getting a chain fee estimate should return an estimate of the chain fee
15
17
  test(`Get chain fee estimate`, async ({end, equal}) => {
16
- const cluster = await createCluster({is_remote_skipped: true});
18
+ const {kill, nodes} = await spawnLightningCluster({size});
17
19
 
18
- const {lnd} = cluster.target;
20
+ const [control, {lnd}] = nodes;
19
21
 
20
- const address1 = (await createChainAddress({format, lnd})).address;
22
+ const address1 = (await createChainAddress({lnd})).address;
21
23
  const address2 = (await createChainAddress({format, lnd})).address;
22
24
 
25
+ // Generate coins for the node
26
+ await asyncRetry({times}, async () => {
27
+ if (!(await getChainBalance({lnd: control.lnd})).chain_balance) {
28
+ await control.generate({});
29
+
30
+ throw new Error('ExpectedChainBalance');
31
+ }
32
+ });
33
+
23
34
  const estimate = await getChainFeeEstimate({
24
- lnd: cluster.control.lnd,
35
+ lnd: control.lnd,
25
36
  send_to: [
26
37
  {address: address1, tokens: tokens / [address1, address2].length},
27
38
  {address: address2, tokens: tokens / [address1, address2].length},
@@ -31,7 +42,7 @@ test(`Get chain fee estimate`, async ({end, equal}) => {
31
42
  equal(estimate.fee, expectedFee, 'Total fee is estimated');
32
43
  equal(estimate.tokens_per_vbyte, expectedFeeRate, 'Fee per vbyte is given');
33
44
 
34
- await cluster.kill({});
45
+ await kill({});
35
46
 
36
47
  return end();
37
48
  });
@@ -1,62 +1,35 @@
1
1
  const asyncRetry = require('async/retry');
2
+ const {spawnLightningCluster} = require('ln-docker-daemons');
2
3
  const {test} = require('@alexbosworth/tap');
3
4
 
4
- const {chainSendTransaction} = require('./../macros');
5
- const {createChainAddress} = require('./../../');
6
- const {delay} = require('./../macros');
7
- const {generateBlocks} = require('./../macros');
8
5
  const {getChainBalance} = require('./../../');
9
6
  const {getChainTransactions} = require('./../../');
10
- const {getWalletVersion} = require('./../../');
11
- const {mineTransaction} = require('./../macros');
12
- const {spawnLnd} = require('./../macros');
13
- const {waitForTermination} = require('./../macros');
14
- const {waitForUtxo} = require('./../macros');
7
+ const {getWalletInfo} = require('./../../');
15
8
 
16
9
  const count = 100;
17
10
  const defaultFee = 1e3;
18
- const defaultVout = 0;
19
- const emptyChainBalance = 0;
20
11
  const format = 'np2wpkh';
21
- const interval = retryCount => 10 * Math.pow(2, retryCount);
22
- const times = 20;
23
- const tokens = 1e8;
12
+ const times = 300;
24
13
 
25
14
  // Getting chain transactions should list out the chain transactions
26
- test(`Get chain transactions`, async ({end, equal, fail, strictSame}) => {
27
- const node = await spawnLnd({});
15
+ test(`Get chain transactions`, async ({end, equal, strictSame}) => {
16
+ const {kill, nodes} = await spawnLightningCluster({});
28
17
 
29
- const cert = node.chain_rpc_cert_file;
30
- const host = node.listen_ip;
31
- const {kill} = node;
32
- const pass = node.chain_rpc_pass;
33
- const port = node.chain_rpc_port;
34
- const {lnd} = node;
35
- const user = node.chain_rpc_user;
36
-
37
- const {address} = await createChainAddress({format, lnd});
18
+ const [{generate, lnd}] = nodes;
38
19
 
39
20
  // Generate some funds for LND
40
- const {blocks} = await node.generate({count});
41
-
42
- const [block] = blocks;
21
+ await generate({count});
43
22
 
44
- const [coinbaseTransaction] = block.transaction_ids;
23
+ await asyncRetry({interval: 10, times: 1000}, async () => {
24
+ const wallet = await getWalletInfo({lnd});
45
25
 
46
- const {transaction} = chainSendTransaction({
47
- tokens,
48
- destination: address,
49
- fee: defaultFee,
50
- private_key: node.mining_key,
51
- spend_transaction_id: coinbaseTransaction,
52
- spend_vout: defaultVout,
26
+ if (!wallet.is_synced_to_chain) {
27
+ throw new Error('ExpectedWalletSyncedToChain');
28
+ }
53
29
  });
54
30
 
55
31
  // Wait for generation to be over
56
- await asyncRetry({interval, times}, async () => {
57
- // Generate to confirm the tx
58
- await mineTransaction({cert, host, pass, port, transaction, user});
59
-
32
+ await asyncRetry({times}, async () => {
60
33
  const {transactions} = await getChainTransactions({lnd});
61
34
 
62
35
  const [tx] = transactions;
@@ -70,16 +43,22 @@ test(`Get chain transactions`, async ({end, equal, fail, strictSame}) => {
70
43
 
71
44
  const {transactions} = await getChainTransactions({lnd});
72
45
 
73
- equal(transactions.length, [transaction].length, 'Transaction found');
46
+ equal(transactions.length > 1, true, 'Transaction found');
74
47
 
75
48
  const [tx] = transactions;
76
49
 
50
+ equal(!!tx.block_id, true, 'Transaction has block id');
51
+ equal(!!tx.confirmation_count, true, 'Transaction confirm count');
52
+ equal(!!tx.confirmation_height, true, 'Transaction confirm height');
53
+ equal(!!tx.created_at, true, 'Transaction record create time');
54
+ equal(tx.description, undefined, 'No tx description');
55
+ equal(tx.fee, undefined, 'No transaction fee');
56
+ equal(!!tx.id, true, 'Transaction id');
77
57
  equal(tx.is_confirmed, true, 'Transaction is confirmed');
78
58
  equal(tx.is_outgoing, false, 'Transaction is incoming');
79
- strictSame(tx.output_addresses, [address], 'Address is returned');
80
- equal(tx.tokens, tokens - defaultFee, 'Chain tokens are returned');
81
-
82
- const wallet = await getWalletVersion({lnd});
59
+ equal(tx.output_addresses.length, 1, 'Tx output address');
60
+ equal(tx.tokens, 5000000000, 'Got coinbase reward tokens');
61
+ equal(!!tx.transaction, true, 'Got transaction hex');
83
62
 
84
63
  const onlyAfter = await getChainTransactions({
85
64
  lnd,
@@ -88,10 +67,11 @@ test(`Get chain transactions`, async ({end, equal, fail, strictSame}) => {
88
67
 
89
68
  equal(onlyAfter.transactions.length, [].length, 'No transactions after');
90
69
 
91
- const onlyBefore = await getChainTransactions({
92
- lnd,
93
- before: tx.confirmation_height,
94
- });
70
+ const [height] = transactions
71
+ .map(n => n.confirmation_height)
72
+ .sort((a, b) => a - b);
73
+
74
+ const onlyBefore = await getChainTransactions({lnd, before: height});
95
75
 
96
76
  equal(onlyBefore.transactions.length, [].length, 'No tx before');
97
77
 
@@ -103,9 +83,7 @@ test(`Get chain transactions`, async ({end, equal, fail, strictSame}) => {
103
83
 
104
84
  strictSame(between.transactions.length, [tx].length, 'One transaction');
105
85
 
106
- kill();
107
-
108
- await waitForTermination({lnd});
86
+ await kill({});
109
87
 
110
88
  return end();
111
89
  });
@@ -1,27 +1,27 @@
1
+ const {spawnLightningCluster} = require('ln-docker-daemons');
1
2
  const {test} = require('@alexbosworth/tap');
2
3
 
3
- const {createCluster} = require('./../macros');
4
4
  const {getChannel} = require('./../../');
5
5
  const {getChannels} = require('./../../');
6
6
  const {setupChannel} = require('./../macros');
7
7
 
8
- const confirmationCount = 20;
9
8
  const {ceil} = Math;
9
+ const size = 2;
10
10
 
11
11
  // Getting a channel should return channel details from the channel graph
12
12
  test(`Get channel`, async ({end, equal}) => {
13
- const cluster = await createCluster({is_remote_skipped: true});
13
+ const {kill, nodes} = await spawnLightningCluster({size});
14
14
 
15
- const {lnd} = cluster.control;
15
+ const [{generate, lnd}, target] = nodes;
16
16
 
17
- await setupChannel({lnd, generate: cluster.generate, to: cluster.target});
17
+ await setupChannel({generate, lnd, to: target});
18
18
 
19
19
  const [channel] = (await getChannels({lnd})).channels;
20
20
 
21
21
  const details = await getChannel({lnd, id: channel.id});
22
22
 
23
23
  equal(details.capacity, channel.capacity, 'Capacity');
24
- equal(details.policies.length, [cluster.control, cluster.target].length);
24
+ equal(details.policies.length, size, 'Policies for both nodes');
25
25
 
26
26
  details.policies.forEach(policy => {
27
27
  equal(policy.base_fee_mtokens, '1000', 'Base fee mtokens');
@@ -41,7 +41,7 @@ test(`Get channel`, async ({end, equal}) => {
41
41
 
42
42
  equal(Date.now() - new Date(details.updated_at) < 1e5, true, 'Updated at');
43
43
 
44
- await cluster.kill({});
44
+ await kill({});
45
45
 
46
46
  return end();
47
47
  });
@@ -1,22 +1,21 @@
1
+ const {spawnLightningCluster} = require('ln-docker-daemons');
1
2
  const {test} = require('@alexbosworth/tap');
2
3
 
3
4
  const {getChannelBalance} = require('./../../');
4
- const {spawnLnd} = require('./../macros');
5
- const {waitForTermination} = require('./../macros');
6
5
 
7
6
  const emptyBalance = 0;
8
7
 
9
8
  // Getting channel balance should result in a channel balance
10
9
  test(`Get the channel balance`, async ({end, equal}) => {
11
- const {kill, lnd} = await spawnLnd({});
10
+ const {kill, nodes} = await spawnLightningCluster({});
11
+
12
+ const [{lnd}] = nodes;
12
13
 
13
14
  const result = await getChannelBalance({lnd});
14
15
 
15
16
  equal(result.channel_balance, emptyBalance, 'Valid channel balance');
16
17
 
17
- kill();
18
-
19
- await waitForTermination({lnd});
18
+ await kill({});
20
19
 
21
20
  return end();
22
21
  });
@@ -1,33 +1,34 @@
1
+ const {spawnLightningCluster} = require('ln-docker-daemons');
1
2
  const {test} = require('@alexbosworth/tap');
2
3
 
3
- const {createCluster} = require('./../macros');
4
4
  const {getChannels} = require('./../../');
5
5
  const {getWalletInfo} = require('./../../');
6
6
  const {setupChannel} = require('./../macros');
7
7
 
8
+ const anchorFeatureBit = 23;
8
9
  const giveTokens = 1e5;
9
10
  const remoteCsv = 40;
11
+ const size = 2;
10
12
 
11
13
  // Getting channels should return the list of channels
12
14
  test(`Get channels`, async ({end, equal, ok}) => {
13
- const cluster = await createCluster({is_remote_skipped: true});
15
+ const {kill, nodes} = await spawnLightningCluster({size});
14
16
 
15
- const {generate} = cluster;
16
- const {lnd} = cluster.control;
17
+ const [{generate, lnd}, target] = nodes;
17
18
 
18
19
  const chan = await setupChannel({
20
+ generate,
19
21
  lnd,
20
- generate: cluster.generate,
21
22
  give: giveTokens,
22
23
  partner_csv_delay: remoteCsv,
23
- to: cluster.target,
24
+ to: target,
24
25
  });
25
26
 
26
27
  const [channel] = (await getChannels({lnd})).channels;
27
28
  const {features} = await getWalletInfo({lnd});
28
- const [targetChan] = (await getChannels({lnd: cluster.target.lnd})).channels;
29
+ const [targetChan] = (await getChannels({lnd: target.lnd})).channels;
29
30
 
30
- const isAnchors = !!features.find(n => n.bit === 23);
31
+ const isAnchors = !!features.find(n => n.bit === anchorFeatureBit);
31
32
 
32
33
  equal(targetChan.is_partner_initiated, true, 'Self-init channel');
33
34
 
@@ -73,7 +74,7 @@ test(`Get channels`, async ({end, equal, ok}) => {
73
74
  equal(channel.is_partner_initiated, false, 'Partner initiated channel');
74
75
  equal(channel.is_private, false, 'Channel not private');
75
76
  equal(channel.local_reserve, 10000, 'Local reserve');
76
- equal(channel.partner_public_key, cluster.target.public_key, 'Pubkey');
77
+ equal(channel.partner_public_key, target.id, 'Pubkey');
77
78
  equal(channel.pending_payments.length, 0, 'No pending payments');
78
79
  equal(channel.received, 0, 'Channel received');
79
80
  equal(channel.remote_balance, 100000, 'Channel remote balance');
@@ -83,7 +84,7 @@ test(`Get channels`, async ({end, equal, ok}) => {
83
84
  equal(channel.transaction_vout, 0, 'Channel transactin vout');
84
85
  equal(channel.unsettled_balance, 0, 'Channel unsettled balance');
85
86
 
86
- await cluster.kill({});
87
+ await kill({});
87
88
 
88
89
  return end();
89
90
  });