feat: add self-service leave_pool for non-admin members#162
Merged
Sendi0011 merged 1 commit intoJun 29, 2026
Merged
Conversation
- Rotational: extract shared remove logic into helper, add leave_pool with beneficiary guard - Flexible: add leave_pool with balance refund - Target: add leave_pool blocked after unlock - Frontend: useLeavePool hook + Leave Pool button with confirmation dialog (non-admin only) - Unit tests for all three pool types Closes JointSave-org#140 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Gm @davieslennox0 can you please update the pr description to match the template provided |
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.
Description
Adds a self-service leave_pool function to all three pool contract types so non-admin members can exit a pool without requiring admin involvement.
Closes #140
Type of Change
feat: new feature
fix: bug fix
chore: maintenance, tooling, dependencies
docs: documentation only
refactor: code restructuring (no functional changes)
test: adding or updating tests
How Has This Been Tested?
cargo test passes (smart contracts)
pnpm build succeeds (frontend)
pnpm lint passes (frontend)
Manual testing (describe below)
Smart contract tests: 16 new tests added across all three pool types (38 rotational, 26 flexible, 22 target — all green).
Coverage includes: success case, balance refund (flexible/target), paused pool blocked, below-minimum members blocked, beneficiary guard (rotational), post-unlock blocked (target).
Frontend: Leave Pool button renders only for non-admin members. Confirmation dialog is pool-type-aware (warns about round position loss for rotational, refund for target, balance return for flexible).
Checklist
My code follows the coding conventions of this project
I have added/updated tests if needed
I have updated documentation if needed
My changes generate no new warnings or errors