Skip to content

[CT-07] Write tests for the resource_credits contract #771

@yusuftomilola

Description

@yusuftomilola

Overview

Write a comprehensive test suite for the resource_credits contract in src/test.rs, covering all functions and error paths. Work inside contracts/sandbox/resource_credits/.

Acceptance Criteria

  • Test: initialize sets admin and rejects re-initialization
  • Test: mint_credits increases balance and total supply
  • Test: mint_credits rejects non-admin callers
  • Test: transfer_credits moves credits between accounts correctly
  • Test: transfer_credits fails with InsufficientBalance
  • Test: spend_credits reduces balance and total supply
  • Test: spend_credits fails with InsufficientBalance
  • Test: expired credits cannot be transferred or spent
  • All tests pass with cargo test

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions