Skip to content

test: add experimental controllable mint package - #333

Draft
Egge21M wants to merge 2 commits into
masterfrom
feat/experimental-test-mint
Draft

test: add experimental controllable mint package#333
Egge21M wants to merge 2 commits into
masterfrom
feat/experimental-test-mint

Conversation

@Egge21M

@Egge21M Egge21M commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

This pull request adds an experimental, repository-local test mint package that runs a real CDK mint while keeping BOLT11 payment settlement under test control.

Problem

Coco's mocked unit tests provide control but not protocol realism, while the current fake-wallet integration setup automatically settles payments and cannot hold or advance individual payments from the test. That leaves state transitions such as a pending melt difficult to exercise deterministically without real money.

Summary

  • add the private @cashu/coco-test-mint package, explicitly marked experimental and outside compatibility guarantees
  • run pinned CDK v0.17.0-rc.0 mintd with a controllable in-memory gRPC payment processor
  • support amountful BOLT11 invoices, controlled incoming settlement, pending outgoing payments, successful outgoing completion, and state snapshots
  • verify the boundary with a Coco smoke flow that mints 100 sats, melts 20 sats plus a deterministic 1-sat fee, and confirms a 79-sat balance
  • defer HTTP/WebSocket fault injection, payment failures, binary caching, and remote control until the minimal interface has proven useful

Compatibility risk is limited because the package is private, versioned 0.0.0, and documented as experimental. It downloads a checksum-verified Linux x64/arm64 CDK binary at runtime and requires network access.

Verification

  • bun run test-mint:smoke
  • bun run build
  • bun run typecheck
  • bunx prettier --check package.json packages/test-mint
  • git diff --check

Changeset

  • No changeset: the new package is private and experimental.

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 27a6d92

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.52%. Comparing base (37bb9cf) to head (27a6d92).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #333   +/-   ##
=======================================
  Coverage   88.51%   88.52%           
=======================================
  Files         133      133           
  Lines       18415    18415           
=======================================
+ Hits        16300    16301    +1     
+ Misses       2115     2114    -1     
Flag Coverage Δ
core-integration 52.32% <ø> (ø)
core-unit 92.61% <ø> (+<0.01%) ⬆️

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant