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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const EventEmitter = require('node:events');
|
|
3
|
+
const {rejects} = require('node:assert').strict;
|
|
4
|
+
const test = require('node:test');
|
|
4
5
|
|
|
5
6
|
const {closeChannel} = require('./../../../lnd_methods');
|
|
6
7
|
|
|
@@ -199,15 +200,15 @@ const tests = [
|
|
|
199
200
|
];
|
|
200
201
|
|
|
201
202
|
tests.forEach(({args, description, error, expected}) => {
|
|
202
|
-
return test(description, async (
|
|
203
|
+
return test(description, async () => {
|
|
203
204
|
if (!!error) {
|
|
204
205
|
await rejects(closeChannel(args), error, 'Got expected error');
|
|
205
206
|
} else {
|
|
206
207
|
const res = await closeChannel(args);
|
|
207
208
|
|
|
208
|
-
|
|
209
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
209
210
|
}
|
|
210
211
|
|
|
211
|
-
return
|
|
212
|
+
return;
|
|
212
213
|
});
|
|
213
214
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {rejects} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
2
3
|
|
|
3
4
|
const {fundPendingChannels} = require('./../../../lnd_methods');
|
|
4
5
|
|
|
@@ -108,13 +109,13 @@ const tests = [
|
|
|
108
109
|
];
|
|
109
110
|
|
|
110
111
|
tests.forEach(({args, description, error, expected}) => {
|
|
111
|
-
return test(description, async (
|
|
112
|
+
return test(description, async () => {
|
|
112
113
|
if (!!error) {
|
|
113
114
|
await rejects(fundPendingChannels(args), error, 'Got error');
|
|
114
115
|
} else {
|
|
115
116
|
await fundPendingChannels(args);
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
return
|
|
119
|
+
return;
|
|
119
120
|
});
|
|
120
121
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {fundPsbt} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -170,15 +172,15 @@ const tests = [
|
|
|
170
172
|
];
|
|
171
173
|
|
|
172
174
|
tests.forEach(({args, description, error, expected}) => {
|
|
173
|
-
return test(description, async (
|
|
175
|
+
return test(description, async () => {
|
|
174
176
|
if (!!error) {
|
|
175
177
|
await rejects(fundPsbt(args), error, 'Got error');
|
|
176
178
|
} else {
|
|
177
179
|
const got = await fundPsbt(args);
|
|
178
180
|
|
|
179
|
-
|
|
181
|
+
deepStrictEqual(got, expected, 'Got expected result');
|
|
180
182
|
}
|
|
181
183
|
|
|
182
|
-
return
|
|
184
|
+
return;
|
|
183
185
|
});
|
|
184
186
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getBlock} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -217,15 +219,15 @@ const tests = [
|
|
|
217
219
|
];
|
|
218
220
|
|
|
219
221
|
tests.forEach(({args, description, error, expected}) => {
|
|
220
|
-
return test(description, async (
|
|
222
|
+
return test(description, async () => {
|
|
221
223
|
if (!!error) {
|
|
222
224
|
await rejects(() => getBlock(args), error, 'Got expected error');
|
|
223
225
|
} else {
|
|
224
226
|
const res = await getBlock(args);
|
|
225
227
|
|
|
226
|
-
|
|
228
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
227
229
|
}
|
|
228
230
|
|
|
229
|
-
return
|
|
231
|
+
return;
|
|
230
232
|
});
|
|
231
233
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getChainAddresses} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -61,15 +63,15 @@ const tests = [
|
|
|
61
63
|
];
|
|
62
64
|
|
|
63
65
|
tests.forEach(({args, description, error, expected}) => {
|
|
64
|
-
return test(description, async (
|
|
66
|
+
return test(description, async () => {
|
|
65
67
|
if (!!error) {
|
|
66
68
|
await rejects(() => getChainAddresses(args), error, 'Got error');
|
|
67
69
|
} else {
|
|
68
70
|
const res = await getChainAddresses(args);
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
return
|
|
75
|
+
return;
|
|
74
76
|
});
|
|
75
77
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {strictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getChainBalance} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -37,15 +39,15 @@ const tests = [
|
|
|
37
39
|
];
|
|
38
40
|
|
|
39
41
|
tests.forEach(({args, description, error, expected}) => {
|
|
40
|
-
return test(description, async (
|
|
42
|
+
return test(description, async () => {
|
|
41
43
|
if (!!error) {
|
|
42
|
-
rejects(() => getChainBalance(args), error, 'Got expected error');
|
|
44
|
+
await rejects(() => getChainBalance(args), error, 'Got expected error');
|
|
43
45
|
} else {
|
|
44
46
|
const res = await getChainBalance(args);
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
strictEqual(res.chain_balance, expected.chain_balance, 'Got balance');
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
return
|
|
51
|
+
return;
|
|
50
52
|
});
|
|
51
53
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getChainFeeEstimate} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -114,15 +116,15 @@ const tests = [
|
|
|
114
116
|
];
|
|
115
117
|
|
|
116
118
|
tests.forEach(({args, description, error, expected}) => {
|
|
117
|
-
return test(description, async (
|
|
119
|
+
return test(description, async () => {
|
|
118
120
|
if (!!error) {
|
|
119
121
|
await rejects(() => getChainFeeEstimate(args), error, 'Got error');
|
|
120
122
|
} else {
|
|
121
123
|
const estimate = await getChainFeeEstimate(args);
|
|
122
124
|
|
|
123
|
-
|
|
125
|
+
deepStrictEqual(estimate, expected, 'Got chain fee estimate');
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
return
|
|
128
|
+
return;
|
|
127
129
|
});
|
|
128
130
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {rejects} = require('node:assert').strict;
|
|
2
|
+
const {strictEqual} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getChainFeeRate} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -51,15 +53,15 @@ const tests = [
|
|
|
51
53
|
];
|
|
52
54
|
|
|
53
55
|
tests.forEach(({args, description, error, expected}) => {
|
|
54
|
-
return test(description, async (
|
|
56
|
+
return test(description, async () => {
|
|
55
57
|
if (!!error) {
|
|
56
58
|
await rejects(getChainFeeRate(args), error, 'Got expected error');
|
|
57
59
|
} else {
|
|
58
60
|
const res = await getChainFeeRate(args);
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
strictEqual(res.tokens_per_vbyte, expected.tokens_per_vbyte, 'Got rate');
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
return
|
|
65
|
+
return;
|
|
64
66
|
});
|
|
65
67
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getChainTransactions} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -165,15 +167,15 @@ const tests = [
|
|
|
165
167
|
];
|
|
166
168
|
|
|
167
169
|
tests.forEach(({args, description, error, expected}) => {
|
|
168
|
-
return test(description, async (
|
|
170
|
+
return test(description, async () => {
|
|
169
171
|
if (!!error) {
|
|
170
172
|
await rejects(() => getChainTransactions(args), error, 'Got err');
|
|
171
173
|
} else {
|
|
172
174
|
const {transactions} = await getChainTransactions(args);
|
|
173
175
|
|
|
174
|
-
|
|
176
|
+
deepStrictEqual(transactions, expected.transactions, 'Got transactions');
|
|
175
177
|
}
|
|
176
178
|
|
|
177
|
-
return
|
|
179
|
+
return;
|
|
178
180
|
});
|
|
179
181
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getLockedUtxos} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -90,15 +92,15 @@ const tests = [
|
|
|
90
92
|
];
|
|
91
93
|
|
|
92
94
|
tests.forEach(({args, description, error, expected}) => {
|
|
93
|
-
return test(description, async (
|
|
95
|
+
return test(description, async () => {
|
|
94
96
|
if (!!error) {
|
|
95
97
|
await rejects(() => getLockedUtxos(args), error, 'Got expected error');
|
|
96
98
|
} else {
|
|
97
99
|
const {utxos} = await getLockedUtxos(args);
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
deepStrictEqual(utxos, expected, 'Got locked utxos');
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
return
|
|
104
|
+
return;
|
|
103
105
|
});
|
|
104
106
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getMasterPublicKeys} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -80,15 +82,15 @@ const tests = [
|
|
|
80
82
|
];
|
|
81
83
|
|
|
82
84
|
tests.forEach(({args, description, error, expected}) => {
|
|
83
|
-
return test(description, async (
|
|
85
|
+
return test(description, async () => {
|
|
84
86
|
if (!!error) {
|
|
85
87
|
await rejects(() => getMasterPublicKeys(args), error, 'Got error');
|
|
86
88
|
} else {
|
|
87
89
|
const {keys} = await getMasterPublicKeys(args);
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
deepStrictEqual(keys, expected.keys, 'Got keys');
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
return
|
|
94
|
+
return;
|
|
93
95
|
});
|
|
94
96
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {rejects} = require('node:assert').strict;
|
|
2
|
+
const {strictEqual} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getPendingChainBalance} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -39,15 +41,15 @@ const tests = [
|
|
|
39
41
|
];
|
|
40
42
|
|
|
41
43
|
tests.forEach(({args, description, error, expected}) => {
|
|
42
|
-
return test(description, async (
|
|
44
|
+
return test(description, async () => {
|
|
43
45
|
if (!!error) {
|
|
44
46
|
await rejects(() => getPendingChainBalance(args), error, 'Got error');
|
|
45
47
|
} else {
|
|
46
48
|
const res = await getPendingChainBalance(args);
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
strictEqual(res.pending_chain_balance, expected, 'Got pending balance');
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
return
|
|
53
|
+
return;
|
|
52
54
|
});
|
|
53
55
|
});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
4
|
+
|
|
2
5
|
const {Transaction} = require('bitcoinjs-lib');
|
|
3
6
|
|
|
4
7
|
const {getSweepTransactions} = require('./../../../lnd_methods');
|
|
@@ -109,15 +112,15 @@ const tests = [
|
|
|
109
112
|
];
|
|
110
113
|
|
|
111
114
|
tests.forEach(({args, description, error, expected}) => {
|
|
112
|
-
return test(description, async (
|
|
115
|
+
return test(description, async () => {
|
|
113
116
|
if (!!error) {
|
|
114
117
|
await rejects(() => getSweepTransactions(args), error, 'Got error');
|
|
115
118
|
} else {
|
|
116
119
|
const res = await getSweepTransactions(args);
|
|
117
120
|
|
|
118
|
-
|
|
121
|
+
deepStrictEqual(res.transactions, expected.transactions, 'Got txs');
|
|
119
122
|
}
|
|
120
123
|
|
|
121
|
-
return
|
|
124
|
+
return;
|
|
122
125
|
});
|
|
123
126
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {getUtxos} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -134,15 +136,15 @@ const tests = [
|
|
|
134
136
|
];
|
|
135
137
|
|
|
136
138
|
tests.forEach(({args, description, error, expected}) => {
|
|
137
|
-
return test(description, async (
|
|
139
|
+
return test(description, async () => {
|
|
138
140
|
if (!!error) {
|
|
139
141
|
await rejects(() => getUtxos(args), error, 'Got expected error');
|
|
140
142
|
} else {
|
|
141
143
|
const {utxos} = await getUtxos(args);
|
|
142
144
|
|
|
143
|
-
|
|
145
|
+
deepStrictEqual(utxos, expected.utxos, 'Got utxos');
|
|
144
146
|
}
|
|
145
147
|
|
|
146
|
-
return
|
|
148
|
+
return;
|
|
147
149
|
});
|
|
148
150
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {lockUtxo} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -79,15 +81,15 @@ const tests = [
|
|
|
79
81
|
];
|
|
80
82
|
|
|
81
83
|
tests.forEach(({args, description, error, expected}) => {
|
|
82
|
-
return test(description, async (
|
|
84
|
+
return test(description, async () => {
|
|
83
85
|
if (!!error) {
|
|
84
86
|
await rejects(lockUtxo(args), error, 'Got expected error');
|
|
85
87
|
} else {
|
|
86
88
|
const got = await lockUtxo(args);
|
|
87
89
|
|
|
88
|
-
|
|
90
|
+
deepStrictEqual(got, expected, 'Got expected result');
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
return
|
|
93
|
+
return;
|
|
92
94
|
});
|
|
93
95
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const EventEmitter = require('node:events');
|
|
3
|
+
const {rejects} = require('node:assert').strict;
|
|
4
|
+
const test = require('node:test');
|
|
4
5
|
|
|
5
6
|
const {openChannel} = require('./../../../lnd_methods');
|
|
6
7
|
|
|
@@ -198,15 +199,15 @@ const tests = [
|
|
|
198
199
|
];
|
|
199
200
|
|
|
200
201
|
tests.forEach(({args, description, error, expected}) => {
|
|
201
|
-
return test(description, async (
|
|
202
|
+
return test(description, async () => {
|
|
202
203
|
if (!!error) {
|
|
203
204
|
await rejects(openChannel(args), error, 'Got expected error');
|
|
204
205
|
} else {
|
|
205
206
|
const res = await openChannel(args);
|
|
206
207
|
|
|
207
|
-
|
|
208
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
208
209
|
}
|
|
209
210
|
|
|
210
|
-
return
|
|
211
|
+
return;
|
|
211
212
|
});
|
|
212
213
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const EventEmitter = require('events');
|
|
2
|
-
|
|
3
|
-
const {
|
|
1
|
+
const EventEmitter = require('node:events');
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const {strictEqual} = require('node:assert').strict;
|
|
4
|
+
const test = require('node:test');
|
|
4
5
|
|
|
5
6
|
const {openChannels} = require('./../../../lnd_methods');
|
|
6
7
|
|
|
@@ -184,7 +185,7 @@ const tests = [
|
|
|
184
185
|
];
|
|
185
186
|
|
|
186
187
|
tests.forEach(({args, description, error, expected}) => {
|
|
187
|
-
return test(description, async (
|
|
188
|
+
return test(description, async () => {
|
|
188
189
|
if (!!error) {
|
|
189
190
|
await rejects(openChannels(args), error, 'Got error');
|
|
190
191
|
} else {
|
|
@@ -192,11 +193,11 @@ tests.forEach(({args, description, error, expected}) => {
|
|
|
192
193
|
|
|
193
194
|
const [channel] = pending;
|
|
194
195
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
strictEqual(channel.address, expected.pending.address, 'Got fund addr');
|
|
197
|
+
strictEqual(channel.id.length, 64, 'Got expected pending id');
|
|
198
|
+
strictEqual(channel.tokens, expected.pending.tokens, 'Got tokens');
|
|
198
199
|
}
|
|
199
200
|
|
|
200
|
-
return
|
|
201
|
+
return;
|
|
201
202
|
});
|
|
202
203
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {partiallySignPsbt} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -50,7 +52,7 @@ const tests = [
|
|
|
50
52
|
},
|
|
51
53
|
}),
|
|
52
54
|
description: 'Unsupported error is passed back',
|
|
53
|
-
error: [501, '
|
|
55
|
+
error: [501, 'PartiallySignPsbtMethodNotSupported'],
|
|
54
56
|
},
|
|
55
57
|
{
|
|
56
58
|
args: makeArgs({lnd: {wallet: {signPsbt: ({}, cbk) => cbk('err')}}}),
|
|
@@ -86,15 +88,15 @@ const tests = [
|
|
|
86
88
|
];
|
|
87
89
|
|
|
88
90
|
tests.forEach(({args, description, error, expected}) => {
|
|
89
|
-
return test(description, async (
|
|
91
|
+
return test(description, async () => {
|
|
90
92
|
if (!!error) {
|
|
91
93
|
await rejects(partiallySignPsbt(args), error, 'Got error');
|
|
92
94
|
} else {
|
|
93
95
|
const got = await partiallySignPsbt(args);
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
deepStrictEqual(got, expected, 'Got expected result');
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
return
|
|
100
|
+
return;
|
|
99
101
|
});
|
|
100
102
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {prepareForChannelProposal} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -81,15 +83,15 @@ const tests = [
|
|
|
81
83
|
];
|
|
82
84
|
|
|
83
85
|
tests.forEach(({args, description, error, expected}) => {
|
|
84
|
-
return test(description, async (
|
|
86
|
+
return test(description, async () => {
|
|
85
87
|
if (!!error) {
|
|
86
88
|
await rejects(() => prepareForChannelProposal(args), error, 'Got err');
|
|
87
89
|
} else {
|
|
88
90
|
const res = await prepareForChannelProposal(args);
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
deepStrictEqual(res.id.length, 64, 'Got pending id');
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
return
|
|
95
|
+
return;
|
|
94
96
|
});
|
|
95
97
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const EventEmitter = require('node:events');
|
|
3
|
+
const {rejects} = require('node:assert').strict;
|
|
4
|
+
const test = require('node:test');
|
|
4
5
|
|
|
5
6
|
const {proposeChannel} = require('./../../../lnd_methods');
|
|
6
7
|
|
|
@@ -176,15 +177,15 @@ const tests = [
|
|
|
176
177
|
];
|
|
177
178
|
|
|
178
179
|
tests.forEach(({args, description, error, expected}) => {
|
|
179
|
-
return test(description, async (
|
|
180
|
+
return test(description, async () => {
|
|
180
181
|
if (!!error) {
|
|
181
182
|
await rejects(proposeChannel(args), error, 'Got expected error');
|
|
182
183
|
} else {
|
|
183
184
|
const res = await proposeChannel(args);
|
|
184
185
|
|
|
185
|
-
|
|
186
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
186
187
|
}
|
|
187
188
|
|
|
188
|
-
return
|
|
189
|
+
return;
|
|
189
190
|
});
|
|
190
191
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {rejects} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
2
3
|
|
|
3
4
|
const {requestChainFeeIncrease} = require('./../../../lnd_methods');
|
|
4
5
|
|
|
@@ -76,13 +77,13 @@ const tests = [
|
|
|
76
77
|
];
|
|
77
78
|
|
|
78
79
|
tests.forEach(({args, description, error, expected}) => {
|
|
79
|
-
return test(description, async (
|
|
80
|
+
return test(description, async () => {
|
|
80
81
|
if (!!error) {
|
|
81
82
|
await rejects(requestChainFeeIncrease(args), error, 'Got error');
|
|
82
83
|
} else {
|
|
83
84
|
await requestChainFeeIncrease(args);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
return
|
|
87
|
+
return;
|
|
87
88
|
});
|
|
88
89
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
2
3
|
|
|
3
4
|
const scriptFromChainAddress = require('./../../../lnd_methods/onchain/script_from_chain_address');
|
|
4
5
|
|
|
@@ -63,10 +64,10 @@ const tests = [
|
|
|
63
64
|
];
|
|
64
65
|
|
|
65
66
|
tests.forEach(({args, description, expected}) => {
|
|
66
|
-
return test(description, (
|
|
67
|
+
return test(description, (t, end) => {
|
|
67
68
|
const {script} = scriptFromChainAddress(args);
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
deepStrictEqual(script, expected.script, 'Script derived from address');
|
|
70
71
|
|
|
71
72
|
return end();
|
|
72
73
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const {rejects} = require('node:assert').strict;
|
|
3
|
+
const test = require('node:test');
|
|
2
4
|
|
|
3
5
|
const {sendToChainAddress} = require('./../../../lnd_methods');
|
|
4
6
|
|
|
@@ -147,15 +149,15 @@ const tests = [
|
|
|
147
149
|
];
|
|
148
150
|
|
|
149
151
|
tests.forEach(({args, description, error, expected}) => {
|
|
150
|
-
return test(description, async (
|
|
152
|
+
return test(description, async () => {
|
|
151
153
|
if (!!error) {
|
|
152
154
|
await rejects(() => sendToChainAddress(args), error, 'Got err');
|
|
153
155
|
} else {
|
|
154
156
|
const res = await sendToChainAddress(args);
|
|
155
157
|
|
|
156
|
-
|
|
158
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
return
|
|
161
|
+
return;
|
|
160
162
|
});
|
|
161
163
|
});
|