Skip to content

Feature/156 payment distributor tx tests - #246

Merged
Chucks1093 merged 2 commits into
StellarState:devfrom
Yormee-103:feature/156-payment-distributor-tx-tests
Aug 26, 2026
Merged

Feature/156 payment distributor tx tests#246
Chucks1093 merged 2 commits into
StellarState:devfrom
Yormee-103:feature/156-payment-distributor-tx-tests

Conversation

@Yormee-103

Copy link
Copy Markdown
Contributor

closes #156
closes #157
closes #159
closes #154

Description

Closes #

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Code refactoring
  • ✅ Test addition or update
  • 🔧 Configuration change

Checklist

  • All GitHub Actions workflows are green on this PR (required for merge)
  • Commit messages follow Conventional Commits (feat:, fix:, chore:, etc.) — enforced by CI
  • No secrets, API keys, .env, or credentials committed (see CONTRIBUTING.md)
  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

How to Test

  1. Step one
  2. Step two
  3. Step three

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated (if applicable)
  • Manual testing completed

Screenshots (if applicable)

Additional Notes

For Reviewers

  • Code quality and readability
  • Test coverage
  • Security implications
  • Performance impact
  • Breaking changes

Yormee-103 and others added 2 commits August 25, 2026 21:38
The baseInvoice() fixture in the IPFS retry-exhaustion integration test
predates the rejectionReason column added to the Invoice model, so it
failed tsc's structural check on the `as Invoice` cast (TS2352) and
blocked type-check (and therefore the pre-commit hook and CI) for the
whole repo, not just this file. Adds rejectionReason: null to match the
model's `string | null` field.
…ayoutsTx

Closes StellarState#156

This issue's real dependency (StellarState#134, the full PaymentDistributorContractService)
hasn't landed in this repo yet, so this adds a minimal service covering
exactly what StellarState#156 asks for -- buildDistributePayoutsTx -- mirroring
InvoiceEscrowContractService's constructor/dependency-injection shape so
a fuller implementation can be layered on later without a breaking
change to this surface.

buildDistributePayoutsTx(invoiceId, recipients, platformFeeAccount, feeBps)
encodes a single distribute_payouts contract call fanning a settlement's
proceeds out to every recipient (sellers, investors) plus the platform
fee account: invoiceId as a symbol, recipient addresses/amounts as
parallel Vec<Address>/Vec<i128> arguments, the fee account as an
Address, and feeBps as a u32. Validates recipients is non-empty and
feeBps is an integer in [0, 10000] before encoding.

Unit tests assert: the operation invokes exactly the configured
PAYMENT_DISTRIBUTOR_CONTRACT_ID, the function name is
"distribute_payouts", a multi-recipient fan-out serializes addresses
and amounts in matching positional order, feeBps round-trips exactly
across its valid range and is rejected outside [0, 10000], and invalid
recipient/fee-account addresses throw.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Yormee-103 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 89a4ad6 into StellarState:dev Aug 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment