feat(admin): Step1 - bond resolution foundation for dispute finalization#76
Conversation
…d slash Prepare admin dispute finalization for anti-abuse bond_resolution payloads (admin-settle / admin-cancel). Bump mostro-core to 0.11.3, add BondSlashChoice wire mapping with unit tests, handle CantDo InvalidPayload, and document the planned UI/execute follow-up. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR introduces anti-abuse bond slash support for admin dispute finalization in Mostrix. It bumps the mostro-core dependency to 0.11.3, adds a new ChangesAnti-abuse bond slash support for admin dispute finalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review! |
🧩 Analysis chain🏁 Script executed: Length of output: 13007 🏁 Script executed: Length of output: 23264
Review
|
| # | Severity | File | Finding |
|---|---|---|---|
| 1 | 🟡 Medium | bond_resolution.rs |
to_optional_payload always returns Some — misleading name |
| 2 | 🟡 Medium | bond_resolution.rs |
Missing Default impl for BondSlashChoice |
| 3 | 🔵 Low | bond_resolution.rs |
to_bond_resolution could be pub(crate) |
| 4 | 🔵 Low | bond_resolution.rs |
Missing doc comments on label, slash_seller, slash_buyer |
| 5 | 🔵 Low | bond_resolution.rs |
No raw-JSON wire assertion for SlashBoth |
| 6 | 🔵 Low | execute_admin_*.rs |
Stale comment // No payload needed |
| 7 | 🔵 Low | FINALIZE_DISPUTES.md |
Use path in doc snippet uses crate name, not crate:: |
✅ Actions performed
Full review triggered.
|
@coderabbitai review! |
|
✅ Actions performedReview triggered.
|
|
I think they are fixed @coderabbitai, please check latest commits |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 11781
Two small items are still outstanding:
// TODO: pass BondSlashChoice::to_optional_payload() once TUI wiring is complete (see FINALIZE_DISPUTES.md)
use mostrix::util::order_utils::BondSlashChoice;Internal callers will write: use crate::util::order_utils::BondSlashChoice;(ᵔᴥᵔ) Almost there! |
|
@coderabbitai look at new commit |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 4715
All 7 findings from this review are resolved. The PR looks great — the protocol layer foundation is solid and well-tested. 🎉 (ᵔᴥᵔ) |
Summary
Prepares Mostrix for anti-abuse bond slash options on admin dispute finalization (
admin-settle/admin-cancel), aligned with Mostro protocol and daemon work in MostroP2P/mostro#738.mostro-core0.11.0 → 0.11.3 (BondResolution,Payload::BondResolution,CantDoReason::InvalidPayload)BondSlashChoice(None,SlashBuyer,SlashSeller,SlashBoth) withto_payload()and wire-format unit testsInvalidPayloadinget_cant_do_descriptionfor admin-facing errorsNot in this PR: wiring
BondSlashChoiceintoexecute_admin_settle/cancel, bond-slash TUI step, orAddBondInvoicepayout handling for traders.Motivation
Admins resolving disputes must be able to settle or cancel the trade and independently choose whether to slash buyer/seller/both/none anti-abuse bonds. This PR lands the dependency bump and shared protocol helper so follow-up PRs can focus on execute + UI.
Test plan
cargo fmt --allcargo clippy --all-targets --all-features -- -D warningscargo test(includes 6 new tests inbond_resolution.rs)payload: null)Follow-up
BondSlashChoicethroughexecute_finalize_dispute/execute_admin_*bond_enabledfrom kind-38385 instance infoAction::AddBondInvoice/BondPayoutRequestfor non-admin payout recipientsSummary by CodeRabbit
New Features
Documentation
Chores