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,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 {htlcAsPayment} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -131,11 +133,11 @@ const tests = [
|
|
|
131
133
|
];
|
|
132
134
|
|
|
133
135
|
tests.forEach(({args, description, error, expected}) => {
|
|
134
|
-
return test(description, (
|
|
136
|
+
return test(description, (t, end) => {
|
|
135
137
|
if (!!error) {
|
|
136
138
|
throws(() => htlcAsPayment(args), new Error(error), 'Got expected err');
|
|
137
139
|
} else {
|
|
138
|
-
|
|
140
|
+
deepStrictEqual(htlcAsPayment(args), expected, 'HTLC mapped as payment');
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
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 {infoAsWalletInfo} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -155,11 +157,11 @@ const tests = [
|
|
|
155
157
|
];
|
|
156
158
|
|
|
157
159
|
tests.forEach(({args, description, error, expected}) => {
|
|
158
|
-
return test(description, (
|
|
160
|
+
return test(description, (t, end) => {
|
|
159
161
|
if (!!error) {
|
|
160
162
|
throws(() => infoAsWalletInfo(args), new Error(error), 'Got error');
|
|
161
163
|
} else {
|
|
162
|
-
|
|
164
|
+
deepStrictEqual(infoAsWalletInfo(args), expected, 'Info as wallet info');
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
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 {nodeInfoAsNode} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -193,11 +195,11 @@ const tests = [
|
|
|
193
195
|
];
|
|
194
196
|
|
|
195
197
|
tests.forEach(({args, description, error, expected}) => {
|
|
196
|
-
return test(description, (
|
|
198
|
+
return test(description, (t, end) => {
|
|
197
199
|
if (!!error) {
|
|
198
200
|
throws(() => nodeInfoAsNode(args), new Error(error), 'Got error');
|
|
199
201
|
} else {
|
|
200
|
-
|
|
202
|
+
deepStrictEqual(nodeInfoAsNode(args), expected, 'Node info map to node');
|
|
201
203
|
}
|
|
202
204
|
|
|
203
205
|
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 {paymentFailure} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -254,11 +256,11 @@ const tests = [
|
|
|
254
256
|
];
|
|
255
257
|
|
|
256
258
|
tests.forEach(({args, description, error, expected}) => {
|
|
257
|
-
return test(description, (
|
|
259
|
+
return test(description, (t, end) => {
|
|
258
260
|
if (!!error) {
|
|
259
261
|
throws(() => paymentFailure(args), new Error(error), 'Got error');
|
|
260
262
|
} else {
|
|
261
|
-
|
|
263
|
+
deepStrictEqual(paymentFailure(args), expected, 'Payment failure map');
|
|
262
264
|
}
|
|
263
265
|
|
|
264
266
|
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 {paymentRequestDetails} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -156,11 +158,11 @@ const tests = [
|
|
|
156
158
|
];
|
|
157
159
|
|
|
158
160
|
tests.forEach(({args, description, error, expected}) => {
|
|
159
|
-
return test(description, (
|
|
161
|
+
return test(description, (t, end) => {
|
|
160
162
|
if (!!error) {
|
|
161
163
|
throws(() => paymentRequestDetails(args), new Error(error), 'Got err');
|
|
162
164
|
} else {
|
|
163
|
-
|
|
165
|
+
deepStrictEqual(paymentRequestDetails(args), expected, 'Map as payment');
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
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 {pendingAsPendingChannels} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -99,6 +101,7 @@ const makeArgs = overrides => {
|
|
|
99
101
|
|
|
100
102
|
const makeExpectedPending = overrides => {
|
|
101
103
|
const res = {
|
|
104
|
+
blocks_until_expiry: undefined,
|
|
102
105
|
capacity: 1,
|
|
103
106
|
close_transaction_id: Buffer.alloc(32).toString('hex'),
|
|
104
107
|
description: undefined,
|
|
@@ -437,11 +440,11 @@ const tests = [
|
|
|
437
440
|
];
|
|
438
441
|
|
|
439
442
|
tests.forEach(({args, description, error, expected}) => {
|
|
440
|
-
return test(description, (
|
|
443
|
+
return test(description, (t, end) => {
|
|
441
444
|
if (!!error) {
|
|
442
445
|
throws(() => pendingAsPendingChannels(args), new Error(error), 'Errors');
|
|
443
446
|
} else {
|
|
444
|
-
|
|
447
|
+
deepStrictEqual(pendingAsPendingChannels(args), expected, 'Pending map');
|
|
445
448
|
}
|
|
446
449
|
|
|
447
450
|
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 {pendingFromPayment} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -131,11 +133,11 @@ const tests = [
|
|
|
131
133
|
];
|
|
132
134
|
|
|
133
135
|
tests.forEach(({args, description, error, expected}) => {
|
|
134
|
-
return test(description, (
|
|
136
|
+
return test(description, (t, end) => {
|
|
135
137
|
if (!!error) {
|
|
136
138
|
throws(() => pendingFromPayment(args), new Error(error), 'Err');
|
|
137
139
|
} else {
|
|
138
|
-
|
|
140
|
+
deepStrictEqual(pendingFromPayment(args), expected, 'Mapped');
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
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 {policyFromChannelUpdate} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -96,11 +98,11 @@ const tests = [
|
|
|
96
98
|
];
|
|
97
99
|
|
|
98
100
|
tests.forEach(({args, description, error, expected}) => {
|
|
99
|
-
return test(description, (
|
|
101
|
+
return test(description, (t, end) => {
|
|
100
102
|
if (!!error) {
|
|
101
103
|
throws(() => policyFromChannelUpdate(args), new Error(error), 'Got err');
|
|
102
104
|
} else {
|
|
103
|
-
|
|
105
|
+
deepStrictEqual(policyFromChannelUpdate(args), expected, 'Map policy');
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
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 routeFromHint = require('./../../lnd_responses/route_from_route_hint');
|
|
4
6
|
|
|
@@ -130,11 +132,11 @@ const tests = [
|
|
|
130
132
|
];
|
|
131
133
|
|
|
132
134
|
tests.forEach(({args, description, error, expected}) => {
|
|
133
|
-
return test(description, (
|
|
135
|
+
return test(description, (t, end) => {
|
|
134
136
|
if (!!error) {
|
|
135
137
|
throws(() => routeFromHint(args), new Error(error), 'Got error');
|
|
136
138
|
} else {
|
|
137
|
-
|
|
139
|
+
deepStrictEqual(routeFromHint(args), expected.route, 'Got route');
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
return end();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const {
|
|
2
|
-
|
|
3
|
-
const {
|
|
1
|
+
const {deepStrictEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const {throws} = require('node:assert').strict;
|
|
4
4
|
|
|
5
5
|
const {routesFromQueryRoutes} = require('./../../lnd_responses');
|
|
6
6
|
|
|
7
7
|
const recordType = '11903';
|
|
8
|
+
const {stringify} = JSON;
|
|
8
9
|
|
|
9
10
|
const tests = [
|
|
10
11
|
{
|
|
@@ -133,7 +134,7 @@ const tests = [
|
|
|
133
134
|
];
|
|
134
135
|
|
|
135
136
|
tests.forEach(({description, error, expected, response}) => {
|
|
136
|
-
return test(
|
|
137
|
+
return test(description, (t, end) => {
|
|
137
138
|
if (!!error) {
|
|
138
139
|
throws(() => routesFromQueryRoutes({response}), new Error(error));
|
|
139
140
|
|
|
@@ -142,7 +143,7 @@ tests.forEach(({description, error, expected, response}) => {
|
|
|
142
143
|
|
|
143
144
|
const {routes} = routesFromQueryRoutes({response});
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
deepStrictEqual(stringify(routes), stringify(expected.routes));
|
|
146
147
|
|
|
147
148
|
return end();
|
|
148
149
|
})
|
|
@@ -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 {routingFailureFromHtlc} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -125,11 +127,11 @@ const tests = [
|
|
|
125
127
|
];
|
|
126
128
|
|
|
127
129
|
tests.forEach(({args, description, error, expected}) => {
|
|
128
|
-
return test(description, (
|
|
130
|
+
return test(description, (t, end) => {
|
|
129
131
|
if (!!error) {
|
|
130
132
|
throws(() => routingFailureFromHtlc(args), new Error(error), 'Got err');
|
|
131
133
|
} else {
|
|
132
|
-
|
|
134
|
+
deepStrictEqual(routingFailureFromHtlc(args), expected, 'HTLC mapped');
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
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 {rpcAddressesAsAddresses} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -68,13 +70,13 @@ const tests = [
|
|
|
68
70
|
];
|
|
69
71
|
|
|
70
72
|
tests.forEach(({args, description, error, expected}) => {
|
|
71
|
-
return test(description, (
|
|
73
|
+
return test(description, (t, end) => {
|
|
72
74
|
if (!!error) {
|
|
73
75
|
throws(() => rpcAddressesAsAddresses(args), new Error(error), 'Got err');
|
|
74
76
|
} else {
|
|
75
77
|
const res = rpcAddressesAsAddresses(args);
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
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 {rpcAttemptHtlcAsAttempt} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -113,13 +115,13 @@ const tests = [
|
|
|
113
115
|
];
|
|
114
116
|
|
|
115
117
|
tests.forEach(({args, description, error, expected}) => {
|
|
116
|
-
return test(
|
|
118
|
+
return test(description, (t, end) => {
|
|
117
119
|
if (!!error) {
|
|
118
120
|
throws(() => rpcAttemptHtlcAsAttempt(args), new Error(error), 'Got err');
|
|
119
121
|
} else {
|
|
120
122
|
const attempt = rpcAttemptHtlcAsAttempt(args);
|
|
121
123
|
|
|
122
|
-
|
|
124
|
+
deepStrictEqual(attempt, expected.attempt, 'Attempt from rpc attempt');
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
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 {rpcChannelAsChannel} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -294,13 +296,13 @@ const tests = [
|
|
|
294
296
|
];
|
|
295
297
|
|
|
296
298
|
tests.forEach(({args, description, error, expected}) => {
|
|
297
|
-
return test(description, (
|
|
299
|
+
return test(description, (t, end) => {
|
|
298
300
|
if (!!error) {
|
|
299
301
|
throws(() => rpcChannelAsChannel(args), new Error(error), 'Got error');
|
|
300
302
|
} else {
|
|
301
303
|
const channel = rpcChannelAsChannel(args);
|
|
302
304
|
|
|
303
|
-
|
|
305
|
+
deepStrictEqual(channel, expected, 'Channel cast as channel');
|
|
304
306
|
}
|
|
305
307
|
|
|
306
308
|
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 {rpcChannelClosedAsClosed} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -93,17 +95,17 @@ const tests = [
|
|
|
93
95
|
];
|
|
94
96
|
|
|
95
97
|
tests.forEach(({args, description, error, expected}) => {
|
|
96
|
-
return test(description, (
|
|
98
|
+
return test(description, (t, end) => {
|
|
97
99
|
if (!!error) {
|
|
98
100
|
throws(() => rpcChannelClosedAsClosed(args), new Error(error), 'Error');
|
|
99
101
|
} else {
|
|
100
102
|
const update = rpcChannelClosedAsClosed(args);
|
|
101
103
|
|
|
102
|
-
|
|
104
|
+
deepStrictEqual(!!update.updated_at, true, 'Has last updated date');
|
|
103
105
|
|
|
104
106
|
delete update.updated_at;
|
|
105
107
|
|
|
106
|
-
|
|
108
|
+
deepStrictEqual(update, expected, 'Channel closed cast as close');
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
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 {rpcChannelUpdateAsUpdate} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -171,17 +173,17 @@ const tests = [
|
|
|
171
173
|
];
|
|
172
174
|
|
|
173
175
|
tests.forEach(({args, description, error, expected}) => {
|
|
174
|
-
return test(description, (
|
|
176
|
+
return test(description, (t, end) => {
|
|
175
177
|
if (!!error) {
|
|
176
178
|
throws(() => rpcChannelUpdateAsUpdate(args), new Error(error), 'Error');
|
|
177
179
|
} else {
|
|
178
180
|
const update = rpcChannelUpdateAsUpdate(args);
|
|
179
181
|
|
|
180
|
-
|
|
182
|
+
deepStrictEqual(!!update.updated_at, true, 'Has last updated date');
|
|
181
183
|
|
|
182
184
|
delete update.updated_at;
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
deepStrictEqual(update, expected, 'Channel update cast as update');
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
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 {rpcClosedChannelAsClosed} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -175,13 +177,13 @@ const tests = [
|
|
|
175
177
|
];
|
|
176
178
|
|
|
177
179
|
tests.forEach(({args, description, error, expected}) => {
|
|
178
|
-
return test(description, (
|
|
180
|
+
return test(description, (t, end) => {
|
|
179
181
|
if (!!error) {
|
|
180
182
|
throws(() => rpcClosedChannelAsClosed(args), new Error(error), 'Error');
|
|
181
183
|
} else {
|
|
182
184
|
const channel = rpcClosedChannelAsClosed(args);
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
deepStrictEqual(channel, expected, 'Channel closed cast as close');
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
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 {rpcConfAsConfirmation} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -61,13 +63,13 @@ const tests = [
|
|
|
61
63
|
];
|
|
62
64
|
|
|
63
65
|
tests.forEach(({args, description, error, expected}) => {
|
|
64
|
-
return test(description, (
|
|
66
|
+
return test(description, (t, end) => {
|
|
65
67
|
if (!!error) {
|
|
66
68
|
throws(() => rpcConfAsConfirmation(args), new Error(error), 'Got error');
|
|
67
69
|
} else {
|
|
68
70
|
const channel = rpcConfAsConfirmation(args);
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
deepStrictEqual(channel, expected, 'Channel cast as channel');
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
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 {rpcFailedPolicyAsFail} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -53,13 +55,13 @@ const tests = [
|
|
|
53
55
|
];
|
|
54
56
|
|
|
55
57
|
tests.forEach(({args, description, error, expected}) => {
|
|
56
|
-
return test(
|
|
58
|
+
return test(description, (t, end) => {
|
|
57
59
|
if (!!error) {
|
|
58
60
|
throws(() => rpcFailedPolicyAsFail(args), new Error(error), 'Got error');
|
|
59
61
|
} else {
|
|
60
62
|
const res = rpcFailedPolicyAsFail(args);
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
deepStrictEqual(res, expected, 'Got expected details');
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
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 {rpcFeesAsChannelFees} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -71,13 +73,13 @@ const tests = [
|
|
|
71
73
|
];
|
|
72
74
|
|
|
73
75
|
tests.forEach(({args, description, error, expected}) => {
|
|
74
|
-
return test(
|
|
76
|
+
return test(description, (t, end) => {
|
|
75
77
|
if (!!error) {
|
|
76
78
|
throws(() => rpcFeesAsChannelFees(args), new Error(error), 'Got error');
|
|
77
79
|
} else {
|
|
78
80
|
const res = rpcFeesAsChannelFees(args);
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
deepStrictEqual(res, expected, 'Got expected details');
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
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 {rpcForwardAsForward} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -127,13 +129,13 @@ const tests = [
|
|
|
127
129
|
];
|
|
128
130
|
|
|
129
131
|
tests.forEach(({args, description, error, expected}) => {
|
|
130
|
-
return test(
|
|
132
|
+
return test(description, (t, end) => {
|
|
131
133
|
if (!!error) {
|
|
132
134
|
throws(() => rpcForwardAsForward(args), new Error(error), 'Got error');
|
|
133
135
|
} else {
|
|
134
136
|
const forward = rpcForwardAsForward(args);
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
deepStrictEqual(forward, expected, 'Got expected forward details');
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
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 {rpcForwardAsForwardRequest} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -126,13 +128,13 @@ const tests = [
|
|
|
126
128
|
];
|
|
127
129
|
|
|
128
130
|
tests.forEach(({args, description, error, expected}) => {
|
|
129
|
-
return test(
|
|
131
|
+
return test(description, (t, end) => {
|
|
130
132
|
if (!!error) {
|
|
131
133
|
throws(() => rpcForwardAsForwardRequest(args), new Error(error), 'Err');
|
|
132
134
|
} else {
|
|
133
135
|
const request = rpcForwardAsForwardRequest(args);
|
|
134
136
|
|
|
135
|
-
|
|
137
|
+
deepStrictEqual(request, expected, 'Got expected forward request');
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
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 {rpcGroupSessionAsSession} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -65,13 +67,13 @@ const tests = [
|
|
|
65
67
|
];
|
|
66
68
|
|
|
67
69
|
tests.forEach(({args, description, error, expected}) => {
|
|
68
|
-
return test(description, (
|
|
70
|
+
return test(description, (t, end) => {
|
|
69
71
|
if (!!error) {
|
|
70
72
|
throws(() => rpcGroupSessionAsSession(args), new Error(error), 'Error');
|
|
71
73
|
} else {
|
|
72
74
|
const res = rpcGroupSessionAsSession(args);
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
deepStrictEqual(res, expected, 'Got expected result');
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
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 {rpcHopAsHop} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -105,11 +107,11 @@ const tests = [
|
|
|
105
107
|
];
|
|
106
108
|
|
|
107
109
|
tests.forEach(({args, description, error, expected}) => {
|
|
108
|
-
return test(description, (
|
|
110
|
+
return test(description, (t, end) => {
|
|
109
111
|
if (!!error) {
|
|
110
112
|
throws(() => rpcHopAsHop(args), new Error(error), 'Got err');
|
|
111
113
|
} else {
|
|
112
|
-
|
|
114
|
+
deepStrictEqual(rpcHopAsHop(args), expected, 'Got expected result');
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
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 rpcHtlcAsPayment = require('./../../lnd_responses/rpc_htlc_as_payment');
|
|
4
6
|
|
|
@@ -108,11 +110,11 @@ const tests = [
|
|
|
108
110
|
];
|
|
109
111
|
|
|
110
112
|
tests.forEach(({args, description, error, expected}) => {
|
|
111
|
-
return test(description, (
|
|
113
|
+
return test(description, (t, end) => {
|
|
112
114
|
if (!!error) {
|
|
113
115
|
throws(() => rpcHtlcAsPayment(args), new Error(error), 'Got err');
|
|
114
116
|
} else {
|
|
115
|
-
|
|
117
|
+
deepStrictEqual(rpcHtlcAsPayment(args), expected, 'Mapped to payment');
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
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 {rpcInvoiceAsInvoice} = require('./../../lnd_responses');
|
|
4
6
|
|
|
@@ -252,11 +254,11 @@ const tests = [
|
|
|
252
254
|
];
|
|
253
255
|
|
|
254
256
|
tests.forEach(({args, description, error, expected}) => {
|
|
255
|
-
return test(description, (
|
|
257
|
+
return test(description, (t, end) => {
|
|
256
258
|
if (!!error) {
|
|
257
259
|
throws(() => rpcInvoiceAsInvoice(args), new Error(error), 'Got err');
|
|
258
260
|
} else {
|
|
259
|
-
|
|
261
|
+
deepStrictEqual(rpcInvoiceAsInvoice(args), expected, 'Map to invoice');
|
|
260
262
|
}
|
|
261
263
|
|
|
262
264
|
return end();
|