test: add coverage for #318-#321 and #326-#327; fix bridge double-auth - #360
Open
laurentketterle-hub wants to merge 2 commits into
Open
test: add coverage for #318-#321 and #326-#327; fix bridge double-auth#360laurentketterle-hub wants to merge 2 commits into
laurentketterle-hub wants to merge 2 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
panic (
InvestmentCapExceeded),investment_capacityheadroom tracking, andset_max_investment_per_project(0)restoring the compile-time default.(
FundingRoundActive), succeeds afterend_funding_round, andis_funding_round_active()is asserted at both states.calculate_carbon_creditsgreen-impact math,issuance success + zero-credit panic, transfer success + insufficient-balance
panic, and balance queries.
all fields, HBS burn on initiation, and the
amount <= 0panic path.project_registry
VotingPeriodTooShort), votecasting (+ weight<=0,
AlreadyVoted, unknown-proposal,VotingPeriodEnded),a full create->vote->execute pass/fail flow with double-execution guard, and
get_proposal(+ProposalNotFound).archive_projectstatus flip andlisting inclusion/exclusion,
delete_projectremoval,compact_archivesummary matching pre-compaction data (+
ProjectNotArchivedguard).Bug fix: bridge double-auth
initiate_bridge_transfercalledfrom.require_auth()and thenBase::burn,which itself calls
from.require_auth()on the same address in the same frame.This produced
HostError: Error(Auth, ExistingValue)("frame is alreadyauthorized"). Removed the redundant explicit call (matching the existing
withdrawpattern, which notes thatBase::burnenforces auth).Test-suite repairs (pre-existing breakage)
create_projectcalls left short URIs ("Alpha","Beta","Gamma") that now violateMIN_URI_LEN; changed to validipfs://URIs.test_get_all_project_investments_returns_alldeclarationwhose body was deleted by an earlier merge, and reconstructed the header of a
truncated claim/queue test.
test_score_history_multiple_updates_orderednow advances the ledgertimestamp 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).Closes #318, #319, #320, #321, #326, #327