Skip to content

test: add coverage for #318-#321 and #326-#327; fix bridge double-auth - #360

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

test: add coverage for #318-#321 and #326-#327; fix bridge double-auth#360
laurentketterle-hub wants to merge 2 commits into
Heliobond:mainfrom
laurentketterle-hub:test/coverage-318-327

Conversation

@laurentketterle-hub

Copy link
Copy Markdown

Summary

Adds missing test coverage for six open Stellar Wave testing bounties and fixes a
bridge authorization bug the new tests exposed.

Test coverage added

investment_vault

project_registry

Bug fix: bridge double-auth

initiate_bridge_transfer called from.require_auth() and then Base::burn,
which itself calls from.require_auth() on the same address in the same frame.
This produced HostError: Error(Auth, ExistingValue) ("frame is already
authorized"). Removed the redundant explicit call (matching the existing
withdraw pattern, which notes that Base::burn enforces auth).

Test-suite repairs (pre-existing breakage)

  • Three stale create_project calls left short URIs ("Alpha", "Beta",
    "Gamma") that now violate MIN_URI_LEN; changed to valid ipfs:// URIs.
  • Removed a dangling test_get_all_project_investments_returns_all declaration
    whose body was deleted by an earlier merge, and reconstructed the header of a
    truncated claim/queue test.
  • test_score_history_multiple_updates_ordered now advances the ledger
    timestamp between score updates so the "strictly increasing" assertion holds.

Verification

  • cargo test -p investment-vault: 128 passed, 0 failed (2 fuzz tests filtered).
  • cargo test -p project-registry: 106 passed, 0 failed (4 fuzz tests filtered).

Note on base: this branch is based on the fix/issue-314-deposit-lock
branch (commit 742cdf8) because upstream main currently does not compile
(broken merge from PR #342). It should be reviewed/merged together with, or
after, that fix.

Closes #318, #319, #320, #321, #326, #327

…oses Heliobond#310, Heliobond#311, Heliobond#314)

The withdrawal-window merge (Heliobond#36) left the crate non-compiling: get_withdrawal_window and get_volume_fee_tier were missing closing braces, the withdrawal_window_set and funding_round_ended event functions were missing closing braces, check_deposit_lock referenced an undefined last_seq and merged two incompatible lock models, and VaultError had three variants sharing discriminant 41.

This change adds a LastDepositSeq(Address) storage key recorded by lock_deposit, rewrites check_deposit_lock to enforce the ledger-sequence sliding window (Heliobond#36), renumbers FundingRoundActive to 42 and InvestmentCapExceeded to 43, and restores all missing closing braces.

Signed-off-by: laurentketterle-hub <laurentketterle-hub@users.noreply.github.com>
…nd#326-Heliobond#327; fix bridge double-auth

- investment_vault: test coverage for per-project investment cap (Heliobond#321),
  funding-round transfer block (Heliobond#319), carbon credits (Heliobond#318), and outbound
  Wormhole bridge path (Heliobond#320).
- project_registry: test coverage for governance proposals (Heliobond#326) and the
  project archive/delete/compact lifecycle (Heliobond#327).
- fix: remove redundant from.require_auth() in initiate_bridge_transfer —
  Base::burn already enforces auth, and the duplicate call triggered a
  'frame is already authorized' host error.
- test: repair stale create_project calls (short URIs) and a dangling test
  body left by an upstream merge, and make the score-history ordering test
  advance ledger time between updates.

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.

Carbon credit feature (~140 lines) has essentially no test coverage

2 participants