feat(escrow): implement raise_dispute with event emission and timelin…#57
Merged
Merged
Conversation
|
@BernardOnuh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #16 — Escrow Contract: Dispute Initiation Flow
Summary
Implements the
raise_disputefunction in the Soroban escrow contract, fulfilling all requirements outlined in Issue #5 / #16. This function provides a formal, secure, and auditable way for either party to initiate the arbitration phase.Changes
contracts/escrow/src/lib.rsDisputeRaisedEventstruct (annotated with#[contracttype]) carrying Job ID, initiator address, milestone progress, and timestampraise_dispute(env, job_id, caller)function with the following behaviour:env.require_auth()Activestate before allowing disputeexpires_atto prevent abuse on drastically expired jobsDisputed, immediately lockingrelease_fundsandrelease_milestoneDisputeRaisedon-chain event under the("escrow", "DisputeRaised")topic for the backend/AI Judge to consumeTests Added
test_raise_dispute_by_client_locks_fundstest_raise_dispute_by_freelancer_locks_fundstest_raise_dispute_by_third_party_panicstest_raise_dispute_on_completed_job_panicstest_raise_dispute_blocks_release_fundstest_raise_dispute_then_resolveAll existing tests continue to pass.
Notes
open_disputeis retained for backward compatibility.raise_disputeis the new canonical function satisfying the issue requirements (auth, event emission, deadline enforcement).expires_atis configurable if the team prefers a different window.DisputeRaisedevent is structured for easy consumption by the backend event listener that spins up the AI Agent Judge.