feat(invoice-escrow): implement dispute resolution timeout & default … - #274
Open
sadiqolalere41-pro wants to merge 1 commit into
Open
Conversation
…fallback
- Add DisputeData type with raiser, reason, raised_at, resolved fields
- Add EscrowStatus::Disputed variant
- Add dispute_timeout_secs to Config (0 = use default 7 days / 604800s)
- Implement raise_dispute: admin-only, Funded→Disputed transition with event
- Implement resolve_dispute:
- Admin path (within timeout): favour='seller' releases purchase_price to
seller (Settled), favour='buyer' refunds funder (Refunded)
- Default fallback (timeout elapsed): anyone may call; always refunds buyer
- Both paths unlock invoice token transfers and emit dispute_resolved event
- Implement set_dispute_timeout: admin-only timeout override (0 = reset default)
- Add get_dispute_data view
- Add error variants: AlreadyDisputed, NotDisputed, DisputeNotExpired,
DisputeAlreadyResolved, InvalidDisputeFavour
- Add dispute_raised and dispute_resolved event publishers
- Add DisputeData to storage layer
- Fix record_payment distributor path: send amount + investor_amount + platform_fee
to distributor so it can pay seller, investor, and admin correctly
- Fix payment-distributor tests: update create_escrow (9-arg) and fund_escrow
(3-arg) calls to match updated invoice-escrow API
- Add 19 unit tests covering raise/resolve happy paths, error paths, timeout
fallback, event emission, and auth enforcement
Closes StellarState#77
|
@sadiqolalere41-pro 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! 🚀 |
Contributor
|
Hi @sadiqolalere41-pro, please rebase your branch on dev to clear line conflicts in |
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.
…fallback
Closes #77
Description
Closes #
Type of Change
Checklist
Testing
How to Test
Test Coverage
Additional Notes
For Reviewers