Skip to content

[CT-20] Write Escrow Edge Case Test Suite (10+ tests) in Rust #1037

@devwums

Description

@devwums

Problem

Escrow release and refund logic has no test coverage for edge cases. Disputed bookings, boundary cancellation windows, and zero-amount scenarios are entirely untested.

Proposed Solution

Create contracts/cntr/tests/escrow_edge_case_tests.rs. Write at least 10 unit tests covering: normal release after dispute window, release attempt before dispute window closes, refund at exactly 48h boundary, refund at 23h 59m (below 24h), refund at exactly 24h, zero-amount booking refund, 100% refund correct calculation, 50% refund integer division, release blocked because booking not completed, both conditions required for release. All implementation must live inside contracts/cntr/.

Acceptance Criteria

  • File at contracts/cntr/tests/escrow_edge_case_tests.rs
  • At least 10 test functions
  • Tests import escrow_release.rs and escrow_refund.rs peer modules
  • Exact boundary values (24h = 86400 seconds, 48h = 172800 seconds) tested
  • All tests pass with cargo test

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions