fix(mint): return null expiry for no-expiry Bolt12 quotes#2199
Conversation
|
@cdk-bot review |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2199 +/- ##
==========================================
+ Coverage 72.95% 72.98% +0.03%
==========================================
Files 359 359
Lines 79276 79325 +49
==========================================
+ Hits 57834 57897 +63
+ Misses 21442 21428 -14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
j-kon
left a comment
There was a problem hiding this comment.
I reviewed the change and it looks good to me.
The fix maps the internal 0 expiry sentinel back to None in both Bolt12 response conversion paths, which matches the expected no-expiry behavior and the on-chain quote convention.
The regression tests also cover the main cases well: direct Bolt12 zero-expiry, direct Bolt12 non-zero expiry, and the generic Bolt12 response path for zero-expiry.
One small optional note: Codecov is showing one changed line missing coverage, which may be the generic Bolt12 response path for non-zero expiry. If needed, adding a small check for MintQuoteResponse::Bolt12 preserving a non-zero expiry would likely cover that too.
Nice fix overall.
5df1a22 to
b9380ac
Compare
Map the internal 0 expiry sentinel back to None when converting Bolt12 mint quotes to API responses, matching the onchain conversion behavior. Add regression coverage for direct and generic Bolt12 quote response paths.
b9380ac to
18d3003
Compare
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin v0.17.x
git worktree add -d .worktree/backport-2199-to-v0.17.x origin/v0.17.x
cd .worktree/backport-2199-to-v0.17.x
git switch --create backport-2199-to-v0.17.x
git cherry-pick -x 18d300326a6d8bd9fba1586a2c688cb7934df0e0 |
Map the internal 0 expiry sentinel back to None when converting Bolt12 mint quotes to API responses, matching the onchain conversion behavior.
Add regression coverage for direct and generic Bolt12 quote response paths.
fixes: #2195
Description
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just quick-checkbefore committingcrates/cdk-ffi)