feat: batch swap features — reputation, insurance, arbitration, escrow#567
Open
Sundriveauto wants to merge 4 commits into
Open
feat: batch swap features — reputation, insurance, arbitration, escrow#567Sundriveauto wants to merge 4 commits into
Sundriveauto wants to merge 4 commits into
Conversation
batch_reveal_keys now calls update_reputation(+5) for both seller and buyer on each successfully completed swap, mirroring the single-swap reveal_key behaviour.
- batch_accept_swaps now collects insurance premiums from the buyer and deposits them into the InsurancePool, mirroring accept_swap - Add batch_initiate_swap_with_insurance: batch initiation with insurance_enabled flag; sets premium to 2% of each swap price
Add batch_arbitrate_swaps: resolves multiple Disputed swaps in one call. Arbitrator decides refund (Cancelled) or complete (Completed) uniformly for the batch, handling collateral and protocol fees.
- Add batch_escrow_deposit: buyer deposits into multiple escrow-mode swaps in one call, moving each from Pending to Accepted - Fix batch_initiate_escrow and initiate_swap_with_signers: add missing paid_amount/is_installment fields to SwapRecord construction - Add batch_swap_features_tests module with 9 tests covering: reputation updates, insurance premium collection, batch arbitration (refund and complete), and batch escrow deposit
|
@Sundriveauto 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 #505
Close #506
Close #507
Closes #508
Summary
Implements four batch swap features, each as a separate commit:
1. Reputation for batch swaps
batch_reveal_keysnow callsupdate_reputation(+5)for both seller and buyer on each completed swap, mirroring the single-swapreveal_keypath.2. Insurance for batch swaps
batch_accept_swapsnow collects insurance premiums from the buyer and deposits them into theInsurancePool, mirroringaccept_swap.batch_initiate_swap_with_insurance: batch initiation withinsurance_enabledflag; sets premium to 2% of each swap price.3. Arbitration for batch swaps
batch_arbitrate_swaps: resolves multipleDisputedswaps in one call. Arbitrator decides refund (→ Cancelled) or complete (→ Completed) uniformly for the batch, handling collateral and protocol fees.4. Escrow payments for batch swaps
batch_escrow_deposit: buyer deposits into multiple escrow-mode swaps in one call, moving each fromPendingtoAccepted.batch_initiate_escrowandinitiate_swap_with_signers: added missingpaid_amount/is_installmentfields toSwapRecordconstruction.Tests
New
batch_swap_features_testsmodule with 9 tests covering all four features.