Skip to content

test: add regression tests for #471 #472 #473 #477 - #733

Merged
chonilius merged 2 commits into
MergeFi:mainfrom
Alheriii:test/regression-471-472-473-477
Oct 18, 2026
Merged

chonilius merged 2 commits into
MergeFi:mainfrom
Alheriii:test/regression-471-472-473-477

Conversation

@Alheriii

Copy link
Copy Markdown
Contributor

Summary

Adds the four missing regression tests identified in #471, #472, #473, and #477 — all guards were already implemented by prior PRs but never accompanied by a test.

contracts/maintenance-pool/src/test.rs — #472 (closed #308)

  • test_initialize_rejects_treasury_equal_to_contract_address — passes the contract's own address as treasury; asserts InvalidTreasury is returned.

contracts/milestones/src/test.rs — #471 (closed #307) and #477 (closed #340)

  • test_initialize_rejects_treasury_equal_to_contract_address — same guard, same shape as the maintenance-pool test.
  • test_initialize_accepts_fee_bps_at_boundary_10000 — passes fee_bps = 10_000 (inclusive upper bound); asserts it is accepted and stored. Mirrors test_initialize_accepts_fee_bps_at_boundary_10000 already present in escrow.

contracts/escrow/src/test.rs — #473 (closed #347)

  • test_existing_sponsor_can_top_up_when_at_max_sponsors_cap — fills the escrow to exactly MAX_SPONSORS distinct contributors, then has the original funder (an existing sponsor) call contribute again; asserts the call succeeds, the total_funded increases by the contributed amount, and contributor_count does not grow past the cap.

All three test files follow the patterns of the surrounding tests exactly (same setup helpers, same mock/auth approach).

Closes #471
Closes #472
Closes #473
Closes #477

…rgeFi#477

All four issues identified missing test coverage for guards that were
implemented by earlier PRs but never accompanied by a test.

MergeFi#472 / maintenance-pool
- test_initialize_rejects_treasury_equal_to_contract_address:
  passes the contract's own address as treasury; asserts InvalidTreasury.

MergeFi#471 / milestones
- test_initialize_rejects_treasury_equal_to_contract_address:
  same guard, same shape.

MergeFi#477 / milestones
- test_initialize_accepts_fee_bps_at_boundary_10000:
  passes fee_bps = 10_000 (the inclusive upper bound); asserts it is
  accepted and stored.  Mirrors the equivalent test already present in
  escrow (test_initialize_accepts_fee_bps_at_boundary_10000).

MergeFi#473 / escrow
- test_existing_sponsor_can_top_up_when_at_max_sponsors_cap:
  fills the escrow to exactly MAX_SPONSORS distinct contributors, then
  has the original funder (an existing sponsor) call contribute again;
  asserts the call succeeds, the contributed amount increases, and the
  contributor_count does not grow past the cap.
@Alheriii
Alheriii requested a review from chonilius as a code owner October 18, 2026 13:50
@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

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

@chonilius
chonilius merged commit 21afea4 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