lightning 9.7.1 → 9.8.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 +4 -0
- package/grpc/protos/chainnotifier.proto +1 -1
- package/grpc/protos/invoices.proto +1 -1
- package/grpc/protos/lightning.proto +27 -12
- package/grpc/protos/walletkit.proto +3 -1
- package/grpc/protos/wtclient.proto +34 -3
- package/lnd_methods/info/constants.json +1 -0
- package/lnd_methods/offchain/get_pending_channels.d.ts +2 -0
- package/lnd_methods/offchain/get_pending_channels.js +3 -0
- package/lnd_responses/pending_as_pending_channels.js +4 -1
- package/package.json +11 -12
- package/test/arrays/test_sort_by.js +5 -3
- package/test/bolt00/test_mtokens_amount.js +5 -3
- package/test/bolt00/test_payment_amounts.js +4 -2
- package/test/bolt00/test_safe_tokens.js +5 -4
- package/test/bolt02/test_chain_id.js +3 -2
- package/test/grpc/test_emit_subscription_error.js +2 -3
- package/test/grpc/test_handle_remove_listener.js +2 -2
- package/test/lnd_gateway/test_bearer_token.js +5 -3
- package/test/lnd_gateway/test_decode_cbor_body.js +7 -4
- package/test/lnd_gateway/test_emit_event.js +6 -4
- package/test/lnd_gateway/test_emit_grpc_events.js +4 -4
- package/test/lnd_gateway/test_encode_response.js +5 -3
- package/test/lnd_gateway/test_gateway_request.js +6 -3
- package/test/lnd_gateway/test_gateway_subscribe.js +50 -45
- package/test/lnd_gateway/test_grpc_response.js +2 -2
- package/test/lnd_gateway/test_grpc_router.js +4 -3
- package/test/lnd_gateway/test_handle_errors.js +3 -2
- package/test/lnd_gateway/test_lnd_gateway.js +6 -3
- package/test/lnd_gateway/test_return_response.js +6 -3
- package/test/lnd_gateway/test_ws_url.js +3 -2
- package/test/lnd_grpc/test_authenticated_lnd_grpc.js +5 -3
- package/test/lnd_grpc/test_decode_serialized.js +3 -2
- package/test/lnd_grpc/test_grpc_credentials.js +4 -2
- package/test/lnd_grpc/test_grpc_ssl.js +3 -2
- package/test/lnd_grpc/test_is_lnd.js +3 -2
- package/test/lnd_grpc/test_unauthenticated_lnd_grpc.js +5 -3
- package/test/lnd_messages/test_close_channel_request.js +5 -3
- package/test/lnd_messages/test_open_channel_request.js +5 -3
- package/test/lnd_messages/test_pay_via_route_request.js +5 -3
- package/test/lnd_methods/address/test_create_chain_address.js +6 -4
- package/test/lnd_methods/address/test_get_public_key.js +5 -3
- package/test/lnd_methods/generic/test_get_height.js +6 -5
- package/test/lnd_methods/info/test_get_autopilot.js +3 -2
- package/test/lnd_methods/info/test_get_channel.js +6 -4
- package/test/lnd_methods/info/test_get_identity.js +6 -4
- package/test/lnd_methods/info/test_get_methods.js +6 -4
- package/test/lnd_methods/info/test_get_network_centrality.js +6 -4
- package/test/lnd_methods/info/test_get_network_graph.js +6 -4
- package/test/lnd_methods/info/test_get_network_info.js +6 -4
- package/test/lnd_methods/info/test_get_node.js +6 -4
- package/test/lnd_methods/info/test_get_route_to_destination.js +6 -4
- package/test/lnd_methods/info/test_get_tower_server_info.js +6 -4
- package/test/lnd_methods/info/test_get_wallet_info.js +6 -4
- package/test/lnd_methods/info/test_get_wallet_version.js +6 -4
- package/test/lnd_methods/info/test_stop_daemon.js +4 -3
- package/test/lnd_methods/info/test_subscribe_to_graph.js +7 -5
- package/test/lnd_methods/invoices/test_cancel_hodl_invoice.js +4 -3
- package/test/lnd_methods/invoices/test_create_hodl_invoice.js +10 -7
- package/test/lnd_methods/invoices/test_create_invoice.js +6 -4
- package/test/lnd_methods/invoices/test_get_invoice.js +4 -3
- package/test/lnd_methods/invoices/test_get_invoices.js +6 -4
- package/test/lnd_methods/invoices/test_settle_hodl_invoice.js +4 -3
- package/test/lnd_methods/invoices/test_subscribe_to_invoice.js +12 -9
- package/test/lnd_methods/invoices/test_subscribe_to_invoices.js +10 -8
- package/test/lnd_methods/macaroon/test_accept_rpc_request.js +4 -3
- package/test/lnd_methods/macaroon/test_get_access_ids.js +6 -4
- package/test/lnd_methods/macaroon/test_grant_access.js +6 -4
- package/test/lnd_methods/macaroon/test_handle_rpc_request_update.js +11 -8
- package/test/lnd_methods/macaroon/test_reject_rpc_request.js +4 -3
- package/test/lnd_methods/macaroon/test_revoke_access.js +4 -3
- package/test/lnd_methods/macaroon/test_subscribe_to_rpc_requests.js +8 -7
- package/test/lnd_methods/macaroon/test_uris_for_method.js +5 -3
- package/test/lnd_methods/macaroon/test_verify_access.js +6 -4
- package/test/lnd_methods/message/test_sign_message.js +6 -4
- package/test/lnd_methods/message/test_verify_message.js +6 -4
- package/test/lnd_methods/offchain/test_connect_watchtower.js +4 -3
- package/test/lnd_methods/offchain/test_decode_payment_request.js +6 -4
- package/test/lnd_methods/offchain/test_delete_failed_pay_attempts.js +4 -3
- package/test/lnd_methods/offchain/test_delete_failed_payments.js +4 -3
- package/test/lnd_methods/offchain/test_delete_forwarding_reputations.js +4 -3
- package/test/lnd_methods/offchain/test_delete_payment.js +4 -3
- package/test/lnd_methods/offchain/test_delete_payments.js +4 -3
- package/test/lnd_methods/offchain/test_delete_pending_channel.js +5 -3
- package/test/lnd_methods/offchain/test_disable_channel.js +4 -3
- package/test/lnd_methods/offchain/test_disconnect_watchtower.js +4 -3
- package/test/lnd_methods/offchain/test_enable_channel.js +4 -3
- package/test/lnd_methods/offchain/test_finished_payment.js +6 -4
- package/test/lnd_methods/offchain/test_get_backup.js +6 -4
- package/test/lnd_methods/offchain/test_get_backups.js +6 -4
- package/test/lnd_methods/offchain/test_get_channel_balance.js +7 -5
- package/test/lnd_methods/offchain/test_get_channels.js +23 -21
- package/test/lnd_methods/offchain/test_get_closed_channels.js +6 -4
- package/test/lnd_methods/offchain/test_get_connected_watchtowers.js +6 -4
- package/test/lnd_methods/offchain/test_get_ephemeral_channel_ids.js +6 -4
- package/test/lnd_methods/offchain/test_get_failed_payments.js +7 -5
- package/test/lnd_methods/offchain/test_get_fee_rates.js +6 -4
- package/test/lnd_methods/offchain/test_get_forwarding_confidence.js +6 -4
- package/test/lnd_methods/offchain/test_get_forwarding_reputations.js +6 -4
- package/test/lnd_methods/offchain/test_get_forwards.js +6 -4
- package/test/lnd_methods/offchain/test_get_pathfinding_settings.js +6 -4
- package/test/lnd_methods/offchain/test_get_payment.js +7 -6
- package/test/lnd_methods/offchain/test_get_payments.js +6 -4
- package/test/lnd_methods/offchain/test_get_pending_channels.js +6 -4
- package/test/lnd_methods/offchain/test_get_pending_payments.js +6 -4
- package/test/lnd_methods/offchain/test_get_route_through_hops.js +7 -5
- package/test/lnd_methods/offchain/test_get_settlement_status.js +6 -4
- package/test/lnd_methods/offchain/test_list_payments.js +6 -4
- package/test/lnd_methods/offchain/test_pay.js +20 -17
- package/test/lnd_methods/offchain/test_pay_via_payment_details.js +7 -6
- package/test/lnd_methods/offchain/test_pay_via_payment_request.js +7 -6
- package/test/lnd_methods/offchain/test_pay_via_routes.js +22 -18
- package/test/lnd_methods/offchain/test_recover_funds_from_channel.js +7 -5
- package/test/lnd_methods/offchain/test_recover_funds_from_channels.js +6 -4
- package/test/lnd_methods/offchain/test_route_failure_keys.js +4 -3
- package/test/lnd_methods/offchain/test_send_message_to_peer.js +4 -3
- package/test/lnd_methods/offchain/test_subscribe_to_backups.js +8 -7
- package/test/lnd_methods/offchain/test_subscribe_to_channels.js +8 -7
- package/test/lnd_methods/offchain/test_subscribe_to_forwards.js +7 -6
- package/test/lnd_methods/offchain/test_subscribe_to_open_requests.js +8 -7
- package/test/lnd_methods/offchain/test_subscribe_to_past_payment.js +3 -2
- package/test/lnd_methods/offchain/test_subscribe_to_past_payments.js +7 -6
- package/test/lnd_methods/offchain/test_subscribe_to_pay.js +3 -4
- package/test/lnd_methods/offchain/test_subscribe_to_pay_via_routes.js +11 -9
- package/test/lnd_methods/offchain/test_subscribe_to_payments.js +8 -7
- package/test/lnd_methods/offchain/test_subscribe_to_peer_messages.js +8 -7
- package/test/lnd_methods/offchain/test_subscribe_to_probe_for_route.js +9 -6
- package/test/lnd_methods/offchain/test_update_connected_watchtower.js +4 -3
- package/test/lnd_methods/offchain/test_update_pathfinding_settings.js +6 -4
- package/test/lnd_methods/offchain/test_update_routing_fees.js +4 -3
- package/test/lnd_methods/offchain/test_verify_backup.js +6 -4
- package/test/lnd_methods/offchain/test_verify_backups.js +6 -4
- package/test/lnd_methods/onchain/test_broadcast_chain_transaction.js +8 -5
- package/test/lnd_methods/onchain/test_cancel_pending_channel.js +5 -4
- package/test/lnd_methods/onchain/test_close_channel.js +7 -6
- package/test/lnd_methods/onchain/test_fund_pending_channels.js +4 -3
- package/test/lnd_methods/onchain/test_fund_psbt.js +6 -4
- package/test/lnd_methods/onchain/test_get_block.js +6 -4
- package/test/lnd_methods/onchain/test_get_chain_addresses.js +6 -4
- package/test/lnd_methods/onchain/test_get_chain_balance.js +7 -5
- package/test/lnd_methods/onchain/test_get_chain_fee_estimate.js +6 -4
- package/test/lnd_methods/onchain/test_get_chain_fee_rate.js +6 -4
- package/test/lnd_methods/onchain/test_get_chain_transactions.js +6 -4
- package/test/lnd_methods/onchain/test_get_locked_utxos.js +6 -4
- package/test/lnd_methods/onchain/test_get_master_public_keys.js +6 -4
- package/test/lnd_methods/onchain/test_get_pending_chain_balance.js +6 -4
- package/test/lnd_methods/onchain/test_get_sweep_transactions.js +7 -4
- package/test/lnd_methods/onchain/test_get_utxos.js +6 -4
- package/test/lnd_methods/onchain/test_lock_utxo.js +6 -4
- package/test/lnd_methods/onchain/test_open_channel.js +7 -6
- package/test/lnd_methods/onchain/test_open_channels.js +9 -8
- package/test/lnd_methods/onchain/test_partially_sign_psbt.js +7 -5
- package/test/lnd_methods/onchain/test_prepare_for_channel_proposal.js +6 -4
- package/test/lnd_methods/onchain/test_propose_channel.js +7 -6
- package/test/lnd_methods/onchain/test_request_chain_fee_increase.js +4 -3
- package/test/lnd_methods/onchain/test_script_from_chain_address.js +4 -3
- package/test/lnd_methods/onchain/test_send_to_chain_address.js +6 -4
- package/test/lnd_methods/onchain/test_send_to_chain_addresses.js +6 -4
- package/test/lnd_methods/onchain/test_send_to_chain_output_scripts.js +7 -4
- package/test/lnd_methods/onchain/test_set_autopilot.js +5 -4
- package/test/lnd_methods/onchain/test_sign_chain_address_message.js +6 -4
- package/test/lnd_methods/onchain/test_sign_psbt.js +6 -4
- package/test/lnd_methods/onchain/test_subscribe_to_blocks.js +9 -8
- package/test/lnd_methods/onchain/test_subscribe_to_chain_address.js +8 -6
- package/test/lnd_methods/onchain/test_subscribe_to_chain_spend.js +8 -6
- package/test/lnd_methods/onchain/test_subscribe_to_transactions.js +8 -7
- package/test/lnd_methods/onchain/test_unlock_utxo.js +4 -3
- package/test/lnd_methods/onchain/test_update_chain_transaction.js +4 -3
- package/test/lnd_methods/onchain/test_verify_chain_address_message.js +6 -4
- package/test/lnd_methods/peers/test_add_external_socket.js +4 -3
- package/test/lnd_methods/peers/test_add_peer.js +4 -3
- package/test/lnd_methods/peers/test_get_peers.js +6 -4
- package/test/lnd_methods/peers/test_remove_external_socket.js +4 -3
- package/test/lnd_methods/peers/test_remove_peer.js +6 -4
- package/test/lnd_methods/peers/test_subscribe_to_peers.js +9 -8
- package/test/lnd_methods/peers/test_update_alias.js +4 -3
- package/test/lnd_methods/peers/test_update_color.js +4 -3
- package/test/lnd_methods/signer/test_begin_group_signing_session.js +6 -4
- package/test/lnd_methods/signer/test_diffie_hellman_compute_secret.js +6 -4
- package/test/lnd_methods/signer/test_end_group_signing_session.js +6 -4
- package/test/lnd_methods/signer/test_input_signing_method.js +4 -3
- package/test/lnd_methods/signer/test_sign_bytes.js +6 -4
- package/test/lnd_methods/signer/test_sign_transaction.js +6 -4
- package/test/lnd_methods/signer/test_update_group_signing_session.js +7 -5
- package/test/lnd_methods/signer/test_verify_bytes_signature.js +6 -4
- package/test/lnd_methods/unauthenticated/test_change_password.js +4 -3
- package/test/lnd_methods/unauthenticated/test_create_seed.js +6 -4
- package/test/lnd_methods/unauthenticated/test_create_wallet.js +4 -3
- package/test/lnd_methods/unauthenticated/test_get_wallet_status.js +6 -4
- package/test/lnd_methods/unauthenticated/test_subscribe_to_wallet_status.js +7 -6
- package/test/lnd_methods/unauthenticated/test_unlock_wallet.js +4 -3
- package/test/lnd_requests/test_destination_custom_records.js +4 -3
- package/test/lnd_requests/test_ignore_as_ignored_nodes.js +7 -4
- package/test/lnd_requests/test_ignore_as_ignored_pairs.js +7 -4
- package/test/lnd_requests/test_route_hint_from_route.js +5 -3
- package/test/lnd_requests/test_rpc_hop_from_hop.js +5 -3
- package/test/lnd_requests/test_rpc_route_from_route.js +5 -3
- package/test/lnd_responses/test_backups_from_snapshot.js +5 -3
- package/test/lnd_responses/test_channel_accept_as_open_request.js +5 -3
- package/test/lnd_responses/test_channel_edge_as_channel.js +5 -3
- package/test/lnd_responses/test_channel_policy_as_policy.js +5 -3
- package/test/lnd_responses/test_confirmed_from_payment.js +5 -3
- package/test/lnd_responses/test_confirmed_from_payment_status.js +5 -3
- package/test/lnd_responses/test_failure_from_payment.js +5 -3
- package/test/lnd_responses/test_forward_from_htlc_event.js +5 -3
- package/test/lnd_responses/test_htlc_as_payment.js +5 -3
- package/test/lnd_responses/test_info_as_wallet_info.js +5 -3
- package/test/lnd_responses/test_node_info_as_node.js +5 -3
- package/test/lnd_responses/test_payment_failure.js +5 -3
- package/test/lnd_responses/test_payment_request_details.js +5 -3
- package/test/lnd_responses/test_pending_as_pending_channels.js +6 -3
- package/test/lnd_responses/test_pending_from_payment.js +5 -3
- package/test/lnd_responses/test_policy_from_channel_update.js +5 -3
- package/test/lnd_responses/test_route_from_route_hint.js +5 -3
- package/test/lnd_responses/test_routes_from_query_routes.js +6 -5
- package/test/lnd_responses/test_routing_failure_from_htlc.js +5 -3
- package/test/lnd_responses/test_rpc_addresses_as_addresses.js +5 -3
- package/test/lnd_responses/test_rpc_attempt_htlc_as_attempt.js +5 -3
- package/test/lnd_responses/test_rpc_channel_as_channel.js +5 -3
- package/test/lnd_responses/test_rpc_channel_closed_as_closed.js +6 -4
- package/test/lnd_responses/test_rpc_channel_update_as_update.js +6 -4
- package/test/lnd_responses/test_rpc_closed_channel_as_closed.js +5 -3
- package/test/lnd_responses/test_rpc_conf_as_confirmation.js +5 -3
- package/test/lnd_responses/test_rpc_failed_policy_as_fail.js +5 -3
- package/test/lnd_responses/test_rpc_fees_as_channel_fees.js +5 -3
- package/test/lnd_responses/test_rpc_forward_as_forward.js +5 -3
- package/test/lnd_responses/test_rpc_forward_as_forward_request.js +5 -3
- package/test/lnd_responses/test_rpc_group_session_as_session.js +5 -3
- package/test/lnd_responses/test_rpc_hop_as_hop.js +5 -3
- package/test/lnd_responses/test_rpc_htlc_as_payment.js +5 -3
- package/test/lnd_responses/test_rpc_invoice_as_invoice.js +5 -3
- package/test/lnd_responses/test_rpc_network_as_network_info.js +5 -3
- package/test/lnd_responses/test_rpc_node_as_node.js +5 -3
- package/test/lnd_responses/test_rpc_outpoint_as_update.js +5 -3
- package/test/lnd_responses/test_rpc_payment_as_payment.js +5 -3
- package/test/lnd_responses/test_rpc_peer_as_peer.js +5 -3
- package/test/lnd_responses/test_rpc_peer_message_as_message.js +5 -3
- package/test/lnd_responses/test_rpc_request_update_as_event.js +5 -3
- package/test/lnd_responses/test_rpc_resolution_as_resolution.js +5 -3
- package/test/lnd_responses/test_rpc_route_as_route.js +11 -9
- package/test/lnd_responses/test_rpc_tx_as_transaction.js +5 -3
- package/test/lnd_responses/test_rpc_utxo_as_utxo.js +5 -3
- package/test/lnd_responses/test_rpc_wallet_state_as_state.js +6 -4
- package/test/protos/protos.json +0 -22
- package/test/protos/test_protos_synced.js +0 -46
package/CHANGELOG.md
CHANGED
|
@@ -84,7 +84,7 @@ message AddHoldInvoiceRequest {
|
|
|
84
84
|
*/
|
|
85
85
|
bytes description_hash = 4;
|
|
86
86
|
|
|
87
|
-
// Payment request expiry time in seconds. Default is
|
|
87
|
+
// Payment request expiry time in seconds. Default is 86400 (24 hours).
|
|
88
88
|
int64 expiry = 5;
|
|
89
89
|
|
|
90
90
|
// Fallback on-chain address.
|
|
@@ -101,8 +101,10 @@ service Lightning {
|
|
|
101
101
|
rpc SignMessage (SignMessageRequest) returns (SignMessageResponse);
|
|
102
102
|
|
|
103
103
|
/* lncli: `verifymessage`
|
|
104
|
-
VerifyMessage verifies a signature over a
|
|
105
|
-
|
|
104
|
+
VerifyMessage verifies a signature over a message and recovers the signer's
|
|
105
|
+
public key. The signature is only deemed valid if the recovered public key
|
|
106
|
+
corresponds to a node key in the public Lightning network. The signature
|
|
107
|
+
must be zbase32 encoded and signed by an active node in the resident node's
|
|
106
108
|
channel database. In addition to returning the validity of the signature,
|
|
107
109
|
VerifyMessage also returns the recovered pubkey from the signature.
|
|
108
110
|
*/
|
|
@@ -598,8 +600,10 @@ message LookupHtlcResolutionRequest {
|
|
|
598
600
|
}
|
|
599
601
|
|
|
600
602
|
message LookupHtlcResolutionResponse {
|
|
603
|
+
// Settled is true is the htlc was settled. If false, the htlc was failed.
|
|
601
604
|
bool settled = 1;
|
|
602
605
|
|
|
606
|
+
// Offchain indicates whether the htlc was resolved off-chain or on-chain.
|
|
603
607
|
bool offchain = 2;
|
|
604
608
|
}
|
|
605
609
|
|
|
@@ -2586,6 +2590,17 @@ message PendingChannelsResponse {
|
|
|
2586
2590
|
|
|
2587
2591
|
// Previously used for confirmation_height. Do not reuse.
|
|
2588
2592
|
reserved 2;
|
|
2593
|
+
|
|
2594
|
+
// The number of blocks until the funding transaction is considered
|
|
2595
|
+
// expired. If this value gets close to zero, there is a risk that the
|
|
2596
|
+
// channel funding will be canceled by the channel responder. The
|
|
2597
|
+
// channel should be fee bumped using CPFP (see walletrpc.BumpFee) to
|
|
2598
|
+
// ensure that the channel confirms in time. Otherwise a force-close
|
|
2599
|
+
// will be necessary if the channel confirms after the funding
|
|
2600
|
+
// transaction expires. A negative value means the channel responder has
|
|
2601
|
+
// very likely canceled the funding and the channel will never become
|
|
2602
|
+
// fully operational.
|
|
2603
|
+
int32 funding_expiry_blocks = 3;
|
|
2589
2604
|
}
|
|
2590
2605
|
|
|
2591
2606
|
message WaitingCloseChannel {
|
|
@@ -3485,22 +3500,22 @@ message Invoice {
|
|
|
3485
3500
|
|
|
3486
3501
|
/*
|
|
3487
3502
|
The amount that was accepted for this invoice, in satoshis. This will ONLY
|
|
3488
|
-
be set if this invoice has been settled. We provide this field
|
|
3489
|
-
invoice was created with a zero value, then we need to record what
|
|
3490
|
-
was ultimately accepted. Additionally, it's possible that the sender
|
|
3491
|
-
MORE that was specified in the original invoice. So we'll record that
|
|
3492
|
-
as well.
|
|
3503
|
+
be set if this invoice has been settled or accepted. We provide this field
|
|
3504
|
+
as if the invoice was created with a zero value, then we need to record what
|
|
3505
|
+
amount was ultimately accepted. Additionally, it's possible that the sender
|
|
3506
|
+
paid MORE that was specified in the original invoice. So we'll record that
|
|
3507
|
+
here as well.
|
|
3493
3508
|
Note: Output only, don't specify for creating an invoice.
|
|
3494
3509
|
*/
|
|
3495
3510
|
int64 amt_paid_sat = 19;
|
|
3496
3511
|
|
|
3497
3512
|
/*
|
|
3498
3513
|
The amount that was accepted for this invoice, in millisatoshis. This will
|
|
3499
|
-
ONLY be set if this invoice has been settled. We provide this
|
|
3500
|
-
the invoice was created with a zero value, then we need to
|
|
3501
|
-
amount was ultimately accepted. Additionally, it's possible that
|
|
3502
|
-
paid MORE that was specified in the original invoice. So we'll
|
|
3503
|
-
here as well.
|
|
3514
|
+
ONLY be set if this invoice has been settled or accepted. We provide this
|
|
3515
|
+
field as if the invoice was created with a zero value, then we need to
|
|
3516
|
+
record what amount was ultimately accepted. Additionally, it's possible that
|
|
3517
|
+
the sender paid MORE that was specified in the original invoice. So we'll
|
|
3518
|
+
record that here as well.
|
|
3504
3519
|
Note: Output only, don't specify for creating an invoice.
|
|
3505
3520
|
*/
|
|
3506
3521
|
int64 amt_paid_msat = 20;
|
|
@@ -712,7 +712,9 @@ message ImportTapscriptResponse {
|
|
|
712
712
|
|
|
713
713
|
message Transaction {
|
|
714
714
|
/*
|
|
715
|
-
The raw serialized transaction.
|
|
715
|
+
The raw serialized transaction. Despite the field name, this does need to be
|
|
716
|
+
specified in raw bytes (or base64 encoded when using REST) and not in hex.
|
|
717
|
+
To not break existing software, the field can't simply be renamed.
|
|
716
718
|
*/
|
|
717
719
|
bytes tx_hex = 1;
|
|
718
720
|
|
|
@@ -68,6 +68,10 @@ message GetTowerInfoRequest {
|
|
|
68
68
|
|
|
69
69
|
// Whether we should include sessions with the watchtower in the response.
|
|
70
70
|
bool include_sessions = 2;
|
|
71
|
+
|
|
72
|
+
// Whether to exclude exhausted sessions in the response info. This option
|
|
73
|
+
// is only meaningful if include_sessions is true.
|
|
74
|
+
bool exclude_exhausted_sessions = 3;
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
message TowerSession {
|
|
@@ -107,19 +111,46 @@ message Tower {
|
|
|
107
111
|
// The list of addresses the watchtower is reachable over.
|
|
108
112
|
repeated string addresses = 2;
|
|
109
113
|
|
|
114
|
+
// Deprecated, use the active_session_candidate field under the
|
|
115
|
+
// correct identifier in the client_type map.
|
|
110
116
|
// Whether the watchtower is currently a candidate for new sessions.
|
|
111
|
-
bool active_session_candidate = 3;
|
|
117
|
+
bool active_session_candidate = 3 [deprecated = true];
|
|
112
118
|
|
|
119
|
+
// Deprecated, use the num_sessions field under the correct identifier
|
|
120
|
+
// in the client_type map.
|
|
113
121
|
// The number of sessions that have been negotiated with the watchtower.
|
|
114
|
-
uint32 num_sessions = 4;
|
|
122
|
+
uint32 num_sessions = 4 [deprecated = true];
|
|
115
123
|
|
|
124
|
+
// Deprecated, use the sessions field under the correct identifier in the
|
|
125
|
+
// client_type map.
|
|
116
126
|
// The list of sessions that have been negotiated with the watchtower.
|
|
117
|
-
repeated TowerSession sessions = 5;
|
|
127
|
+
repeated TowerSession sessions = 5 [deprecated = true];
|
|
128
|
+
|
|
129
|
+
// A list sessions held with the tower.
|
|
130
|
+
repeated TowerSessionInfo session_info = 6;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
message TowerSessionInfo {
|
|
134
|
+
// Whether the watchtower is currently a candidate for new sessions.
|
|
135
|
+
bool active_session_candidate = 1;
|
|
136
|
+
|
|
137
|
+
// The number of sessions that have been negotiated with the watchtower.
|
|
138
|
+
uint32 num_sessions = 2;
|
|
139
|
+
|
|
140
|
+
// The list of sessions that have been negotiated with the watchtower.
|
|
141
|
+
repeated TowerSession sessions = 3;
|
|
142
|
+
|
|
143
|
+
// The session's policy type.
|
|
144
|
+
PolicyType policy_type = 4;
|
|
118
145
|
}
|
|
119
146
|
|
|
120
147
|
message ListTowersRequest {
|
|
121
148
|
// Whether we should include sessions with the watchtower in the response.
|
|
122
149
|
bool include_sessions = 1;
|
|
150
|
+
|
|
151
|
+
// Whether to exclude exhausted sessions in the response info. This option
|
|
152
|
+
// is only meaningful if include_sessions is true.
|
|
153
|
+
bool exclude_exhausted_sessions = 2;
|
|
123
154
|
}
|
|
124
155
|
|
|
125
156
|
message ListTowersResponse {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"5c36d96c9cbe8b27c29f9682dcbdab7928ae870f": "0.15.0-beta",
|
|
32
32
|
"6042004edaaa5b3cad0a0808ff23dba4716f7178": "0.14.1-beta",
|
|
33
33
|
"61c34683058f2cc8dc10f49392a0057440d831c4": "0.13.4-beta",
|
|
34
|
+
"6bd30047c1b1188029e8af6ee8a135cf86e7dc4b": "0.16.4-beta",
|
|
34
35
|
"725ff104808f49f0a5247bfdb4b6b5da7f488d38": "0.13.0-beta",
|
|
35
36
|
"7f34774529fa0964d47fc418d4d2965435cbfdc0": "0.11.1-beta",
|
|
36
37
|
"86d3dec7b939b21bb10f2cd1ff56970c392a1c69": "0.13.2-beta",
|
|
@@ -3,6 +3,8 @@ import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
|
3
3
|
|
|
4
4
|
export type GetPendingChannelsResult = {
|
|
5
5
|
pending_channels: {
|
|
6
|
+
/** Blocks Until Funding Expires */
|
|
7
|
+
blocks_until_expiry?: number;
|
|
6
8
|
/** Channel Capacity Tokens */
|
|
7
9
|
capacity: number;
|
|
8
10
|
/** Channel Closing Transaction Id */
|
|
@@ -21,6 +21,8 @@ const type = 'default';
|
|
|
21
21
|
|
|
22
22
|
`description` is not supported in LND 0.16.4 or before
|
|
23
23
|
|
|
24
|
+
`blocks_until_expiry` is not supported in LND 0.16.4 or before
|
|
25
|
+
|
|
24
26
|
{
|
|
25
27
|
lnd: <Authenticated LND API Object>
|
|
26
28
|
}
|
|
@@ -28,6 +30,7 @@ const type = 'default';
|
|
|
28
30
|
@returns via cbk or Promise
|
|
29
31
|
{
|
|
30
32
|
pending_channels: [{
|
|
33
|
+
[blocks_until_expiry]: <Blocks Until Open Channel Expires Number>
|
|
31
34
|
capacity: <Channel Capacity Tokens Number>
|
|
32
35
|
[close_transaction_id]: <Channel Closing Transaction Id String>
|
|
33
36
|
[description]: <Channel Description String>
|
|
@@ -48,10 +48,10 @@ const outpointSeparator = ':';
|
|
|
48
48
|
remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
|
|
49
49
|
remote_node_pub: <Remote Node Public Key Hex String>
|
|
50
50
|
}
|
|
51
|
-
confirmation_height: <Future Confirmation Height Number>
|
|
52
51
|
commit_fee: <Commitment Transaction Fee Tokens String>
|
|
53
52
|
commit_weight: <Commitment Transaction Weight Units String>
|
|
54
53
|
fee_per_kw: <Fee Tokens Per Thousand Weight Units String>
|
|
54
|
+
funding_expiry_blocks: <Blocks Until Open Expired Number>
|
|
55
55
|
}]
|
|
56
56
|
waiting_close_channels: [{
|
|
57
57
|
channel: {
|
|
@@ -84,6 +84,7 @@ const outpointSeparator = ':';
|
|
|
84
84
|
@returns
|
|
85
85
|
{
|
|
86
86
|
pending_channels: [{
|
|
87
|
+
[blocks_until_expiry]: <Blocks Until Open Channel Expires Number>
|
|
87
88
|
capacity: <Channel Capacity Tokens Number>
|
|
88
89
|
[close_transaction_id]: <Channel Closing Transaction Id String>
|
|
89
90
|
[description]: <Channel Description String>
|
|
@@ -243,6 +244,7 @@ module.exports = args => {
|
|
|
243
244
|
}
|
|
244
245
|
|
|
245
246
|
sum[pending.channel.channel_point] = {
|
|
247
|
+
funding_expiry: Number(pending.funding_expiry_blocks) || undefined,
|
|
246
248
|
transaction_fee: Number(pending.commit_fee),
|
|
247
249
|
transaction_weight: Number(pending.commit_weight),
|
|
248
250
|
};
|
|
@@ -293,6 +295,7 @@ module.exports = args => {
|
|
|
293
295
|
const pendingTokens = wait.pending_balance || forced.pending_balance;
|
|
294
296
|
|
|
295
297
|
return {
|
|
298
|
+
blocks_until_expiry: !!chanOpen ? chanOpen.funding_expiry : undefined,
|
|
296
299
|
capacity: Number(channel.capacity),
|
|
297
300
|
close_transaction_id: endTx || undefined,
|
|
298
301
|
description: channel.memo || undefined,
|
package/package.json
CHANGED
|
@@ -7,33 +7,32 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.8.
|
|
10
|
+
"@grpc/grpc-js": "1.8.17",
|
|
11
11
|
"@grpc/proto-loader": "0.7.7",
|
|
12
12
|
"@types/express": "4.17.17",
|
|
13
|
-
"@types/node": "20.
|
|
13
|
+
"@types/node": "20.4.1",
|
|
14
14
|
"@types/request": "2.48.8",
|
|
15
15
|
"@types/ws": "8.5.5",
|
|
16
16
|
"async": "3.2.4",
|
|
17
|
-
"asyncjs-util": "1.2.
|
|
17
|
+
"asyncjs-util": "1.2.12",
|
|
18
18
|
"bitcoinjs-lib": "6.1.3",
|
|
19
19
|
"bn.js": "5.2.1",
|
|
20
20
|
"body-parser": "1.20.2",
|
|
21
|
-
"bolt07": "1.8.
|
|
22
|
-
"bolt09": "0.
|
|
21
|
+
"bolt07": "1.8.4",
|
|
22
|
+
"bolt09": "1.0.0",
|
|
23
23
|
"cbor": "9.0.0",
|
|
24
24
|
"ecpair": "2.1.0",
|
|
25
25
|
"express": "4.18.2",
|
|
26
|
-
"invoices": "
|
|
27
|
-
"psbt": "
|
|
28
|
-
"tiny-secp256k1": "2.2.
|
|
26
|
+
"invoices": "3.0.0",
|
|
27
|
+
"psbt": "3.0.0",
|
|
28
|
+
"tiny-secp256k1": "2.2.3",
|
|
29
29
|
"type-fest": "3.12.0"
|
|
30
30
|
},
|
|
31
31
|
"description": "Lightning Network client library",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
34
|
-
"@alexbosworth/tap": "15.0.12",
|
|
35
34
|
"tsd": "0.28.1",
|
|
36
|
-
"typescript": "5.1.
|
|
35
|
+
"typescript": "5.1.6",
|
|
37
36
|
"ws": "8.13.0"
|
|
38
37
|
},
|
|
39
38
|
"engines": {
|
|
@@ -52,12 +51,12 @@
|
|
|
52
51
|
"url": "https://github.com/alexbosworth/lightning.git"
|
|
53
52
|
},
|
|
54
53
|
"scripts": {
|
|
55
|
-
"test": "
|
|
54
|
+
"test": "npx nyc@15.1.0 node --experimental-test-coverage --test && npm run test:types",
|
|
56
55
|
"test:types": "tsd"
|
|
57
56
|
},
|
|
58
57
|
"tsd": {
|
|
59
58
|
"directory": "test/typescript"
|
|
60
59
|
},
|
|
61
60
|
"types": "index.d.ts",
|
|
62
|
-
"version": "9.
|
|
61
|
+
"version": "9.8.1"
|
|
63
62
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const {throws} = require('node:assert').strict;
|
|
2
4
|
|
|
3
5
|
const {sortBy} = require('./../../arrays');
|
|
4
6
|
|
|
@@ -31,13 +33,13 @@ const tests = [
|
|
|
31
33
|
];
|
|
32
34
|
|
|
33
35
|
tests.forEach(({args, description, error, expected}) => {
|
|
34
|
-
return test(description, (
|
|
36
|
+
return test(description, (t, end) => {
|
|
35
37
|
if (!!error) {
|
|
36
38
|
throws(() => sortBy(args), new Error(error), 'Got expected error');
|
|
37
39
|
} else {
|
|
38
40
|
const {sorted} = sortBy(args);
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
deepEqual(sorted, expected.sorted, 'Array is sorted as expected');
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
return end();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const {throws} = require('node:assert').strict;
|
|
2
4
|
|
|
3
5
|
const {mtokensAmount} = require('./../../bolt00');
|
|
4
6
|
|
|
@@ -41,13 +43,13 @@ const tests = [
|
|
|
41
43
|
];
|
|
42
44
|
|
|
43
45
|
tests.forEach(({args, description, error, expected}) => {
|
|
44
|
-
return test(description, (
|
|
46
|
+
return test(description, (t, end) => {
|
|
45
47
|
if (!!error) {
|
|
46
48
|
throws(() => mtokensAmount(args), new Error(error), 'Got expected err');
|
|
47
49
|
} else {
|
|
48
50
|
const {mtokens} = mtokensAmount(args);
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
deepEqual(mtokens, expected.mtokens, 'Got expected output');
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
return end();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {equal} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const {throws} = require('node:assert').strict;
|
|
2
4
|
|
|
3
5
|
const {paymentAmounts} = require('./../../bolt00');
|
|
4
6
|
|
|
@@ -66,7 +68,7 @@ const tests = [
|
|
|
66
68
|
];
|
|
67
69
|
|
|
68
70
|
tests.forEach(({args, description, error, expected}) => {
|
|
69
|
-
return test(description, (
|
|
71
|
+
return test(description, (t, end) => {
|
|
70
72
|
if (!!error) {
|
|
71
73
|
throws(() => paymentAmounts(args), new Error(error), 'Got expected err');
|
|
72
74
|
} else {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
2
3
|
|
|
3
4
|
const {safeTokens} = require('./../../bolt00');
|
|
4
5
|
|
|
@@ -26,11 +27,11 @@ const tests = [
|
|
|
26
27
|
];
|
|
27
28
|
|
|
28
29
|
tests.forEach(({args, description, expected}) => {
|
|
29
|
-
return test(description, (
|
|
30
|
+
return test(description, (t, end) => {
|
|
30
31
|
const {safe, tokens} = safeTokens(args);
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
deepEqual(safe, expected.safe, 'Got expected safe tokens');
|
|
34
|
+
deepEqual(tokens, expected.tokens, 'Got expected tokens');
|
|
34
35
|
|
|
35
36
|
return end();
|
|
36
37
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {equal} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
2
3
|
|
|
3
4
|
const {chainId} = require('./../../bolt02');
|
|
4
5
|
|
|
@@ -14,7 +15,7 @@ const tests = [
|
|
|
14
15
|
];
|
|
15
16
|
|
|
16
17
|
tests.forEach(({args, description, expected}) => {
|
|
17
|
-
return test(description, (
|
|
18
|
+
return test(description, (t, end) => {
|
|
18
19
|
const {chain} = chainId(args);
|
|
19
20
|
|
|
20
21
|
equal(chain, expected, 'Chain id derived from chain and network');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const test = require('node:test');
|
|
2
2
|
|
|
3
3
|
const {emitSubscriptionError} = require('./../../grpc');
|
|
4
4
|
|
|
@@ -54,7 +54,6 @@ const tests = [
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
throw new Error('ExpectedNoErrorEmitted');
|
|
57
|
-
|
|
58
57
|
},
|
|
59
58
|
listenerCount: () => Number(),
|
|
60
59
|
},
|
|
@@ -68,7 +67,7 @@ const tests = [
|
|
|
68
67
|
];
|
|
69
68
|
|
|
70
69
|
tests.forEach(({args, description, expected}) => {
|
|
71
|
-
return test(description, (
|
|
70
|
+
return test(description, (t, end) => {
|
|
72
71
|
const emitErr = emitSubscriptionError(args);
|
|
73
72
|
|
|
74
73
|
emitErr('error');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const test = require('node:test');
|
|
2
2
|
|
|
3
3
|
const {handleRemoveListener} = require('./../../grpc');
|
|
4
4
|
|
|
@@ -26,7 +26,7 @@ const tests = [
|
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
tests.forEach(({args, description, expected}) => {
|
|
29
|
-
return test(description, (
|
|
29
|
+
return test(description, (t, end) => {
|
|
30
30
|
handleRemoveListener(args);
|
|
31
31
|
|
|
32
32
|
return end();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const {throws} = require('node:assert').strict;
|
|
2
4
|
|
|
3
5
|
const bearerToken = require('./../../lnd_gateway/bearer_token');
|
|
4
6
|
|
|
@@ -16,12 +18,12 @@ const tests = [
|
|
|
16
18
|
];
|
|
17
19
|
|
|
18
20
|
tests.forEach(({args, description, expected}) => {
|
|
19
|
-
return test(description, (
|
|
21
|
+
return test(description, (t, end) => {
|
|
20
22
|
const {middleware} = bearerToken({});
|
|
21
23
|
const res = {locals: {}};
|
|
22
24
|
|
|
23
25
|
return middleware({get: key => args.header}, res, () => {
|
|
24
|
-
|
|
26
|
+
deepStrictEqual(res.locals, expected.locals, 'Got expected locals');
|
|
25
27
|
|
|
26
28
|
return end();
|
|
27
29
|
});
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const {throws} = require('node:assert').strict;
|
|
4
|
+
|
|
1
5
|
const {encode} = require('cbor');
|
|
2
|
-
const {test} = require('@alexbosworth/tap');
|
|
3
6
|
|
|
4
7
|
const decodeCborBody = require('./../../lnd_gateway/decode_cbor_body');
|
|
5
8
|
|
|
@@ -17,15 +20,15 @@ const tests = [
|
|
|
17
20
|
];
|
|
18
21
|
|
|
19
22
|
tests.forEach(({args, description, error, expected}) => {
|
|
20
|
-
return test(description, (
|
|
23
|
+
return test(description, (t, end) => {
|
|
21
24
|
const {middleware} = decodeCborBody({});
|
|
22
25
|
const req = {body: args.body};
|
|
23
26
|
|
|
24
27
|
return middleware(req, null, err => {
|
|
25
28
|
if (!!error) {
|
|
26
|
-
|
|
29
|
+
deepStrictEqual(err, error, 'Got expected error');
|
|
27
30
|
} else {
|
|
28
|
-
|
|
31
|
+
deepStrictEqual(req.body, expected.body, 'Got expected body');
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
return end();
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const EventEmitter = require('events');
|
|
2
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
3
|
const {once} = require('events');
|
|
4
|
+
const {rejects} = require('node:assert').strict;
|
|
5
|
+
const test = require('node:test');
|
|
3
6
|
|
|
4
7
|
const {encode} = require('cbor');
|
|
5
|
-
const {test} = require('@alexbosworth/tap');
|
|
6
8
|
|
|
7
9
|
const emitEvent = require('./../../lnd_gateway/emit_event');
|
|
8
10
|
|
|
@@ -22,7 +24,7 @@ const tests = [
|
|
|
22
24
|
];
|
|
23
25
|
|
|
24
26
|
tests.forEach(({args, description, error, expected}) => {
|
|
25
|
-
return test(description, async (
|
|
27
|
+
return test(description, async () => {
|
|
26
28
|
const emitter = new EventEmitter();
|
|
27
29
|
const message = args.message;
|
|
28
30
|
|
|
@@ -41,9 +43,9 @@ tests.forEach(({args, description, error, expected}) => {
|
|
|
41
43
|
} else {
|
|
42
44
|
const [, [emitted]] = await all([emit, once(emitter, expected.event)]);
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
deepStrictEqual(emitted, expected.emitted, 'Got expected emitted data');
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
return
|
|
49
|
+
return;
|
|
48
50
|
});
|
|
49
51
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
const {equal} = require('node:assert').strict;
|
|
1
2
|
const EventEmitter = require('events');
|
|
2
|
-
|
|
3
|
-
const {test} = require('@alexbosworth/tap');
|
|
3
|
+
const test = require('node:test');
|
|
4
4
|
|
|
5
5
|
const {emitGrpcEvents} = require('./../../');
|
|
6
6
|
|
|
7
7
|
const tests = [
|
|
8
8
|
{
|
|
9
9
|
args: {message: Buffer.alloc(3)},
|
|
10
|
-
description: '
|
|
10
|
+
description: 'Event is emitted',
|
|
11
11
|
expected: {
|
|
12
12
|
message: 'a26464617461a16764657461696c73781a457870656374656456616c696443626f7257734d657373616765656576656e74656572726f72',
|
|
13
13
|
},
|
|
@@ -15,7 +15,7 @@ const tests = [
|
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
tests.forEach(({args, description, expected}) => {
|
|
18
|
-
return test(description, (
|
|
18
|
+
return test(description, (t, end) => {
|
|
19
19
|
const ws = new EventEmitter();
|
|
20
20
|
|
|
21
21
|
ws.send = message => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {equal} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const encodeResponse = require('./../../lnd_gateway/encode_response');
|
|
4
6
|
|
|
@@ -21,7 +23,7 @@ const tests = [
|
|
|
21
23
|
];
|
|
22
24
|
|
|
23
25
|
tests.forEach(({args, description, error, expected}) => {
|
|
24
|
-
return test(description, async (
|
|
26
|
+
return test(description, async () => {
|
|
25
27
|
if (!!error) {
|
|
26
28
|
await rejects(encodeResponse(args), error, 'Got expected error');
|
|
27
29
|
} else {
|
|
@@ -30,6 +32,6 @@ tests.forEach(({args, description, error, expected}) => {
|
|
|
30
32
|
equal(response.toString('hex'), expected.response, 'Encoded response');
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
return
|
|
35
|
+
return;
|
|
34
36
|
});
|
|
35
37
|
});
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
const {equal} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
4
|
+
|
|
1
5
|
const {encode} = require('cbor');
|
|
2
|
-
const {test} = require('@alexbosworth/tap');
|
|
3
6
|
|
|
4
7
|
const gatewayRequest = require('./../../lnd_gateway/gateway_request');
|
|
5
8
|
|
|
@@ -122,7 +125,7 @@ const tests = [
|
|
|
122
125
|
];
|
|
123
126
|
|
|
124
127
|
tests.forEach(({args, description, error, expected}) => {
|
|
125
|
-
return test(description, async (
|
|
128
|
+
return test(description, async () => {
|
|
126
129
|
if (!!error) {
|
|
127
130
|
await rejects(gatewayRequest(args), error, 'Got expected error');
|
|
128
131
|
} else {
|
|
@@ -131,6 +134,6 @@ tests.forEach(({args, description, error, expected}) => {
|
|
|
131
134
|
equal(res, expected.res, 'Got expected result');
|
|
132
135
|
}
|
|
133
136
|
|
|
134
|
-
return
|
|
137
|
+
return;
|
|
135
138
|
});
|
|
136
139
|
});
|