Skip to content

fix(websocket): support generic quote kinds#1013

Open
callebtc wants to merge 1 commit into
mainfrom
fix/websocket-generic-subscription-kinds
Open

fix(websocket): support generic quote kinds#1013
callebtc wants to merge 1 commit into
mainfrom
fix/websocket-generic-subscription-kinds

Conversation

@callebtc
Copy link
Copy Markdown
Collaborator

@callebtc callebtc commented May 21, 2026

Summary

  • Simplify NUT-17 subscription kinds nuts#372
  • switch websocket quote subscriptions and advertised NUT-17 commands to the new generic mint_quote and melt_quote kinds
  • keep mint-side support for deprecated bolt11_* subscription kinds for backwards compatibility, with TODO comments to remove later
  • update wallet and websocket tests to use the new kind while keeping a mint-side regression test for the deprecated format

Verification

  • poetry run python -m py_compile cashu/core/json_rpc/base.py cashu/core/base.py cashu/mint/events/client.py cashu/mint/features.py cashu/core/mint_info.py cashu/wallet/mint_info.py cashu/wallet/wallet.py tests/mint/test_mint_websocket_protocol.py tests/wallet/test_wallet_subscription_unit.py tests/wallet/test_wallet_subscription.py tests/mint/test_mint_db.py
  • git diff --check -- cashu/core/json_rpc/base.py cashu/core/base.py cashu/mint/events/client.py cashu/mint/features.py cashu/core/mint_info.py cashu/wallet/mint_info.py cashu/wallet/wallet.py tests/mint/test_mint_websocket_protocol.py tests/wallet/test_wallet_subscription_unit.py tests/wallet/test_wallet_subscription.py tests/mint/test_mint_db.py
  • poetry run pytest tests/mint/test_mint_websocket_protocol.py tests/wallet/test_wallet_subscription_unit.py tests/mint/test_mint_db.py -q (blocked locally: Poetry env is using Python 3.14 and fails before test collection)
  • poetry run pytest tests/wallet/test_wallet_subscription.py -q (blocked locally: Poetry env is using Python 3.14 and fails before test collection)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.98%. Comparing base (85c959e) to head (2e4194f).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cashu/core/base.py 54.54% 5 Missing ⚠️
cashu/core/json_rpc/base.py 94.11% 1 Missing ⚠️
cashu/wallet/mint_info.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
+ Coverage   74.92%   74.98%   +0.05%     
==========================================
  Files         111      111              
  Lines       12065    12081      +16     
==========================================
+ Hits         9040     9059      +19     
+ Misses       3025     3022       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread cashu/wallet/mint_info.py
for entry in websocket_supported:
if entry["method"] == method.name and entry["unit"] == unit.name:
if "bolt11_mint_quote" in entry["commands"]:
if "mint_quote" in entry["commands"]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a new wallet talks to an old mint that still advertises bolt11_mint_quote, would we skip websockets and fall back to polling?
may be worth accepting both during migration
"mint_quote" in commands or "bolt11_mint_quote" in commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants