Skip to content

[Contract] Add comprehensive unit tests for escrow state machine #1

Open

Description

@Gbangbolaoluwagbemiga

Overview

The Soroban contract has no unit tests. Every public function — `create_escrow`, `start_work`, `submit_milestone`, `approve_milestone`, `reject_milestone`, `dispute_milestone`, and all refund paths — needs at least one happy-path and one error-path test.

What needs to be done

  • Set up `soroban_sdk::testutils` environment in `contracts/secureflow/src/tests/`
  • Tests for: `create_escrow`, `start_work`, `submit_milestone`, `approve_milestone`, `reject_milestone`, `dispute_milestone`, `refund_escrow`, `emergency_refund_after_deadline`, `rate_freelancer`
  • Achieve ≥ 80% function coverage
  • `cargo test -p secureflow` passes with zero failures

References

Activity

  1. added
    contractSoroban / Rust smart contract work
    testingTests and coverage
    grant-criticalCompleting this directly unblocks the GrantFox application
    on May 18, 2026
  2. Gbangbolaoluwagbemiga commented on Jun 17, 2026

    @Gbangbolaoluwagbemiga
    ContributorAuthor

    Code review confirms the urgency: the contract currently has 0 #[test] functions despite moving funds. Use the existing .config/nextest.toml (cargo nextest run). Cover the full lifecycle: create, milestone submit/approve/reject/resubmit, disputes, refunds (normal/emergency/overdue), arbiter award & refund, ratings, admin. Top audit/grant blocker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contractSoroban / Rust smart contract workgrant-criticalCompleting this directly unblocks the GrantFox applicationtestingTests and coverage

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions