Skip to content

feat: add self-service leave_pool for non-admin members#162

Merged
Sendi0011 merged 1 commit into
JointSave-org:mainfrom
davieslennox0:feat/self-service-leave-pool
Jun 29, 2026
Merged

feat: add self-service leave_pool for non-admin members#162
Sendi0011 merged 1 commit into
JointSave-org:mainfrom
davieslennox0:feat/self-service-leave-pool

Conversation

@davieslennox0

@davieslennox0 davieslennox0 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

- 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>
@Sendi0011

Copy link
Copy Markdown
Contributor

Gm @davieslennox0 can you please update the pr description to match the template provided

@Sendi0011 Sendi0011 self-requested a review June 29, 2026 00:51
@Sendi0011 Sendi0011 merged commit 19c574a into JointSave-org:main Jun 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add self-service "leave pool" function for non-admin members

2 participants