Skip to content

Per-project investment cap (investment_capacity/set_max_investment_per_project) has no test coverage #321

Description

@abayomicornelius

Area

Investment Vault / Testing

Complexity

Easy

File(s)

investment_vault/src/lib.rs:1189-1219 (set_max_investment_per_project, investment_capacity), :1836-1848 (cap enforcement in fund_project_internal)

Problem

Grepping test.rs for investment_capacity/set_max_investment_per_project returns zero hits. This is a documented security control ("Prevents over-concentration of vault funds in a single project") with no test verifying that funding a project up to its cap succeeds, one stroop over the cap panics with InvestmentCapExceeded, or that investment_capacity reports the correct remaining headroom.

Scope

In:

  • Tests for cap-respecting funding, cap-exceeding funding (panic), investment_capacity before/after funding, and set_max_investment_per_project(0) restoring the compile-time default.

Out:

  • Changing MAX_INVESTMENT_PER_PROJECT.

Acceptance Criteria

  • Funding exactly at the cap succeeds; funding 1 stroop over panics with InvestmentCapExceeded
  • investment_capacity reflects the correct remaining amount at each step
  • Passing cap = 0 to set_max_investment_per_project is confirmed to restore the default rather than disabling the cap

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcontractSmart contract logic and designgood first issueGood for newcomerstestingTests and test infrastructure

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions