Skip to content

feat(mint): implement Mint Quote Lookup by Public Key#977

Open
a1denvalu3 wants to merge 1 commit into
mainfrom
feat/quote-lookup-by-pubkey
Open

feat(mint): implement Mint Quote Lookup by Public Key#977
a1denvalu3 wants to merge 1 commit into
mainfrom
feat/quote-lookup-by-pubkey

Conversation

@a1denvalu3
Copy link
Copy Markdown
Collaborator

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 81.39535% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.23%. Comparing base (f32a6ce) to head (d8e9bbd).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cashu/mint/router.py 33.33% 6 Missing ⚠️
cashu/mint/ledger.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #977      +/-   ##
==========================================
+ Coverage   75.14%   75.23%   +0.08%     
==========================================
  Files          99       99              
  Lines       11714    11757      +43     
==========================================
+ Hits         8803     8845      +42     
- Misses       2911     2912       +1     

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

@a1denvalu3 a1denvalu3 force-pushed the feat/quote-lookup-by-pubkey branch 4 times, most recently from 6596c77 to 91fe53e Compare April 9, 2026 08:38
@a1denvalu3 a1denvalu3 force-pushed the feat/quote-lookup-by-pubkey branch from 91fe53e to d8e9bbd Compare April 9, 2026 10:14
@a1denvalu3 a1denvalu3 changed the title feat(mint): implement NUT-29 Mint Quote Lookup by Public Key feat(mint): implement Mint Quote Lookup by Public Key Apr 9, 2026
@b-l-u-e
Copy link
Copy Markdown
Contributor

b-l-u-e commented May 21, 2026

i feel like the commit msg is misleading: d8e9bbd
since NUT 29 is batched minting

Comment thread cashu/mint/ledger.py
if not verify_schnorr_signature(
bytes.fromhex(pubkey), pk, bytes.fromhex(signature)
):
raise Exception(f"invalid signature for pubkey {pubkey}")
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.

Invalid signature should raise QuoteSignatureInvalidError or a dedicated lookup error with code not Exception i think

Comment thread cashu/mint/ledger.py
Comment on lines +439 to +440
if len(pubkeys) != len(pubkey_signatures):
raise Exception("pubkeys and pubkey_signatures must have the same length")
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.

Length mismatch raises generic Exception maybe use CashuError

f"{BASE_URL}/v1/mint/quote/bolt11/pubkey",
json={"pubkeys": [pubkey], "pubkey_signatures": [bad_signature]},
)
assert response.status_code == 400 or response.status_code == 500
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.

i think assert should be exactl 400, not 400 or 500.

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