Skip to content

fix(mock): carry the requested amount in the invoice prefix (0.3.2) - #64

Merged
tcheeric merged 1 commit into
developfrom
fix/mock-invoice-amount
Sep 26, 2026
Merged

tcheeric merged 1 commit into
developfrom
fix/mock-invoice-amount

Conversation

@tcheeric

Copy link
Copy Markdown
Collaborator

Summary

MockLnServer built every invoice with the fixed prefix lnbc10n (1 sat), whatever amountSat was requested. imani-gateway-core#92 now reads the price off the mint's invoice and requires it to match the sale, so every staging client mint was refused. Found while investigating cashu-mint#494.

  • The prefix is lnbc{amountSat * 10}n, the nano-BTC form of the requested amount.
  • amountSat <= 0 gives an amountless invoice.
  • Release 0.3.2.

Testing

  • New tests: an invoice created for 500 sat starts with lnbc5000n1; unit cases for 1, 100, 0 and negative amounts.
  • mvn -q verify -pl '!phoenixd-test': exit 0.
  • phoenixd-test fails 7 tests with BindException on port 9740 on unmodified develop too, because a local cashu-mint-phoenixd-mock-1 container holds the port. The failures are environmental and unrelated to this change.

GitHub Actions cannot start jobs on this account (billing hold).

Every mock invoice began lnbc10n (1 sat) whatever amountSat asked for,
so imani-gateway-core's check that a client mint's invoice charges the
sale price (imani-gateway-core#92) refused every staging client mint.
The prefix is now lnbc{sats*10}n. Release 0.3.2.
@tcheeric
tcheeric merged commit 0d04343 into develop Sep 26, 2026
3 of 5 checks passed
@tcheeric
tcheeric deleted the fix/mock-invoice-amount branch September 26, 2026 16:11
@github-actions

Copy link
Copy Markdown

Qodana Community for JVM

5 new problems were found

Inspection name Severity Problems
Constant values 🔶 Warning 3
AutoCloseable used without 'try'-with-resources 🔶 Warning 1
Simplifiable conditional expression 🔶 Warning 1

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant