Skip to content

test(integration): accept nutshell's post-#1008 p2pk witness error - #993

Merged
robwoodgate merged 1 commit into
cashubtc:mainfrom
KvngMikey:fix/widen-p2pk-witness-assertions
Aug 24, 2026
Merged

test(integration): accept nutshell's post-#1008 p2pk witness error#993
robwoodgate merged 1 commit into
cashubtc:mainfrom
KvngMikey:fix/widen-p2pk-witness-assertions

Conversation

@KvngMikey

@KvngMikey KvngMikey commented Aug 24, 2026

Copy link
Copy Markdown
Member

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.3 and fail against a mint built from current nutshell main. 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.

…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
Copilot AI lite review requested due to automatic review settings August 24, 2026 12:14
@github-project-automation github-project-automation Bot moved this to Backlog in cashu-ts Aug 24, 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

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.code set for the “send and receive p2pk” failure case to include 11000 in 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

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.95%. Comparing base (d094499) to head (9f881f1).
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
integration 37.29% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robwoodgate robwoodgate left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK, thank you @KvngMikey !

@robwoodgate
robwoodgate merged commit 67c82e4 into cashubtc:main Aug 24, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in cashu-ts Aug 24, 2026
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.

Integration tests pin nutshell's pre-#1008 p2pk witness error code and message

3 participants