Context
This issue was raised during review of PR #708 (Add read and read-write dispute solver permissions) in comment #708 (comment), requested by @grunch.
Problem
PR #708 introduced write-permission enforcement in admin_settle_action (src/app/admin_settle.rs, lines 53–54) and admin_cancel_action (src/app/admin_cancel.rs, lines 76–77) via solver_has_write_permission. The only test currently covering this path is a structural check that verifies CantDoReason::NotAuthorized exists as an enum variant; it does not exercise the authorization boundary end-to-end.
Goal
Add behavioral tests that:
- Call
admin_settle_action with a read-only solver fixture and assert the handler returns MostroCantDo(CantDoReason::NotAuthorized).
- Call
admin_settle_action with a read-write solver fixture and assert successful execution (no CantDo error).
- Repeat steps 1–2 for
admin_cancel_action.
These tests require non-trivial fixtures (in-memory SQLite pool seeded with dispute + solver rows, mock LND connector, valid Nostr key pairs), which is why they were deferred from PR #708.
Acceptance Criteria
References
Context
This issue was raised during review of PR #708 (Add read and read-write dispute solver permissions) in comment #708 (comment), requested by @grunch.
Problem
PR #708 introduced write-permission enforcement in
admin_settle_action(src/app/admin_settle.rs, lines 53–54) andadmin_cancel_action(src/app/admin_cancel.rs, lines 76–77) viasolver_has_write_permission. The only test currently covering this path is a structural check that verifiesCantDoReason::NotAuthorizedexists as an enum variant; it does not exercise the authorization boundary end-to-end.Goal
Add behavioral tests that:
admin_settle_actionwith a read-only solver fixture and assert the handler returnsMostroCantDo(CantDoReason::NotAuthorized).admin_settle_actionwith a read-write solver fixture and assert successful execution (noCantDoerror).admin_cancel_action.These tests require non-trivial fixtures (in-memory SQLite pool seeded with dispute + solver rows, mock LND connector, valid Nostr key pairs), which is why they were deferred from PR #708.
Acceptance Criteria
admin_settle_action,admin_cancel_action) that covers the read-only rejection path.cargo testpasses with all new tests included.References
src/app/admin_settle.rs,src/app/admin_cancel.rs,src/db.rs(solver_has_write_permission)