Skip to content

Settlement service, escrow tx logging, publish validation, payment idempotency tests - #59

Merged
Chucks1093 merged 2 commits into
StellarState:mainfrom
0xDeon:feat/settlement-escrow-logs-validation-idempotency
Jul 27, 2026
Merged

Settlement service, escrow tx logging, publish validation, payment idempotency tests#59
Chucks1093 merged 2 commits into
StellarState:mainfrom
0xDeon:feat/settlement-escrow-logs-validation-idempotency

Conversation

@0xDeon

@0xDeon 0xDeon commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add SettlementService that distributes proceeds pro-rata to confirmed investors and transitions invoices to SETTLED, plus a POST /api/v1/settlements/:invoiceId endpoint and an integration test covering multi-investor settlement.
  • Add structured debug/info/warn logging around Soroban escrow funding submission (contract_id, function_name, invoice_id, tx_hash, ledger) with no amounts or wallet addresses logged.
  • Add validateInvoiceForPublish helper and wire it into InvoiceService.publishInvoice, with unit tests covering all field combinations.
  • Add unit tests asserting VerifyPaymentService dedupes by Stellar transaction hash before any database write.

Closes #43
Closes #42
Closes #41
Closes #40

Test plan

  • npm test — 22 suites / 162 tests passing
  • npm run lint — clean
  • npm run build — clean

0xDeon added 2 commits July 27, 2026 12:36
…ent idempotency tests

- Add SettlementService that distributes proceeds pro-rata to confirmed
  investors and transitions invoices to SETTLED, plus a POST
  /api/v1/settlements/:invoiceId endpoint and integration test (StellarState#43)
- Add structured debug/info/warn logging around Soroban escrow funding
  submission with contract_id, function_name, invoice_id, tx_hash and
  ledger, never amounts or wallet addresses (StellarState#42)
- Add validateInvoiceForPublish helper and wire it into
  InvoiceService.publishInvoice, with unit tests covering all field
  combinations (StellarState#41)
- Add unit tests asserting VerifyPaymentService dedupes by Stellar
  transaction hash before any database write (StellarState#40)
@0xDeon
0xDeon force-pushed the feat/settlement-escrow-logs-validation-idempotency branch from b0e9a64 to 0e46ac6 Compare July 27, 2026 11:48
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@0xDeon Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit db702a0 into StellarState:main Jul 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment