Skip to content

fix: remove state from MintQuoteCustomResponse and update default extra#1915

Open
asmogo wants to merge 1 commit into
cashubtc:mainfrom
asmogo:fix/custom-mint-quote-state-and-extra-parsing
Open

fix: remove state from MintQuoteCustomResponse and update default extra#1915
asmogo wants to merge 1 commit into
cashubtc:mainfrom
asmogo:fix/custom-mint-quote-state-and-extra-parsing

Conversation

@asmogo
Copy link
Copy Markdown
Collaborator

@asmogo asmogo commented Apr 21, 2026

… quote

  • Add #[serde(default)] to MintQuoteCustomResponse::state so mints that omit the field (returning amount_paid/amount_issued instead) deserialize correctly, defaulting to QuoteState::Unpaid instead of failing
  • Replace extra.unwrap_or_default() (empty string) with extra.as_deref().unwrap_or("{}") in wallet/issue and cdk-payment-processor so serde_json::from_str never receives an empty string, which caused an EOF parse error when extra was None

Description


Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

  • I followed the code style guidelines
  • I ran just quick-check before committing
  • If the Wallet API was modified (added/removed/changed), I have reflected those changes in the FFI bindings (crates/cdk-ffi)

@github-project-automation github-project-automation Bot moved this to Backlog in CDK Apr 21, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 81.14035% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.26%. Comparing base (e06f337) to head (798acd2).

Files with missing lines Patch % Lines
crates/cdk-common/src/mint.rs 13.33% 13 Missing ⚠️
crates/cdk/src/wallet/issue/mod.rs 50.00% 13 Missing ⚠️
crates/cdk-common/src/wallet/mod.rs 0.00% 6 Missing ⚠️
crates/cashu/src/nuts/nut04.rs 81.81% 4 Missing ⚠️
crates/cdk-ffi/src/types/quote.rs 0.00% 3 Missing ⚠️
crates/cdk-common/src/mint_quote.rs 98.18% 1 Missing ⚠️
crates/cdk-payment-processor/src/proto/mod.rs 0.00% 1 Missing ⚠️
...rates/cdk/src/wallet/mint_connector/http_client.rs 98.41% 1 Missing ⚠️
crates/cdk/src/wallet/test_utils.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1915      +/-   ##
==========================================
+ Coverage   65.16%   65.26%   +0.09%     
==========================================
  Files         330      330              
  Lines       56742    56923     +181     
==========================================
+ Hits        36976    37148     +172     
- Misses      19766    19775       +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asmogo asmogo changed the title fix(nut04): handle missing state field and empty extra in custom mint… fix: remove state from MintQuoteCustomResponse and update default extra Apr 27, 2026
@asmogo asmogo marked this pull request as ready for review May 4, 2026 15:37
@thesimplekid thesimplekid force-pushed the fix/custom-mint-quote-state-and-extra-parsing branch from 08cdd0c to 798acd2 Compare May 15, 2026 09:10
@thesimplekid
Copy link
Copy Markdown
Collaborator

@asmogo I just squashed and rebased this. Changes LGTM will just let ci finish.

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