ln-service 59.2.3 → 59.2.4
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
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"bolt07": "1.9.5",
|
|
11
|
-
"invoices": "
|
|
12
|
-
"lightning": "12.2.
|
|
11
|
+
"invoices": "6.0.0",
|
|
12
|
+
"lightning": "12.2.4",
|
|
13
13
|
"macaroon": "3.0.4"
|
|
14
14
|
},
|
|
15
15
|
"description": "Interaction helper for your Lightning Network daemon",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@alexbosworth/blockchain": "
|
|
17
|
+
"@alexbosworth/blockchain": "4.0.0",
|
|
18
18
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
19
19
|
"async": "3.2.6",
|
|
20
20
|
"asyncjs-util": "1.2.12",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"integration-test-0.20.0": "DOCKER_LND_VERSION=v0.20.0-beta npm run test",
|
|
59
59
|
"test": "echo $DOCKER_LND_VERSION && node test/runner"
|
|
60
60
|
},
|
|
61
|
-
"version": "59.2.
|
|
61
|
+
"version": "59.2.4"
|
|
62
62
|
}
|
|
@@ -8,6 +8,7 @@ const {combinePsbts} = require('psbt');
|
|
|
8
8
|
const {decodePsbt} = require('psbt');
|
|
9
9
|
const {extractTransaction} = require('psbt');
|
|
10
10
|
const {finalizePsbt} = require('psbt');
|
|
11
|
+
const {idForTransaction} = require('@alexbosworth/blockchain');
|
|
11
12
|
const {networks} = require('bitcoinjs-lib');
|
|
12
13
|
const {payments} = require('bitcoinjs-lib');
|
|
13
14
|
const {script} = require('bitcoinjs-lib');
|
|
@@ -37,6 +38,7 @@ const family = 0;
|
|
|
37
38
|
const feeRate = 1;
|
|
38
39
|
const {fromHex} = Transaction;
|
|
39
40
|
const fundingFee = 190; // Vsize of 2 input, 1 output tx
|
|
41
|
+
const idForTx = transaction => idForTransaction({transaction}).id;
|
|
40
42
|
const interval = 100;
|
|
41
43
|
const keyIndex = 0;
|
|
42
44
|
const network = 'regtest';
|
|
@@ -144,18 +146,6 @@ test(`Propose a channel with a coop delay`, async () => {
|
|
|
144
146
|
psbt: targetFundPsbt.psbt,
|
|
145
147
|
});
|
|
146
148
|
|
|
147
|
-
// Decode the control funded PSBT
|
|
148
|
-
const controlPsbt = decodePsbt({ecp, psbt: controlFundPsbt.psbt});
|
|
149
|
-
|
|
150
|
-
// Decode the target funded PSBT
|
|
151
|
-
const targetPsbt = decodePsbt({ecp, psbt: targetFundPsbt.psbt});
|
|
152
|
-
|
|
153
|
-
// Derive the id of the control pre-funding tx
|
|
154
|
-
const controlId = fromHex(controlPsbt.unsigned_transaction).getId();
|
|
155
|
-
|
|
156
|
-
// Derive the id of the target pre-funding tx
|
|
157
|
-
const targetId = fromHex(targetPsbt.unsigned_transaction).getId();
|
|
158
|
-
|
|
159
149
|
// Derive a new control key for a 2:2 multisig
|
|
160
150
|
const controlMultiSigKey = await getPublicKey({family, lnd});
|
|
161
151
|
|
|
@@ -185,11 +175,11 @@ test(`Propose a channel with a coop delay`, async () => {
|
|
|
185
175
|
}],
|
|
186
176
|
utxos: [
|
|
187
177
|
{
|
|
188
|
-
id:
|
|
178
|
+
id: idForTx(controlSignPsbt.transaction),
|
|
189
179
|
vout: controlFundPsbt.outputs.findIndex(n => !n.is_change),
|
|
190
180
|
},
|
|
191
181
|
{
|
|
192
|
-
id:
|
|
182
|
+
id: idForTx(targetSignPsbt.transaction),
|
|
193
183
|
vout: targetFundPsbt.outputs.findIndex(n => !n.is_change),
|
|
194
184
|
},
|
|
195
185
|
],
|
|
@@ -221,7 +211,7 @@ test(`Propose a channel with a coop delay`, async () => {
|
|
|
221
211
|
|
|
222
212
|
const fundingTx = fromHex(finalFundingPsbt.unsigned_transaction);
|
|
223
213
|
|
|
224
|
-
const fundingTxId =
|
|
214
|
+
const fundingTxId = idForTx(finalFundingPsbt.unsigned_transaction);
|
|
225
215
|
|
|
226
216
|
const fundingTxVout = fundingTx.outs.findIndex(n => n.value === capacity);
|
|
227
217
|
|