Skip to content

fix(pool): refund co-funding investors when target is not reached - #1615

Merged
sanmipaul merged 1 commit into
astera-hq:mainfrom
Peaostrel:fix/904-refund-unfilled-co-funding-rounds
Oct 22, 2026
Merged

sanmipaul merged 1 commit into
astera-hq:mainfrom
Peaostrel:fix/904-refund-unfilled-co-funding-rounds

Conversation

@Peaostrel

Copy link
Copy Markdown
Contributor

Summary

  • Fixed finalize_co_funding so underfunded rounds expire and refund investors after the deadline, regardless of min_commitment.
  • Preserved exact committed-amount refunds to investors' available balances.
  • Ensured failed rounds cannot transfer capital to the SME or create a FundedInvoice.
  • Added regression tests for:
    • A round that exceeds the minimum commitment but misses its principal target.
    • A partially funded round with the default zero minimum.
  • Verified in test assertions that investor balances and pool accounting are restored, co-funding positions are cleared, and repeat finalization is rejected.

Testing

  • Added regression tests in contracts/pool/tests/co_funding_tests.rs.
  • Verified the changes against the current upstream main.
  • Full Cargo tests and GitHub CI are pending.

Closes #904

@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

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

@sanmipaul
sanmipaul merged commit 60cfda6 into astera-hq:main Oct 22, 2026
1 check 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.

fix: finalize_co_funding may not refund investors when a round fails to fill

2 participants