Skip to content

feat(mint): align NUT-04 with amount_paid/issued + updated_at#1044

Merged
a1denvalu3 merged 6 commits into
cashubtc:mainfrom
a1denvalu3:align-mint-quote-accounting
Jun 26, 2026
Merged

feat(mint): align NUT-04 with amount_paid/issued + updated_at#1044
a1denvalu3 merged 6 commits into
cashubtc:mainfrom
a1denvalu3:align-mint-quote-accounting

Conversation

@a1denvalu3

Copy link
Copy Markdown
Collaborator

This PR aligns the nutshell codebase with the Cashu specification change in cashubtc/nuts PR #377 (Align NUT-04 mint quote accounting with amount_paid / amount_issued).

Changes:

  • Added amount_paid, amount_issued, and updated_at properties to MintQuote (with amount_paid remaining 0 when state is PENDING per requirements).
  • Added amount_paid, amount_issued, and updated_at fields to PostMintQuoteResponse (making them Optional to maintain backward compatibility with older mints).
  • Updated wallet-side parsing in from_resp_wallet to prioritize using amount_paid/amount_issued over state when present, handling monotonic checks (updated_at and non-decreasing amounts) for stale responses.
  • Updated API router on the mint side to return the new fields.
  • Added unit test coverage for the new properties and serialization values.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.15942% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.32%. Comparing base (13ba163) to head (e1ec396).
⚠️ Report is 8 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cashu/core/base.py 77.58% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1044      +/-   ##
==========================================
+ Coverage   74.79%   75.32%   +0.52%     
==========================================
  Files         111      111              
  Lines       12413    12496      +83     
==========================================
+ Hits         9284     9412     +128     
+ Misses       3129     3084      -45     

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

@a1denvalu3 a1denvalu3 force-pushed the align-mint-quote-accounting branch 2 times, most recently from 61e1f1f to 956fd84 Compare June 23, 2026 20:23
@a1denvalu3 a1denvalu3 force-pushed the align-mint-quote-accounting branch from 956fd84 to 67e3282 Compare June 24, 2026 07:59
@a1denvalu3 a1denvalu3 merged commit c7c3d8b into cashubtc:main Jun 26, 2026
28 of 29 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in nutshell Jun 26, 2026
@a1denvalu3 a1denvalu3 deleted the align-mint-quote-accounting branch June 26, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants