feat: wire splitter & dispute modules, harden validation, add real tests#138
Merged
BigBen-7 merged 1 commit intoLead-Studios:mainfrom Mar 29, 2026
Conversation
- Wire splitter.rs and dispute.rs into lib.rs (closes Lead-Studios#92) - Expose create_escrow, release_escrow, refund_escrow, get_escrow, open_dispute, resolve_dispute, get_dispute, create_split, distribute, get_split on VeritixToken in contract.rs (closes Lead-Studios#92) - Add settle_escrow_by_outcome private helper in dispute.rs so resolve_dispute settles escrow without requiring depositor/beneficiary auth; fix broken release_escrow/refund_escrow call signatures (closes Lead-Studios#93) - Harden create_split: reject empty recipient lists, duplicate addresses, zero-share recipients, and non-positive total amounts (closes Lead-Studios#91) - Replace placeholder splitter_test.rs with real Soroban tests covering create, distribute, unauthorized, double-distribute, and all validation rejection cases (closes Lead-Studios#90) - Add dispute_test.rs covering both resolution outcomes and unauthorized resolver attempts (closes Lead-Studios#93)
|
@nottherealalanturing 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! 🚀 |
BigBen-7
approved these changes
Mar 29, 2026
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
Resolves #90, #91, #92, #93 in a single branch.
Changes
lib.rs— Wire modules (closes #92)pub mod disputeandpub mod splitterso both modules compile into the crate.#[cfg(test)] mod dispute_testand#[cfg(test)] mod splitter_test.contract.rs— Expose public entrypoints (closes #92)create_escrow,release_escrow,refund_escrow,get_escrow.open_dispute,resolve_dispute,get_dispute.create_split,distribute,get_split.dispute.rs— Fix resolve_dispute (closes #93)release_escrow(e, escrow_id)/refund_escrow(e, escrow_id)calls (wrong signatures, required depositor/beneficiary auth).settle_escrow_by_outcomehelper that directly mutates the escrow record and moves balances — no depositor/beneficiary auth required, only the designated resolver's auth.resolve_disputenow compiles cleanly against the real escrow API.splitter.rs— Harden validation (closes #91)require_positive_amount, now also guarded before BPS loop).splitter_test.rs— Real Soroban tests (closes #90)Contract,Recipient,calculate_distribution) with real tests usingEnv, registered contracts, and actualsplitter.rstypes.dispute_test.rs— New test file (closes #93)Closes #90
Closes #91
Closes #92
Closes #93