Skip to content

[Docs] Fix get_escrow comment vs return type mismatch #21

@Jayrodri088

Description

@Jayrodri088

Complexity / points: Trivial (100 points) - maintainer label: points-100-trivial

PR must include:

  • Closes #21 in the PR description
  • Tests added or updated where behavior changes
  • Docs updated if public API, lifecycle, or deploy steps change
  • No unwrap() in production Soroban contract paths (project convention)
  • cargo test passes locally; match CI (cargo fmt, cargo clippy -D warnings) when touching Rust

Problem

In contracts/invoice-escrow/src/lib.rs, the comment for get_escrow says it returns “escrow data for an invoice, or None if not found.â€^]

But the function signature is:

  • pub fn get_escrow(...) -> Result<EscrowData, Error>
  • and it returns Err(Error::EscrowNotFound) when missing

So the code behavior does not match the documented intent.

Proposed change

Fix the mismatch so documentation and behavior agree.

Acceptance criteria

  • Update the get_escrow rustdoc comment to accurately reflect Result + Error::EscrowNotFound
  • Ensure any related docs (e.g., docs/API.md once created) describe the same behavior
  • Optional: add/adjust a unit test asserting missing invoice_id returns Error::EscrowNotFound

Dependencies

Recommended after or together with [Docs] Add missing docs/API.md... so the new API doc and rustdoc stay consistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions