Skip to content

[CT-39] Write tests for the referral contract #803

@yusuftomilola

Description

@yusuftomilola

Overview

Write a comprehensive test suite for the referral contract in src/test.rs. Work inside contracts/sandbox/referral/.

Acceptance Criteria

  • Test: register_code creates code and rejects duplicates
  • Test: use_referral_code links referee and increments usage count
  • Test: use_referral_code rejects self-referral
  • Test: use_referral_code rejects already-referred address
  • Test: pay_referral_reward sends token to referrer and marks as paid
  • Test: reward cannot be paid twice for the same referral
  • 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