Skip to content

Add unit tests for the escrow refund function returning deposits to all investors when funding deadline is missed #317

Description

@Chucks1093

Summary

If an invoice's funding deadline passes without reaching the target, all investors should be refunded their full deposit amount. Unit tests should confirm each investor receives exactly their deposited amount back and the escrow is marked as refunded.

Scope

  • Test a single investor refund returns the exact deposited amount
  • Test three investors each receive their individual deposit amounts (not a pro-rata split)
  • Test calling refund before the deadline panics with deadline_not_passed
  • Test calling refund after already refunding panics with escrow_already_refunded
  • Assert escrow status is refunded after successful refund

Acceptance Criteria

  • Each investor receives exactly their deposited amount
  • Refund before deadline panics with deadline_not_passed
  • Double refund panics with escrow_already_refunded
  • Escrow status refunded after successful call
  • No XLM lost — total refunded equals total deposited

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions