blitz_api/tests
Justin Sharp 84a888f0ba fix: use decode instead of deprecated decodepay in CLN backends
CLN deprecated decodepay in favor of decode in v24.11, now rejects it by
default (observed on v25.12.1: JSON-RPC -32601 "Command decodepay is
deprecated") and removes it entirely in v26.04. Both CLN implementations
still called decodepay in decode_pay_request(), so on current CLN every
call fails, list_all_tx() propagates the failure, and the
/lightning/list-all-tx endpoint returns HTTP 500 — permanently breaking
the Transactions view in the web UI.

Switch both cln_jrpc.py and cln_grpc.py to decode (the CLI fallback
keyword changes from bolt11= to string=). For bolt11 invoices decode
returns a superset of decodepay fields, so PaymentRequest.from_cln_json
is unchanged. decode reports recognized-but-invalid strings as a normal
result with valid=false + warning_* fields instead of an RPC error, so
both backends now map that case to a clear 400 rather than crashing in
from_cln_json the way #307 did.

Reproduced on RaspiBlitz v1.12.1 with Core Lightning v25.12.1; verified
on the same node that decode returns every field the parser consumes and
that the Transactions view loads after the patch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 13:03:06 -06:00
..
models feat: implement Ruff as a linter; fix given errors 2023-06-25 07:17:00 +02:00
routers feat(api): implement GET /system/health readiness endpoint (#145) 2026-07-12 18:41:18 +02:00
__init__.py test: Add testing dependencies and first tests 2021-10-02 12:00:44 +02:00
test_app_manage_lock.py fix(api): release Redis connections in channel listeners/notifiers 2026-07-03 22:40:14 +02:00
test_apps_uninstall_keep_data.py fix(apps): honour keep_data on uninstall and fix install log name 2026-07-03 20:58:35 +02:00
test_bitcoin_rpc_success.py test(bitcoind): lock JSON-RPC 2.0 success handling (no error key) 2026-07-08 13:47:11 +02:00
test_bitcoin_rpc_warmup.py fix(bitcoind): handle JSON-RPC errors returned with HTTP 200 2026-07-08 13:30:04 +02:00
test_change_password.py fix(system): stop leaking passwords via change-password endpoint 2026-07-03 21:42:25 +02:00
test_channel_cleanup.py fix(api): release Redis connections in channel listeners/notifiers 2026-07-03 22:40:14 +02:00
test_cln_list_all_tx.py fix(lightning): include payments in CLN list_all_tx 2026-07-03 20:45:21 +02:00
test_cln_shell_safety.py fix: use decode instead of deprecated decodepay in CLN backends 2026-07-20 13:03:06 -06:00
test_decode_pay_request_errors.py fix: use decode instead of deprecated decodepay in CLN backends 2026-07-20 13:03:06 -06:00
test_electrs_advanced_status.py fix(apps): report electrs installed/configured/online in advanced status 2026-07-08 13:07:52 +02:00
test_error_handlers.py feat(api): normalize all error responses to the ErrorMessage shape 2026-07-12 18:41:18 +02:00
test_error_response.py feat(api): add gated build_error_response for consistent errors 2026-07-12 18:41:18 +02:00
test_exec_bash_timeout.py fix(api): catch subprocess timeouts in exec_bash_command 2026-07-03 19:59:57 +02:00
test_hardware_info_vm.py fix(system): tolerate empty hardware Redis values on VM setups 2026-07-08 14:45:21 +02:00
test_hw_gatherer_resilience.py feat(api): serve realtime updates over /ws WebSocket 2026-07-12 18:41:18 +02:00
test_jwt.py fix(auth): correct JWT expiry unit and use standard exp claim 2026-07-03 20:35:34 +02:00
test_lnd_transient_errors.py fix(lnd): return a retryable status while the RPC server starts up 2026-07-11 10:02:20 +02:00
test_native_python_errors.py fix(system): stop native_python impl swallowing errors into None 2026-07-03 21:44:25 +02:00
test_send_coins_input.py refactor(lightning): migrate SendCoinsInput validator to Pydantic v2 2026-07-03 22:22:05 +02:00
test_startup_status.py refactor(api): hoist api_startup_status into a shared leaf module 2026-07-12 18:41:18 +02:00
test_system_health.py feat(api): add pure build_health_info + rename subsystem field to healthy 2026-07-12 18:41:18 +02:00
test_warmup_events.py feat(api): serve realtime updates over /ws WebSocket 2026-07-12 18:41:18 +02:00
test_ws_endpoint.py feat(api): serve realtime updates over /ws WebSocket 2026-07-12 18:41:18 +02:00
test_ws_manager.py fix(api): harden WebSocket auth handshake against bad/disconnecting clients 2026-07-12 18:41:18 +02:00
utils.py chore: format source using the pre_commit command 2022-03-20 17:20:56 +01:00