Skip to content

[CT-03] Implement Escrow Release Validator with dispute window check in Rust #1020

@devwums

Description

@devwums

Problem

The payment_escrow contract has no explicit, independently-testable release validation function. Release logic is entangled with other contract state, making it impossible to unit test in isolation.

Proposed Solution

Create contracts/cntr/escrow_release.rs implementing pub fn validate_escrow_release(booking_status: &str, dispute_window_expired: bool) -> Result<(), &'static str>. Returns Ok(()) only when booking_status == "COMPLETED" AND dispute_window_expired == true. All implementation must live inside contracts/cntr/.

Acceptance Criteria

  • File at contracts/cntr/escrow_release.rs
  • Returns Err("Booking not completed") when status is not "COMPLETED"
  • Returns Err("Dispute window still active") when dispute_window_expired is false
  • Returns Ok(()) only when both conditions are met
  • At least 5 unit tests covering all branches and combined conditions
  • Compiles with cargo test

Metadata

Metadata

Assignees

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