Skip to content

feat(mint): add method field to quote responses.#1055

Open
KvngMikey wants to merge 2 commits into
cashubtc:mainfrom
KvngMikey:add_method_to_quotes
Open

feat(mint): add method field to quote responses.#1055
KvngMikey wants to merge 2 commits into
cashubtc:mainfrom
KvngMikey:add_method_to_quotes

Conversation

@KvngMikey

Copy link
Copy Markdown
Collaborator

This PR aligns the nutshell codebase with the specification change in cashubtc/nuts#387 (add a method field to all quote responses).

Changes:

  • Added method property to MintQuoteResponse & MeltQuoteResponse making it Optional and None by default to maintain backward compatibility when wallet-side code parses responses from older mints that don't yet send.
  • Populated the method in all manual constructors in the router.py and ledger.py.
  • Updated mock stubs in test_mint_app_router.py test file to include method.

Copilot AI review requested due to automatic review settings June 17, 2026 13:12
@github-project-automation github-project-automation Bot moved this to Backlog in nutshell Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a method field (e.g., bolt11) to mint/melt quote responses to expose the payment method through the API while maintaining backward compatibility.

Changes:

  • Extend PostMintQuoteResponse and PostMeltQuoteResponse models with an optional method field.
  • Populate method in mint/melt quote responses in the mint router and ledger.
  • Update router tests/mocks to include method="bolt11".

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/mint/test_mint_app_router.py Updates mocked quote responses to include the new method field.
cashu/wallet/v1_api.py Ensures the melt-quote “include fields” payload includes a method key.
cashu/mint/router.py Exposes method in mint/melt quote API responses.
cashu/mint/ledger.py Propagates method when constructing melt quote responses.
cashu/core/models/mint_quote.py Adds optional method to the mint quote response model.
cashu/core/models/melt_quote.py Adds optional method to the melt quote response model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cashu/core/models/melt_quote.py Outdated
Comment thread cashu/wallet/v1_api.py
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.11%. Comparing base (71df49b) to head (f088a84).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1055      +/-   ##
==========================================
- Coverage   75.15%   75.11%   -0.04%     
==========================================
  Files         111      111              
  Lines       12372    12374       +2     
==========================================
- Hits         9298     9295       -3     
- Misses       3074     3079       +5     

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

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