Repository navigation
feat: add multi-milestone support with comprehensive unit and integration tests - #26
Merged
Merged
Conversation
Pin ed25519-dalek to v2.2.0 to resolve compatibility issue with soroban-env-host test utilities (rand_core CryptoRng trait mismatch).
…emove unused stellar-strkey dev-dependency
…el release tracking Adds a boolean 'released' field to track whether a specific milestone's funds have been released, enabling partial release per milestone.
Adds emit_milestone_submitted and emit_milestone_released event functions to track milestone lifecycle transitions.
…milestone support Adds two new contract functions: - submit_milestone: Allows freelancers to submit completed milestones - release_milestone: Allows clients to release funds for individual approved milestones, enabling partial release per milestone. Also fixes borrow checker issues by cloning amounts before mutable escrow borrows in fund_escrow, refund, claim_timeout, and resolve_dispute functions.
Exports the contract module publicly to allow integration tests to access the generated EscrowContractClient type.
Tests cover: valid creation, zero amount rejection, negative amount rejection, self-escrow rejection (client == freelancer), sequential ID generation, duplicate escrow handling, initial state verification, fee defaults, and total released/refunded defaults.
Tests cover: successful funding, funding non-existent escrow, funding with wrong client, funding already-funded escrow, funding already-released escrow, funding already-refunded escrow, funding already-cancelled escrow, funded_at timestamp, and preservation of escrow details after funding.
…fund Release tests: success, not funded, wrong client, already released, already refunded, released_at timestamp, total_released tracking. Refund tests: success, not funded, wrong client, already refunded, already released, refunded_at timestamp, total_refunded tracking.
…ycle and milestones Tests cover: full create-fund-release lifecycle, create-fund-refund lifecycle, dispute resolution, escrow cancellation, milestone lifecycle (approve/reject), milestone submit and release, submit authorization, release authorization, release-not-approved, release-already-released, milestone-not-found, history tracking, modify before funding, paused contract blocking, multi-milestone lifecycle, amount mismatch, and description/amount count mismatch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Multi-Milestone Support (Issue Add multi-milestone support #9)
Unit Tests (Issues Write unit tests for create_escrow #6, Write unit tests for fund_escrow #7, Write unit tests for release and refund #8)
closes #6
closes #7
closes #8
closes #9