Skip to content

feat: add regression tests and fix sweep self-transfer in maintenance-pool - #727

Merged
chonilius merged 2 commits into
MergeFi:mainfrom
anuoluwaponiorimi:feat/maintenance-pool-regression-tests-481
Oct 18, 2026
Merged

chonilius merged 2 commits into
MergeFi:mainfrom
anuoluwaponiorimi:feat/maintenance-pool-regression-tests-481

Conversation

@anuoluwaponiorimi

Copy link
Copy Markdown
Contributor

Fixes and adds regression coverage for four reported gaps in maintenance-pool.

#481 — sweep accepts the contract's own address as recipient (regression on #329)
Added a guard at the top of sweep that returns Error::InvalidTreasury when recipient == env.current_contract_address(), mirroring the identical guard already present in initialize. Added test_sweep_rejects_contract_as_recipient.

#467 — set_admin has no test (regression on #249)
Added three tests: test_set_admin_rotates_admin (happy path), test_set_admin_rejects_non_admin_caller, and test_set_admin_requires_new_admin_auth.

#482 — withdraw accepts zero/negative amount (regression on #44)
Added test_withdraw_rejects_zero_amount and test_withdraw_rejects_negative_amount; both assert Error::InvalidAmount.

#478 — initialize accepting treasury == contract address (regression on #341)
Added test_initialize_rejects_treasury_as_contract_address and test_initialize_rejects_max_fee_bps.

Closes #481
Closes #467
Closes #482
Closes #478

@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@anuoluwaponiorimi 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! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

@anuoluwaponiorimi is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@chonilius
chonilius merged commit 397bd5a into MergeFi:main Oct 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment