Skip to content

[TESTING & QA] Write unit tests for carbon_credit contract business logic #408

@dev-fatima-24

Description

@dev-fatima-24

Priority: high

Description

The carbon_credit contract has 10 tests but is missing coverage for: minting credits for a suspended project, retiring more credits than owned, and the serial number conflict detection. These are the most critical business rules in the entire system.

Acceptance Criteria

  • Test for minting credits on a suspended project returns ProjectSuspended
  • Test for retiring more credits than owned returns InsufficientCredits
  • Test for serial number conflict detection returns SerialNumberConflict
  • Test for retiring already-retired credits returns AlreadyRetired
  • Test for zero amount retirement returns ZeroAmountNotAllowed

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions