lightning 11.1.0 → 12.0.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 +8 -0
- package/grpc/protos/lightning.proto +137 -2
- package/grpc/protos/router.proto +69 -3
- package/grpc/protos/signer.proto +60 -0
- package/grpc/protos/walletkit.proto +67 -1
- package/lnd_messages/pay_via_route_request.js +0 -2
- package/lnd_methods/info/get_configuration.js +1 -1
- package/lnd_methods/info/get_route_to_destination.d.ts +0 -4
- package/lnd_methods/info/get_route_to_destination.js +4 -6
- package/lnd_methods/macaroon/subscribe_to_rpc_requests.d.ts +0 -2
- package/lnd_methods/macaroon/subscribe_to_rpc_requests.js +0 -1
- package/lnd_methods/offchain/attempt_route.d.ts +0 -2
- package/lnd_methods/offchain/attempt_route.js +0 -1
- package/lnd_methods/offchain/finished_payment.d.ts +0 -10
- package/lnd_methods/offchain/finished_payment.js +0 -5
- package/lnd_methods/offchain/get_failed_payments.d.ts +0 -2
- package/lnd_methods/offchain/get_failed_payments.js +0 -1
- package/lnd_methods/offchain/get_payment.d.ts +0 -6
- package/lnd_methods/offchain/get_payment.js +0 -3
- package/lnd_methods/offchain/get_payments.d.ts +0 -2
- package/lnd_methods/offchain/get_payments.js +0 -1
- package/lnd_methods/offchain/get_pending_payments.d.ts +0 -2
- package/lnd_methods/offchain/get_pending_payments.js +0 -1
- package/lnd_methods/offchain/get_route_through_hops.d.ts +0 -2
- package/lnd_methods/offchain/get_route_through_hops.js +0 -1
- package/lnd_methods/offchain/list_payments.js +0 -1
- package/lnd_methods/offchain/pay.d.ts +0 -4
- package/lnd_methods/offchain/pay.js +0 -3
- package/lnd_methods/offchain/pay_via_payment_details.d.ts +0 -4
- package/lnd_methods/offchain/pay_via_payment_details.js +0 -2
- package/lnd_methods/offchain/pay_via_payment_request.d.ts +0 -4
- package/lnd_methods/offchain/pay_via_payment_request.js +0 -2
- package/lnd_methods/offchain/pay_via_routes.d.ts +0 -4
- package/lnd_methods/offchain/pay_via_routes.js +0 -3
- package/lnd_methods/offchain/probe_for_route.d.ts +0 -2
- package/lnd_methods/offchain/probe_for_route.js +0 -2
- package/lnd_methods/offchain/subscribe_to_channels.js +1 -1
- package/lnd_methods/offchain/subscribe_to_past_payment.d.ts +0 -4
- package/lnd_methods/offchain/subscribe_to_past_payment.js +0 -2
- package/lnd_methods/offchain/subscribe_to_past_payments.d.ts +0 -2
- package/lnd_methods/offchain/subscribe_to_past_payments.js +0 -1
- package/lnd_methods/offchain/subscribe_to_pay.d.ts +0 -10
- package/lnd_methods/offchain/subscribe_to_pay.js +0 -5
- package/lnd_methods/offchain/subscribe_to_pay_via_details.js +0 -5
- package/lnd_methods/offchain/subscribe_to_pay_via_request.js +0 -5
- package/lnd_methods/offchain/subscribe_to_pay_via_routes.d.ts +0 -10
- package/lnd_methods/offchain/subscribe_to_pay_via_routes.js +0 -5
- package/lnd_methods/offchain/subscribe_to_payments.d.ts +0 -4
- package/lnd_methods/offchain/subscribe_to_payments.js +0 -2
- package/lnd_methods/offchain/subscribe_to_probe_for_route.d.ts +0 -8
- package/lnd_methods/offchain/subscribe_to_probe_for_route.js +0 -4
- package/lnd_requests/rpc_hop_from_hop.js +0 -7
- package/lnd_requests/rpc_route_from_route.js +0 -2
- package/lnd_responses/confirmed_from_payment.d.ts +0 -6
- package/lnd_responses/confirmed_from_payment.js +0 -3
- package/lnd_responses/confirmed_from_payment_status.js +0 -5
- package/lnd_responses/pending_from_payment.js +0 -2
- package/lnd_responses/routes_from_query_routes.js +0 -3
- package/lnd_responses/routing_failure_from_htlc.js +0 -2
- package/lnd_responses/rpc_attempt_htlc_as_attempt.js +0 -2
- package/lnd_responses/rpc_hop_as_hop.js +0 -7
- package/lnd_responses/rpc_payment_as_payment.js +0 -2
- package/lnd_responses/rpc_route_as_route.js +0 -2
- package/package.json +4 -4
- package/test/lnd_messages/test_pay_via_route_request.js +0 -2
- package/test/lnd_methods/fixtures/query_routes_response.json +0 -1
- package/test/lnd_methods/info/test_get_route_to_destination.js +0 -3
- package/test/lnd_methods/macaroon/test_handle_rpc_request_update.js +0 -2
- package/test/lnd_methods/offchain/test_finished_payment.js +0 -4
- package/test/lnd_methods/offchain/test_get_payment.js +0 -5
- package/test/lnd_methods/offchain/test_get_payments.js +0 -2
- package/test/lnd_methods/offchain/test_get_route_through_hops.js +0 -4
- package/test/lnd_methods/offchain/test_is_destination_payable.js +0 -3
- package/test/lnd_methods/offchain/test_pay.js +0 -3
- package/test/lnd_methods/offchain/test_pay_via_payment_details.js +0 -4
- package/test/lnd_methods/offchain/test_pay_via_payment_request.js +0 -4
- package/test/lnd_methods/offchain/test_pay_via_routes.js +0 -9
- package/test/lnd_methods/offchain/test_subscribe_to_channels.js +0 -20
- package/test/lnd_methods/offchain/test_subscribe_to_past_payments.js +0 -3
- package/test/lnd_methods/offchain/test_subscribe_to_pay_via_routes.js +0 -7
- package/test/lnd_methods/offchain/test_subscribe_to_payments.js +0 -3
- package/test/lnd_methods/offchain/test_subscribe_to_probe_for_route.js +0 -1
- package/test/lnd_requests/test_rpc_hop_from_hop.js +1 -10
- package/test/lnd_requests/test_rpc_route_from_route.js +0 -4
- package/test/lnd_responses/test_confirmed_from_payment.js +0 -3
- package/test/lnd_responses/test_confirmed_from_payment_status.js +0 -4
- package/test/lnd_responses/test_pending_from_payment.js +0 -2
- package/test/lnd_responses/test_routes_from_query_routes.js +0 -2
- package/test/lnd_responses/test_routing_failure_from_htlc.js +0 -2
- package/test/lnd_responses/test_rpc_attempt_htlc_as_attempt.js +0 -2
- package/test/lnd_responses/test_rpc_hop_as_hop.js +0 -7
- package/test/lnd_responses/test_rpc_payment_as_payment.js +0 -6
- package/test/lnd_responses/test_rpc_route_as_route.js +0 -2
- package/test-typescript/typescript/attempt_route.test-d.ts +0 -1
- package/test-typescript/typescript/confirmed_from_payment.test-d.ts +0 -1
- package/test-typescript/typescript/finished_payment.test-d.ts +0 -2
- package/test-typescript/typescript/pay.test-d.ts +0 -1
- package/test-typescript/typescript/pay_via_routes.test-d.ts +0 -1
- package/test-typescript/typescript/subscribe_to_pay_via_routes.test-d.ts +0 -1
|
@@ -11,7 +11,6 @@ const makeExpected = overrides => {
|
|
|
11
11
|
fee_mtokens: '1',
|
|
12
12
|
hops: [{
|
|
13
13
|
channel: '0x0x1',
|
|
14
|
-
channel_capacity: 1,
|
|
15
14
|
fee: 0,
|
|
16
15
|
fee_mtokens: '1',
|
|
17
16
|
forward: 0,
|
|
@@ -41,7 +40,6 @@ const makeLnd = ({}) => {
|
|
|
41
40
|
route: {
|
|
42
41
|
hops: [{
|
|
43
42
|
amt_to_forward_msat: '1',
|
|
44
|
-
chan_capacity: '1',
|
|
45
43
|
chan_id: '1',
|
|
46
44
|
expiry: 1,
|
|
47
45
|
fee_msat: '1',
|
|
@@ -193,7 +191,6 @@ const tests = [
|
|
|
193
191
|
route: {
|
|
194
192
|
hops: [{
|
|
195
193
|
amt_to_forward_msat: '1',
|
|
196
|
-
chan_capacity: '1',
|
|
197
194
|
chan_id: '1',
|
|
198
195
|
expiry: 1,
|
|
199
196
|
fee_msat: '1',
|
|
@@ -221,7 +218,6 @@ const tests = [
|
|
|
221
218
|
fee_mtokens: '1',
|
|
222
219
|
hops: [{
|
|
223
220
|
channel: '0x0x1',
|
|
224
|
-
channel_capacity: 1,
|
|
225
221
|
fee: 0,
|
|
226
222
|
fee_mtokens: '1',
|
|
227
223
|
forward: 0,
|
|
@@ -39,7 +39,6 @@ const makePaymentData = overrides => {
|
|
|
39
39
|
hops: [{
|
|
40
40
|
amt_to_forward_msat: '1000',
|
|
41
41
|
chan_id: '1',
|
|
42
|
-
chan_capacity: 1,
|
|
43
42
|
expiry: 1,
|
|
44
43
|
fee_msat: '1000',
|
|
45
44
|
mpp_record: {
|
|
@@ -168,7 +167,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
168
167
|
fee_mtokens: '1',
|
|
169
168
|
hops: [{
|
|
170
169
|
channel: '0x0x1',
|
|
171
|
-
channel_capacity: 1,
|
|
172
170
|
fee: 0,
|
|
173
171
|
fee_mtokens: '1',
|
|
174
172
|
forward: 0,
|
|
@@ -182,7 +180,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
182
180
|
fee_mtokens: '1',
|
|
183
181
|
hops: [{
|
|
184
182
|
channel: '0x0x1',
|
|
185
|
-
channel_capacity: 1,
|
|
186
183
|
fee: 0,
|
|
187
184
|
fee_mtokens: '1',
|
|
188
185
|
forward: 0,
|
|
@@ -44,7 +44,6 @@ const makePaymentData = overrides => {
|
|
|
44
44
|
hops: [{
|
|
45
45
|
amt_to_forward_msat: '1000',
|
|
46
46
|
chan_id: '1',
|
|
47
|
-
chan_capacity: 1,
|
|
48
47
|
expiry: 1,
|
|
49
48
|
fee_msat: '1000',
|
|
50
49
|
mpp_record: {
|
|
@@ -127,7 +126,6 @@ const tests = [
|
|
|
127
126
|
fee_mtokens: '1000',
|
|
128
127
|
hops: [{
|
|
129
128
|
channel: '1x1x1',
|
|
130
|
-
channel_capacity: 1,
|
|
131
129
|
fee: 1,
|
|
132
130
|
fee_mtokens: '1000',
|
|
133
131
|
forward: 1,
|
|
@@ -148,7 +146,6 @@ const tests = [
|
|
|
148
146
|
fee_mtokens: '1000',
|
|
149
147
|
hops: [{
|
|
150
148
|
channel: '1x1x1',
|
|
151
|
-
channel_capacity: 1,
|
|
152
149
|
fee: 1,
|
|
153
150
|
fee_mtokens: '1000',
|
|
154
151
|
forward: 1,
|
|
@@ -39,7 +39,6 @@ const makePaymentData = overrides => {
|
|
|
39
39
|
hops: [{
|
|
40
40
|
amt_to_forward_msat: '1000',
|
|
41
41
|
chan_id: '1',
|
|
42
|
-
chan_capacity: 1,
|
|
43
42
|
expiry: 1,
|
|
44
43
|
fee_msat: '1000',
|
|
45
44
|
mpp_record: {
|
|
@@ -168,7 +167,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
168
167
|
fee_mtokens: '1',
|
|
169
168
|
hops: [{
|
|
170
169
|
channel: '0x0x1',
|
|
171
|
-
channel_capacity: 1,
|
|
172
170
|
fee: 0,
|
|
173
171
|
fee_mtokens: '1',
|
|
174
172
|
forward: 0,
|
|
@@ -182,7 +180,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
182
180
|
fee_mtokens: '1',
|
|
183
181
|
hops: [{
|
|
184
182
|
channel: '0x0x1',
|
|
185
|
-
channel_capacity: 1,
|
|
186
183
|
fee: 0,
|
|
187
184
|
fee_mtokens: '1',
|
|
188
185
|
forward: 0,
|
|
@@ -213,7 +210,6 @@ const makeLegacyConfirmed = ({}) => {
|
|
|
213
210
|
route: {
|
|
214
211
|
hops: [{
|
|
215
212
|
amt_to_forward_msat: '1',
|
|
216
|
-
chan_capacity: '1',
|
|
217
213
|
chan_id: '1',
|
|
218
214
|
expiry: 1,
|
|
219
215
|
fee_msat: '1',
|
|
@@ -39,7 +39,6 @@ const makePaymentData = overrides => {
|
|
|
39
39
|
hops: [{
|
|
40
40
|
amt_to_forward_msat: '1000',
|
|
41
41
|
chan_id: '1',
|
|
42
|
-
chan_capacity: 1,
|
|
43
42
|
expiry: 1,
|
|
44
43
|
fee_msat: '1000',
|
|
45
44
|
mpp_record: {
|
|
@@ -136,7 +135,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
136
135
|
fee_mtokens: '1',
|
|
137
136
|
hops: [{
|
|
138
137
|
channel: '0x0x1',
|
|
139
|
-
channel_capacity: 1,
|
|
140
138
|
fee: 0,
|
|
141
139
|
fee_mtokens: '1',
|
|
142
140
|
forward: 0,
|
|
@@ -150,7 +148,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
150
148
|
fee_mtokens: '1',
|
|
151
149
|
hops: [{
|
|
152
150
|
channel: '0x0x1',
|
|
153
|
-
channel_capacity: 1,
|
|
154
151
|
fee: 0,
|
|
155
152
|
fee_mtokens: '1',
|
|
156
153
|
forward: 0,
|
|
@@ -181,7 +178,6 @@ const makeLegacyConfirmed = ({}) => {
|
|
|
181
178
|
route: {
|
|
182
179
|
hops: [{
|
|
183
180
|
amt_to_forward_msat: '1',
|
|
184
|
-
chan_capacity: '1',
|
|
185
181
|
chan_id: '1',
|
|
186
182
|
expiry: 1,
|
|
187
183
|
fee_msat: '1',
|
|
@@ -94,7 +94,6 @@ const tests = [
|
|
|
94
94
|
fee_mtokens: '1000',
|
|
95
95
|
hops: [{
|
|
96
96
|
channel: '1x1x1',
|
|
97
|
-
channel_capacity: 1,
|
|
98
97
|
fee: 1,
|
|
99
98
|
fee_mtokens: '1000',
|
|
100
99
|
forward: 1,
|
|
@@ -121,7 +120,6 @@ const tests = [
|
|
|
121
120
|
fee_mtokens: '1000',
|
|
122
121
|
hops: [{
|
|
123
122
|
channel: '1x1x1',
|
|
124
|
-
channel_capacity: 1,
|
|
125
123
|
fee: 1,
|
|
126
124
|
fee_mtokens: '1000',
|
|
127
125
|
forward: 1,
|
|
@@ -152,7 +150,6 @@ const tests = [
|
|
|
152
150
|
fee_mtokens: '1000',
|
|
153
151
|
hops: [{
|
|
154
152
|
channel: '1x1x1',
|
|
155
|
-
channel_capacity: 1,
|
|
156
153
|
fee: 1,
|
|
157
154
|
fee_mtokens: '1000',
|
|
158
155
|
forward: 1,
|
|
@@ -178,7 +175,6 @@ const tests = [
|
|
|
178
175
|
fee_mtokens: '1000',
|
|
179
176
|
hops: [...Array(21)].map(() => ({
|
|
180
177
|
channel: '1x1x1',
|
|
181
|
-
channel_capacity: 1,
|
|
182
178
|
fee: 1,
|
|
183
179
|
fee_mtokens: '1000',
|
|
184
180
|
forward: 1,
|
|
@@ -214,7 +210,6 @@ const tests = [
|
|
|
214
210
|
fee_mtokens: '1000',
|
|
215
211
|
hops: [{
|
|
216
212
|
channel: '1x1x1',
|
|
217
|
-
channel_capacity: 1,
|
|
218
213
|
fee: 1,
|
|
219
214
|
fee_mtokens: '1000',
|
|
220
215
|
forward: 1,
|
|
@@ -284,7 +279,6 @@ const tests = [
|
|
|
284
279
|
hops: [
|
|
285
280
|
{
|
|
286
281
|
channel: '1x1x1',
|
|
287
|
-
channel_capacity: 1,
|
|
288
282
|
fee: 1,
|
|
289
283
|
fee_mtokens: '1000',
|
|
290
284
|
forward: 1,
|
|
@@ -294,7 +288,6 @@ const tests = [
|
|
|
294
288
|
},
|
|
295
289
|
{
|
|
296
290
|
channel: '0x116x52145',
|
|
297
|
-
channel_capacity: 1,
|
|
298
291
|
fee: 1,
|
|
299
292
|
fee_mtokens: '1000',
|
|
300
293
|
forward: 1,
|
|
@@ -355,7 +348,6 @@ const tests = [
|
|
|
355
348
|
fee_mtokens: '1000',
|
|
356
349
|
hops: [{
|
|
357
350
|
channel: '1x1x1',
|
|
358
|
-
channel_capacity: 1,
|
|
359
351
|
fee: 1,
|
|
360
352
|
fee_mtokens: '1000',
|
|
361
353
|
forward: 1,
|
|
@@ -375,7 +367,6 @@ const tests = [
|
|
|
375
367
|
fee_mtokens: '1000',
|
|
376
368
|
hops: [{
|
|
377
369
|
channel: '1x1x1',
|
|
378
|
-
channel_capacity: 1,
|
|
379
370
|
fee: 1,
|
|
380
371
|
fee_mtokens: '1000',
|
|
381
372
|
forward: 1,
|
|
@@ -152,26 +152,6 @@ const tests = [
|
|
|
152
152
|
}],
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
|
-
{
|
|
156
|
-
args: {lnd: makeLnd({data: {}})},
|
|
157
|
-
description: 'Channel data type is expected',
|
|
158
|
-
expected: {
|
|
159
|
-
events: [{
|
|
160
|
-
data: new Error('ExpectedEventTypeInChannelSubscription'),
|
|
161
|
-
event: 'error',
|
|
162
|
-
}],
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
args: {lnd: makeLnd({data: {type: 1}})},
|
|
167
|
-
description: 'Channel data type string is expected',
|
|
168
|
-
expected: {
|
|
169
|
-
events: [{
|
|
170
|
-
data: new Error('ExpectedEventTypeInChannelSubscription'),
|
|
171
|
-
event: 'error',
|
|
172
|
-
}],
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
155
|
{
|
|
176
156
|
args: {lnd: makeLnd({data: {type: 'event'}})},
|
|
177
157
|
description: 'Channel data details are expected',
|
|
@@ -167,7 +167,6 @@ const tests = [
|
|
|
167
167
|
hops: [{
|
|
168
168
|
amt_to_forward: '1',
|
|
169
169
|
amt_to_forward_msat: '1000',
|
|
170
|
-
chan_capacity: '1',
|
|
171
170
|
chan_id: '1',
|
|
172
171
|
custom_records: {'1': Buffer.alloc(1)},
|
|
173
172
|
expiry: 1,
|
|
@@ -212,7 +211,6 @@ const tests = [
|
|
|
212
211
|
hops: [
|
|
213
212
|
{
|
|
214
213
|
channel: '0x0x1',
|
|
215
|
-
channel_capacity: 1,
|
|
216
214
|
fee: 1,
|
|
217
215
|
fee_mtokens: '1000',
|
|
218
216
|
forward: 1,
|
|
@@ -231,7 +229,6 @@ const tests = [
|
|
|
231
229
|
hops: [
|
|
232
230
|
{
|
|
233
231
|
channel: '0x0x1',
|
|
234
|
-
channel_capacity: 1,
|
|
235
232
|
fee: 1,
|
|
236
233
|
fee_mtokens: '1000',
|
|
237
234
|
forward: 1,
|
|
@@ -13,7 +13,6 @@ const route = {
|
|
|
13
13
|
fee_mtokens: '1000',
|
|
14
14
|
hops: [{
|
|
15
15
|
channel: '0x0x1',
|
|
16
|
-
channel_capacity: 1,
|
|
17
16
|
fee_mtokens: '1',
|
|
18
17
|
forward_mtokens: '1',
|
|
19
18
|
public_key: 'public_key',
|
|
@@ -244,14 +243,12 @@ const tests = [
|
|
|
244
243
|
hops: [
|
|
245
244
|
{
|
|
246
245
|
channel: '0x0x1',
|
|
247
|
-
channel_capacity: 1,
|
|
248
246
|
fee_mtokens: '1',
|
|
249
247
|
forward_mtokens: '1',
|
|
250
248
|
public_key: 'public_key',
|
|
251
249
|
},
|
|
252
250
|
{
|
|
253
251
|
channel: '0x0x1',
|
|
254
|
-
channel_capacity: 1,
|
|
255
252
|
fee_mtokens: '1',
|
|
256
253
|
forward_mtokens: '1',
|
|
257
254
|
public_key: 'public_key',
|
|
@@ -271,14 +268,12 @@ const tests = [
|
|
|
271
268
|
hops: [
|
|
272
269
|
{
|
|
273
270
|
channel: '0x0x1',
|
|
274
|
-
channel_capacity: 1,
|
|
275
271
|
fee_mtokens: '1',
|
|
276
272
|
forward_mtokens: '1',
|
|
277
273
|
public_key: 'public_key',
|
|
278
274
|
},
|
|
279
275
|
{
|
|
280
276
|
channel: '0x0x1',
|
|
281
|
-
channel_capacity: 1,
|
|
282
277
|
fee_mtokens: '1',
|
|
283
278
|
forward_mtokens: '1',
|
|
284
279
|
public_key: 'public_key',
|
|
@@ -302,14 +297,12 @@ const tests = [
|
|
|
302
297
|
hops: [
|
|
303
298
|
{
|
|
304
299
|
channel: '0x0x1',
|
|
305
|
-
channel_capacity: 1,
|
|
306
300
|
fee_mtokens: '1',
|
|
307
301
|
forward_mtokens: '1',
|
|
308
302
|
public_key: 'public_key',
|
|
309
303
|
},
|
|
310
304
|
{
|
|
311
305
|
channel: '0x0x1',
|
|
312
|
-
channel_capacity: 1,
|
|
313
306
|
fee_mtokens: '1',
|
|
314
307
|
forward_mtokens: '1',
|
|
315
308
|
public_key: 'public_key',
|
|
@@ -59,7 +59,6 @@ const tests = [
|
|
|
59
59
|
hops: [{
|
|
60
60
|
amt_to_forward: '1',
|
|
61
61
|
amt_to_forward_msat: '1000',
|
|
62
|
-
chan_capacity: '1',
|
|
63
62
|
chan_id: '1',
|
|
64
63
|
custom_records: {'1': Buffer.alloc(1)},
|
|
65
64
|
expiry: 1,
|
|
@@ -102,7 +101,6 @@ const tests = [
|
|
|
102
101
|
fee_mtokens: '1000',
|
|
103
102
|
hops: [{
|
|
104
103
|
channel: '0x0x1',
|
|
105
|
-
channel_capacity: 1,
|
|
106
104
|
fee: 1,
|
|
107
105
|
fee_mtokens: '1000',
|
|
108
106
|
forward: 1,
|
|
@@ -118,7 +116,6 @@ const tests = [
|
|
|
118
116
|
fee_mtokens: '1000',
|
|
119
117
|
hops: [{
|
|
120
118
|
channel: '0x0x1',
|
|
121
|
-
channel_capacity: 1,
|
|
122
119
|
fee: 1,
|
|
123
120
|
fee_mtokens: '1000',
|
|
124
121
|
forward: 1,
|
|
@@ -7,23 +7,17 @@ const rpcHopFromHop = require('./../../lnd_requests/rpc_hop_from_hop');
|
|
|
7
7
|
const tests = [
|
|
8
8
|
{
|
|
9
9
|
args: {},
|
|
10
|
-
description: 'Channel capacity is expected',
|
|
11
|
-
error: 'ExpectedNumericChannelCapacityToMapRpcHopFromHop',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
args: {channel_capacity: 1},
|
|
15
10
|
description: 'Forward mtokens are expected',
|
|
16
11
|
error: 'ExpectedForwardMillitokensToMapRpcHopFromHop',
|
|
17
12
|
},
|
|
18
13
|
{
|
|
19
|
-
args: {
|
|
14
|
+
args: {forward_mtokens: '1'},
|
|
20
15
|
description: 'Fee mtokens are expected',
|
|
21
16
|
error: 'ExpectedFeeMillitokensToMapRpcHopFromHop',
|
|
22
17
|
},
|
|
23
18
|
{
|
|
24
19
|
args: {
|
|
25
20
|
channel: '0x0x1',
|
|
26
|
-
channel_capacity: 1,
|
|
27
21
|
fee: 1,
|
|
28
22
|
fee_mtokens: '1000',
|
|
29
23
|
forward: '1',
|
|
@@ -36,7 +30,6 @@ const tests = [
|
|
|
36
30
|
amt_to_forward: '1',
|
|
37
31
|
amt_to_forward_msat: '1000',
|
|
38
32
|
chan_id: '1',
|
|
39
|
-
chan_capacity: '1',
|
|
40
33
|
expiry: 1,
|
|
41
34
|
fee: '1',
|
|
42
35
|
fee_msat: '1000',
|
|
@@ -47,7 +40,6 @@ const tests = [
|
|
|
47
40
|
{
|
|
48
41
|
args: {
|
|
49
42
|
channel: '0x0x1',
|
|
50
|
-
channel_capacity: 1,
|
|
51
43
|
fee: 1,
|
|
52
44
|
fee_mtokens: '1000',
|
|
53
45
|
forward: '1',
|
|
@@ -61,7 +53,6 @@ const tests = [
|
|
|
61
53
|
amt_to_forward: '1',
|
|
62
54
|
amt_to_forward_msat: '1000',
|
|
63
55
|
chan_id: '1',
|
|
64
|
-
chan_capacity: '1',
|
|
65
56
|
custom_records: {'12': Buffer.from('34', 'hex')},
|
|
66
57
|
expiry: 1,
|
|
67
58
|
fee: '1',
|
|
@@ -40,7 +40,6 @@ const tests = [
|
|
|
40
40
|
fee_mtokens: '1000',
|
|
41
41
|
hops: [{
|
|
42
42
|
channel: '0x0x1',
|
|
43
|
-
channel_capacity: 1,
|
|
44
43
|
fee: 1,
|
|
45
44
|
fee_mtokens: '1000',
|
|
46
45
|
forward: 1,
|
|
@@ -59,7 +58,6 @@ const tests = [
|
|
|
59
58
|
amt_to_forward: '1',
|
|
60
59
|
amt_to_forward_msat: '1000',
|
|
61
60
|
chan_id: '1',
|
|
62
|
-
chan_capacity: '1',
|
|
63
61
|
expiry: 1,
|
|
64
62
|
fee: '1',
|
|
65
63
|
fee_msat: '1000',
|
|
@@ -83,7 +81,6 @@ const tests = [
|
|
|
83
81
|
fee_mtokens: '1000',
|
|
84
82
|
hops: [{
|
|
85
83
|
channel: '0x0x1',
|
|
86
|
-
channel_capacity: 1,
|
|
87
84
|
fee: 1,
|
|
88
85
|
fee_mtokens: '1000',
|
|
89
86
|
forward: 1,
|
|
@@ -102,7 +99,6 @@ const tests = [
|
|
|
102
99
|
amt_to_forward: '1',
|
|
103
100
|
amt_to_forward_msat: '1000',
|
|
104
101
|
chan_id: '1',
|
|
105
|
-
chan_capacity: '1',
|
|
106
102
|
custom_records: {'1': Buffer.alloc(1)},
|
|
107
103
|
expiry: 1,
|
|
108
104
|
fee: '1',
|
|
@@ -20,7 +20,6 @@ const makeArgs = overrides => {
|
|
|
20
20
|
hops: [{
|
|
21
21
|
amt_to_forward: '1',
|
|
22
22
|
amt_to_forward_msat: '1000',
|
|
23
|
-
chan_capacity: '1',
|
|
24
23
|
chan_id: '1',
|
|
25
24
|
custom_records: {'1': Buffer.alloc(1)},
|
|
26
25
|
expiry: 1,
|
|
@@ -62,7 +61,6 @@ const makeExpected = overrides => {
|
|
|
62
61
|
fee_mtokens: '1000',
|
|
63
62
|
hops: [{
|
|
64
63
|
channel: '0x0x1',
|
|
65
|
-
channel_capacity: 1,
|
|
66
64
|
fee: 1,
|
|
67
65
|
fee_mtokens: '1000',
|
|
68
66
|
forward: 1,
|
|
@@ -78,7 +76,6 @@ const makeExpected = overrides => {
|
|
|
78
76
|
fee_mtokens: '1000',
|
|
79
77
|
hops: [{
|
|
80
78
|
channel: '0x0x1',
|
|
81
|
-
channel_capacity: 1,
|
|
82
79
|
fee: 1,
|
|
83
80
|
fee_mtokens: '1000',
|
|
84
81
|
forward: 1,
|
|
@@ -11,7 +11,6 @@ const makeHtlc = overrides => {
|
|
|
11
11
|
route: {
|
|
12
12
|
hops: [{
|
|
13
13
|
amt_to_forward_msat: '1000',
|
|
14
|
-
chan_capacity: '1',
|
|
15
14
|
chan_id: '1',
|
|
16
15
|
custom_records: {
|
|
17
16
|
'1': Buffer.alloc(1),
|
|
@@ -41,7 +40,6 @@ const makeRoute = () => {
|
|
|
41
40
|
return {
|
|
42
41
|
hops: [{
|
|
43
42
|
amt_to_forward_msat: '1000',
|
|
44
|
-
chan_capacity: 1,
|
|
45
43
|
chan_id: '1',
|
|
46
44
|
custom_records: {
|
|
47
45
|
'1': Buffer.alloc(1),
|
|
@@ -78,7 +76,6 @@ const makeExpected = overrides => {
|
|
|
78
76
|
fee_mtokens: '1000',
|
|
79
77
|
hops: [{
|
|
80
78
|
channel: '0x0x1',
|
|
81
|
-
channel_capacity: 1,
|
|
82
79
|
fee: 1,
|
|
83
80
|
fee_mtokens: '1000',
|
|
84
81
|
forward: 1,
|
|
@@ -91,7 +88,6 @@ const makeExpected = overrides => {
|
|
|
91
88
|
fee_mtokens: '1000',
|
|
92
89
|
hops: [{
|
|
93
90
|
channel: '0x0x1',
|
|
94
|
-
channel_capacity: 1,
|
|
95
91
|
fee: 1,
|
|
96
92
|
fee_mtokens: '1000',
|
|
97
93
|
forward: 1,
|
|
@@ -20,7 +20,6 @@ const makeArgs = overrides => {
|
|
|
20
20
|
hops: [{
|
|
21
21
|
amt_to_forward: '1',
|
|
22
22
|
amt_to_forward_msat: '1000',
|
|
23
|
-
chan_capacity: '1',
|
|
24
23
|
chan_id: '1',
|
|
25
24
|
custom_records: {'1': Buffer.alloc(1)},
|
|
26
25
|
expiry: 1,
|
|
@@ -65,7 +64,6 @@ const makeExpected = overrides => {
|
|
|
65
64
|
fee_mtokens: '1000',
|
|
66
65
|
hops: [{
|
|
67
66
|
channel: '0x0x1',
|
|
68
|
-
channel_capacity: 1,
|
|
69
67
|
fee: 1,
|
|
70
68
|
fee_mtokens: '1000',
|
|
71
69
|
forward: 1,
|
|
@@ -56,7 +56,6 @@ const tests = [
|
|
|
56
56
|
fee_mtokens: '1000',
|
|
57
57
|
hops: [{
|
|
58
58
|
channel: '1352793x157x0',
|
|
59
|
-
channel_capacity: 16270430,
|
|
60
59
|
fee: 1,
|
|
61
60
|
fee_mtokens: '1000',
|
|
62
61
|
forward: 830497,
|
|
@@ -81,7 +80,6 @@ const tests = [
|
|
|
81
80
|
hops: [{
|
|
82
81
|
amt_to_forward: '830497',
|
|
83
82
|
amt_to_forward_msat: '830497000',
|
|
84
|
-
chan_capacity: '16270430',
|
|
85
83
|
chan_id: '1487411633484267520',
|
|
86
84
|
custom_records: [{
|
|
87
85
|
type: recordType,
|
|
@@ -33,7 +33,6 @@ const makeHtlc = overrides => {
|
|
|
33
33
|
amt_to_forward: '1',
|
|
34
34
|
amt_to_forward_msat: '1000',
|
|
35
35
|
chan_id: '1',
|
|
36
|
-
chan_capacity: 1,
|
|
37
36
|
expiry: 1,
|
|
38
37
|
fee: 0,
|
|
39
38
|
fee_msat: '0',
|
|
@@ -62,7 +61,6 @@ const makeExpected = overrides => {
|
|
|
62
61
|
hops: [
|
|
63
62
|
{
|
|
64
63
|
channel: '0x0x1',
|
|
65
|
-
channel_capacity: 1,
|
|
66
64
|
fee: 0,
|
|
67
65
|
fee_mtokens: '0',
|
|
68
66
|
forward: 1,
|
|
@@ -8,7 +8,6 @@ const route = {
|
|
|
8
8
|
hops: [{
|
|
9
9
|
amt_to_forward_msat: '1000',
|
|
10
10
|
chan_id: '1',
|
|
11
|
-
chan_capacity: 1,
|
|
12
11
|
expiry: 1,
|
|
13
12
|
fee_msat: '1000',
|
|
14
13
|
mpp_record: {payment_addr: Buffer.alloc(1), total_amt_msat: '1'},
|
|
@@ -46,7 +45,6 @@ const makeExpected = overrides => {
|
|
|
46
45
|
fee_mtokens: '1000',
|
|
47
46
|
hops: [{
|
|
48
47
|
channel: '0x0x1',
|
|
49
|
-
channel_capacity: 1,
|
|
50
48
|
fee: 1,
|
|
51
49
|
fee_mtokens: '1000',
|
|
52
50
|
forward: 1,
|
|
@@ -8,7 +8,6 @@ const makeArgs = overrides => {
|
|
|
8
8
|
const args = {
|
|
9
9
|
amt_to_forward_msat: '1000',
|
|
10
10
|
chan_id: '1',
|
|
11
|
-
chan_capacity: 1,
|
|
12
11
|
expiry: 1,
|
|
13
12
|
fee_msat: '1000',
|
|
14
13
|
mpp_record: {payment_addr: Buffer.alloc(1), total_amt_msat: '1'},
|
|
@@ -24,7 +23,6 @@ const makeArgs = overrides => {
|
|
|
24
23
|
const makeExpected = overrides => {
|
|
25
24
|
const expected = {
|
|
26
25
|
channel: '0x0x1',
|
|
27
|
-
channel_capacity: 1,
|
|
28
26
|
fee: 1,
|
|
29
27
|
fee_mtokens: '1000',
|
|
30
28
|
forward: 1,
|
|
@@ -54,11 +52,6 @@ const tests = [
|
|
|
54
52
|
description: 'Channel id is expected',
|
|
55
53
|
error: 'ExpectedNumericChannelIdInRpcHopDetails',
|
|
56
54
|
},
|
|
57
|
-
{
|
|
58
|
-
args: makeArgs({chan_capacity: undefined}),
|
|
59
|
-
description: 'Channel capacity is expected',
|
|
60
|
-
error: 'ExpectedChannelCapacityTokensNumberInRpcHopDetails',
|
|
61
|
-
},
|
|
62
55
|
{
|
|
63
56
|
args: makeArgs({fee_msat: undefined}),
|
|
64
57
|
description: 'Forwarding fee millitokens is expected',
|
|
@@ -39,7 +39,6 @@ const makeArgs = overrides => {
|
|
|
39
39
|
{
|
|
40
40
|
amt_to_forward_msat: '1000',
|
|
41
41
|
chan_id: '1',
|
|
42
|
-
chan_capacity: 1,
|
|
43
42
|
expiry: 1,
|
|
44
43
|
fee_msat: '1000',
|
|
45
44
|
mpp_record: {
|
|
@@ -52,7 +51,6 @@ const makeArgs = overrides => {
|
|
|
52
51
|
{
|
|
53
52
|
amt_to_forward_msat: '1000',
|
|
54
53
|
chan_id: '1',
|
|
55
|
-
chan_capacity: 1,
|
|
56
54
|
expiry: 1,
|
|
57
55
|
fee_msat: '1000',
|
|
58
56
|
mpp_record: {
|
|
@@ -101,7 +99,6 @@ const makeExpected = overrides => {
|
|
|
101
99
|
hops: [
|
|
102
100
|
{
|
|
103
101
|
channel: '0x0x1',
|
|
104
|
-
channel_capacity: 1,
|
|
105
102
|
fee: 1,
|
|
106
103
|
fee_mtokens: '1000',
|
|
107
104
|
forward: 1,
|
|
@@ -111,7 +108,6 @@ const makeExpected = overrides => {
|
|
|
111
108
|
},
|
|
112
109
|
{
|
|
113
110
|
channel: '0x0x1',
|
|
114
|
-
channel_capacity: 1,
|
|
115
111
|
fee: 1,
|
|
116
112
|
fee_mtokens: '1000',
|
|
117
113
|
forward: 1,
|
|
@@ -257,7 +253,6 @@ const tests = [
|
|
|
257
253
|
hops: [{
|
|
258
254
|
amt_to_forward: '100',
|
|
259
255
|
amt_to_forward_msat: '100000',
|
|
260
|
-
chan_capacity: '1000000',
|
|
261
256
|
chan_id: '487083651170304',
|
|
262
257
|
custom_records: {},
|
|
263
258
|
expiry: 491,
|
|
@@ -302,7 +297,6 @@ const tests = [
|
|
|
302
297
|
fee_mtokens: '0',
|
|
303
298
|
hops: [{
|
|
304
299
|
channel: '443x1x0',
|
|
305
|
-
channel_capacity: 1000000,
|
|
306
300
|
fee: 0,
|
|
307
301
|
fee_mtokens: '0',
|
|
308
302
|
forward: 100,
|
|
@@ -9,7 +9,6 @@ const makeRoute = override => {
|
|
|
9
9
|
hops: [{
|
|
10
10
|
amt_to_forward_msat: '1000',
|
|
11
11
|
chan_id: '1',
|
|
12
|
-
chan_capacity: 1,
|
|
13
12
|
expiry: 1,
|
|
14
13
|
fee_msat: '1000',
|
|
15
14
|
mpp_record: {payment_addr: Buffer.alloc(1), total_amt_msat: '1'},
|
|
@@ -69,7 +68,6 @@ const tests = [
|
|
|
69
68
|
hops: [{
|
|
70
69
|
amt_to_forward_msat: '1000',
|
|
71
70
|
chan_id: '1',
|
|
72
|
-
chan_capacity: 1,
|
|
73
71
|
expiry: 1,
|
|
74
72
|
fee_msat: '1000',
|
|
75
73
|
pub_key: 'a',
|
|
@@ -13,7 +13,6 @@ const args = {
|
|
|
13
13
|
hops: [
|
|
14
14
|
{
|
|
15
15
|
channel: '0x0x1',
|
|
16
|
-
channel_capacity: 1,
|
|
17
16
|
fee: 1,
|
|
18
17
|
fee_mtokens: '1000',
|
|
19
18
|
forward_mtokens: '1000',
|
|
@@ -30,7 +29,6 @@ const args = {
|
|
|
30
29
|
hops: [
|
|
31
30
|
{
|
|
32
31
|
channel: '0x0x1',
|
|
33
|
-
channel_capacity: 1,
|
|
34
32
|
fee: 1,
|
|
35
33
|
fee_mtokens: '1000',
|
|
36
34
|
forward_mtokens: '1000',
|