Skip to content

Add unit tests for the escrow deposit cap rejecting investments that would cause total committed to exceed the invoice face value #314

Description

@Chucks1093

Summary

The escrow should never accept deposits beyond the invoice face value. Unit tests should confirm that a deposit which would push the total above the face value is rejected, while a deposit that fits exactly within the remaining capacity succeeds.

Scope

  • Test a deposit that fills the escrow to exactly the face value succeeds
  • Test a deposit of 1 stroop above the remaining capacity panics with capacity_exceeded
  • Test two concurrent deposits that together exceed capacity — only one should succeed
  • Assert total committed never exceeds face value after any sequence of deposits
  • Assert escrow state unchanged after a capacity-exceeded panic

Acceptance Criteria

  • Deposit filling to exact face value succeeds
  • Deposit exceeding remaining capacity panics with capacity_exceeded
  • Total committed never exceeds face value
  • Escrow state unchanged after panic

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions