test(integration): accept nutshell's post-#1008 p2pk witness error - #993
Conversation
…error Two integration cases pinned the pre-cashubtc#1008 shape of nutshell's "missing P2PK witness" rejection, so they failed against a mint built from current nutshell main while still passing against cashubtc/nutshell:0.20.3. Nutshell cashubtc#1008 replaced a bare assert in Proof.p2pksigs -- whose AssertionError leaked through the exception handler as code 0 -- with a real TransactionError (11000). That is the mint fixing a leak, so widen both assertions to span the old and new forms rather than swapping one for the other: cashu-ts has to work against released and current mints. "witness could not be parsed." (new in nutshell #1130) is deliberately not accepted. These cases send no witness at all, so reporting a parse failure would be a real regression and should still fail here. Closes cashubtc#991
There was a problem hiding this comment.
Pull request overview
This PR updates integration tests to accept both the pre- and post-#1008 error code/message variants returned by nutshell mints when a P2PK witness is missing, so the client test suite remains compatible across released and current mint versions.
Changes:
- Widen the accepted
MintOperationError.codeset for the “send and receive p2pk” failure case to include11000in addition to legacy values. - Widen the accepted error message regexes for both P2PK missing-witness test cases to match either the old or new nutshell wording.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #993 +/- ##
=======================================
Coverage 95.95% 95.95%
=======================================
Files 56 56
Lines 5984 5984
Branches 1521 1521
=======================================
Hits 5742 5742
Misses 102 102
Partials 140 140
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
robwoodgate
left a comment
There was a problem hiding this comment.
ACK, thank you @KvngMikey !
Closes #991.
Summary
Two integration cases pinned the pre-#1008 shape of nutshell's "missing P2PK witness" rejection. They pass against
cashubtc/nutshell:0.20.3and fail against a mint built from current nutshellmain. cashu-ts is a client library and has to work against both, so the assertions are widened to span old and new and not swapped.Changes
Test-only. Nothing in
src/.Cross-refs: cashubtc/nutshell#1126, cashubtc/nutshell#1130.