Skip to content

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

Description

@abayomicornelius

Area

Investment Vault / Testing

Complexity

Medium

File(s)

investment_vault/src/lib.rs:1484-1619

Problem

grep -n carbon investment_vault/src/test.rs returns exactly one hit — a negative-auth check on set_carbon_oracle. calculate_carbon_credits, issue_carbon_credits, transfer_carbon_credits, and carbon_credit_balance (the functions actually moving/crediting value) have zero tests, including no test for the "insufficient carbon credits" panic path in transfer_carbon_credits (line ~1590).

Scope

In:

  • Unit tests for calculation correctness, issuance, transfer (success + insufficient-balance panic), and balance queries.

Out:

  • Fixing the missing-auth bug itself (tracked in a separate issue).

Acceptance Criteria

  • Each public carbon-credit function has at least one success and one failure-path test
  • Tests would have caught the missing-auth issue tracked separately

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