Skip to content

test: add coverage for carbon credits, funding round, bridge, cap, governance, archive (Closes #318, #319, #320, #321, #326, #327) - #361

Open
laurentketterle-hub wants to merge 2 commits into
Heliobond:mainfrom
laurentketterle-hub:test/coverage-318-321-326-327
Open

test: add coverage for carbon credits, funding round, bridge, cap, governance, archive (Closes #318, #319, #320, #321, #326, #327)#361
laurentketterle-hub wants to merge 2 commits into
Heliobond:mainfrom
laurentketterle-hub:test/coverage-318-321-326-327

Conversation

@laurentketterle-hub

Copy link
Copy Markdown

Summary

Adds unit-test coverage for six previously-untested code paths and repairs the build breakage from #342 that prevented the suite from compiling.

Test coverage added

Build repairs (required for the suite to compile after #342)

  • Close missing braces in lib.rs, events.rs, and test.rs.
  • Resolve duplicate VaultError discriminants (FundingRoundActive/InvestmentCapExceeded).
  • Restore the sequence-based deposit lock in lock_deposit/check_deposit_lock ([Logic] Implement withdrawal sliding window to prevent instant exit #36), matching the WithdrawalWindowLedgers sliding-window semantics the tests exercise.
  • Update stale create_project call sites to the current 4-arg signature.
  • Restore the bodies of test_get_all_project_investments_returns_all and test_claim_queued_is_idempotent_against_double_claim.
  • Remove the redundant from.require_auth() before Base::burn in bridge_burn/initiate_bridge_transfer (consistent with withdraw, where Base::burn already requires auth).

Verification

  • cargo test -p investment-vault — all new + existing tests pass (12 new vault tests, 21 withdraw tests).
  • cargo test -p project-registry — all new + existing tests pass (15 tests).

Signed-off-by: laurentketterle-hub laurentketterle-hub@users.noreply.github.com

noreply and others added 2 commits August 13, 2026 02:25
…vernance, archive

Adds unit test coverage for six previously-untested code paths and repairs the
build breakage from Heliobond#342 that prevented the test suite from compiling.

Test coverage added:
- Heliobond#318: carbon credit calculate/issue/transfer/balance (success + panic paths)
- Heliobond#319: funding-round share-transfer block and re-enable
- Heliobond#320: outbound Wormhole bridge payload round-trip + HBS burn + zero-amount panic
- Heliobond#321: per-project investment cap enforcement + capacity reporting
- Heliobond#326: governance proposal create/vote/execute full-flow + error branches
- Heliobond#327: project archive/delete/compact lifecycle + ArchiveSummary

Build repairs (required for the suite to compile after Heliobond#342):
- Close missing braces in lib.rs, events.rs, and test.rs
- Resolve duplicate VaultError discriminants (FundingRoundActive/InvestmentCapExceeded)
- Restore sequence-based deposit lock (lock_deposit/check_deposit_lock, Heliobond#36)
- Update stale create_project call sites to the current 4-arg signature
- Restore the accidentally-removed bodies of
  test_get_all_project_investments_returns_all and
  test_claim_queued_is_idempotent_against_double_claim
- Remove redundant from.require_auth() before Base::burn in bridge_burn /
  initiate_bridge_transfer (Base::burn already requires auth)

Signed-off-by: laurentketterle-hub <laurentketterle-hub@users.noreply.github.com>
Signed-off-by: laurentketterle-hub <laurentketterle-hub@users.noreply.github.com>
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.

2 participants