Skip to content

[CONTRACTS] Add unit tests for PaymentDistributorContractService.buildDistributePayoutsTx()Β #156

Description

@chizzy192

Metadata

Field Value
Domain Contracts
Difficulty Easy (1–2 Days)
Effort Estimate effort: 3h
Priority P1-High
Labels good first issue, easy, Stellar Wave
Target Branch dev
Depends On #134

🎯 Context & Goal

The PaymentDistributorContractService method buildDistributePayoutsTx() encodes payout fan-out transactions to split settlement proceeds between sellers, investors, and platform fee account.

This issue adds unit tests in tests/unit/services/stellar/payment-distributor-tx.test.ts testing method argument serialization.

πŸ“‚ Target Files

  • tests/unit/services/stellar/payment-distributor-tx.test.ts -> Unit test file
  • src/services/stellar/payment-distributor-contract.service.ts -> Distributor service

πŸ“‹ Implementation Tasks

  • Write unit tests for buildDistributePayoutsTx
  • Assert contract ID matches PAYMENT_DISTRIBUTOR_CONTRACT_ID
  • Test fee basis points (feeBps) serialization

πŸ› οΈ Technical Guidance

Use Jest to verify ScVal arguments.

πŸ”— References & Related

  • Payment distributor contract spec

⏳ Delivery Window

This issue should be completed within 2 day(s) of assignment.

Contribution Workflow

  1. Branch off dev: git checkout -b feature/descriptive-name dev
  2. Implement all tasks in the checklist above.
  3. Run all CI checks locally (see DEVELOPMENT.md).
  4. Open a Pull Request targeting dev.
  5. Link this issue in your PR description: Closes #XX.

βœ… Acceptance Criteria

  • All implementation tasks above are completed.
  • Code compiles/builds without errors.
  • All existing tests continue to pass.
  • New tests are added with >80% coverage of new code.
  • Code follows project style guidelines (formatting, linting).
  • PR targets dev branch (NOT main).
  • PR description references this issue.
  • Documentation is updated if public API changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programeasySmall scope / straightforwardgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions