Implements Escrow contract closure finalization with immutable close records and summary metadata.
-
contracts/escrow/src/lib.rsEscrowContractnow includes:finalized_at: Option<u64>finalized_by: Option<Address>close_summary: Option<Symbol>
- Added
finalize_contractmethod with:- status precondition (Completed | Disputed)
- one-time finalization guard (immutable once performed)
- participant authorization guard (client/freelancer/arbiter)
- Added read helpers:
is_finalizedget_close_summaryget_finalizer
-
contracts/escrow/src/test.rs- Added tests:
test_finalize_contract_success_and_immutabletest_finalize_contract_already_finalizedtest_finalize_contract_not_readytest_finalize_contract_unauthorized
- Added tests:
-
README.mdanddocs/escrow/status-transition-guardrails.md- Documented finalization workflow and guardrails
- Finalization allowed only after final applicant status; prevents premature closure.
- Finalization is immutable after the first call.
- Caller must be a known contract participant.
Run:
cargo testResult: 27 passed, 0 failed.
Proof of successful build/tests
To attach proof, run the test command locally and capture terminal output screenshot or log file, then add it here:
cargo test -- --nocapture(if needed)- Save screenshot or copy output to file
- Attach the file via GitHub PR UI (choose image or link)
- Review API naming and usability (e.g., contract ID usage as symbolic key currently simplified).
- Merge; pipeline should run fmt/build/test automatically.
