ln-service 59.2.6 → 59.3.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.
- package/CHANGELOG.md +4 -0
- package/package.json +3 -3
- package/test/integration/test_propose_channel.js +12 -10
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"bolt07": "1.9.5",
|
|
11
|
-
"invoices": "6.0
|
|
11
|
+
"invoices": "6.1.0",
|
|
12
12
|
"lightning": "12.2.5",
|
|
13
13
|
"macaroon": "3.0.4"
|
|
14
14
|
},
|
|
15
15
|
"description": "Interaction helper for your Lightning Network daemon",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@alexbosworth/blockchain": "4.
|
|
17
|
+
"@alexbosworth/blockchain": "4.1.0",
|
|
18
18
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
19
19
|
"async": "3.2.6",
|
|
20
20
|
"asyncjs-util": "1.2.12",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"integration-test-0.20.0": "DOCKER_LND_VERSION=v0.20.0-beta npm run test",
|
|
61
61
|
"test": "echo $DOCKER_LND_VERSION && node test/runner"
|
|
62
62
|
},
|
|
63
|
-
"version": "59.
|
|
63
|
+
"version": "59.3.0"
|
|
64
64
|
}
|
|
@@ -10,6 +10,8 @@ const {extractTransaction} = require('psbt');
|
|
|
10
10
|
const {finalizePsbt} = require('psbt');
|
|
11
11
|
const {idForTransaction} = require('@alexbosworth/blockchain');
|
|
12
12
|
const {networks} = require('bitcoinjs-lib');
|
|
13
|
+
const {p2msScript} = require('@alexbosworth/blockchain');
|
|
14
|
+
const {p2wshOutputScript} = require('@alexbosworth/blockchain');
|
|
13
15
|
const {payments} = require('bitcoinjs-lib');
|
|
14
16
|
const {script} = require('bitcoinjs-lib');
|
|
15
17
|
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
@@ -31,6 +33,7 @@ const {proposeChannel} = require('./../../');
|
|
|
31
33
|
const {signPsbt} = require('./../../');
|
|
32
34
|
const {signTransaction} = require('./../../');
|
|
33
35
|
|
|
36
|
+
const bufferAsHex = buffer => buffer.toString('hex');
|
|
34
37
|
const capacity = 1e6;
|
|
35
38
|
const {ceil} = Math;
|
|
36
39
|
const cooperativeCloseDelay = 2016;
|
|
@@ -42,7 +45,6 @@ const idForTx = transaction => idForTransaction({transaction}).id;
|
|
|
42
45
|
const interval = 100;
|
|
43
46
|
const keyIndex = 0;
|
|
44
47
|
const network = 'regtest';
|
|
45
|
-
const {p2ms} = payments;
|
|
46
48
|
const {p2pkh} = payments;
|
|
47
49
|
const {regtest} = networks;
|
|
48
50
|
const reserveRatio = 0.01;
|
|
@@ -158,19 +160,19 @@ test(`Propose a channel with a coop delay`, async () => {
|
|
|
158
160
|
];
|
|
159
161
|
|
|
160
162
|
// Make the channel 2:2 funding output from control and target keys
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}),
|
|
163
|
+
const dualFundingChannelOutputScript = p2wshOutputScript({
|
|
164
|
+
hash: p2msScript({
|
|
165
|
+
keys: fundingMultiSigKeys.sort().map(n => Buffer.from(n, 'hex')),
|
|
166
|
+
required: fundingMultiSigKeys.length,
|
|
167
|
+
}).hash,
|
|
166
168
|
});
|
|
167
169
|
|
|
168
|
-
const pendingChannelId =
|
|
170
|
+
const pendingChannelId = dualFundingChannelOutputScript.script.slice(2);
|
|
169
171
|
|
|
170
172
|
// Create the basic PSBT that spends temporary funds to the 2:2 funding
|
|
171
173
|
const dualFundPsbt = createPsbt({
|
|
172
174
|
outputs: [{
|
|
173
|
-
script:
|
|
175
|
+
script: bufferAsHex(dualFundingChannelOutputScript.script),
|
|
174
176
|
tokens: capacity,
|
|
175
177
|
}],
|
|
176
178
|
utxos: [
|
|
@@ -235,7 +237,7 @@ test(`Propose a channel with a coop delay`, async () => {
|
|
|
235
237
|
inputs: [{
|
|
236
238
|
key_family: temporaryFamily,
|
|
237
239
|
key_index: controlDerivedKey.index,
|
|
238
|
-
output_script:
|
|
240
|
+
output_script: bufferAsHex(dualFundingChannelOutputScript.script),
|
|
239
241
|
output_tokens: giveTokens + ceil(fundingFee / temporaryKeys.length),
|
|
240
242
|
sighash: Transaction.SIGHASH_ALL,
|
|
241
243
|
vin: controlVin,
|
|
@@ -267,7 +269,7 @@ test(`Propose a channel with a coop delay`, async () => {
|
|
|
267
269
|
inputs: [{
|
|
268
270
|
key_family: temporaryFamily,
|
|
269
271
|
key_index: targetDerivedKey.index,
|
|
270
|
-
output_script:
|
|
272
|
+
output_script: bufferAsHex(dualFundingChannelOutputScript.script),
|
|
271
273
|
output_tokens: giveTokens + ceil(fundingFee / temporaryKeys.length),
|
|
272
274
|
sighash: Transaction.SIGHASH_ALL,
|
|
273
275
|
vin: targetVin,
|