Skip to content

Add unit tests for the get_total_supply view returning the correct cumulative supply across multiple creators #701

Description

@Chucks1093

Summary

The get_total_supply view should return the total keys in circulation for a specific creator, not a global count. Unit tests should confirm the supply is scoped correctly per creator and does not bleed across registrations.

Scope

  • Register creator A, buy 10 keys — assert get_total_supply(A) returns 10
  • Register creator B, buy 5 keys — assert get_total_supply(B) returns 5
  • Assert get_total_supply(A) still returns 10 after creator B's buy
  • Sell 3 keys from creator A — assert get_total_supply(A) returns 7
  • Assert get_total_supply for an unregistered creator panics with creator_not_found

Acceptance Criteria

  • Supply scoped correctly per creator
  • Creator A supply unaffected by creator B buys
  • Sell correctly decrements supply
  • Unregistered creator panics with creator_not_found

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions