Skip to content

test: verify get_total_key_supply is scoped per creator - #703

Closed
stableprogrammer wants to merge 1 commit into
accesslayerorg:mainfrom
stableprogrammer:test/get-total-supply-per-creator-701
Closed

test: verify get_total_key_supply is scoped per creator#703
stableprogrammer wants to merge 1 commit into
accesslayerorg:mainfrom
stableprogrammer:test/get-total-supply-per-creator-701

Conversation

@stableprogrammer

Copy link
Copy Markdown
Contributor

Closes #701

Adds 6 unit tests confirming that get_total_key_supply tracks supply independently per creator and does not bleed across registrations.

Tests added (creator-keys/tests/total_supply_per_creator.rs)

Test Covers
test_supply_scoped_per_creator_after_ten_buys Creator A supply = 10 after 10 buys
test_supply_scoped_per_creator_after_five_buys Creator B supply = 5 after 5 buys
test_creator_a_supply_unaffected_by_creator_b_buys A stays at 10 after B buys 5
test_sell_decrements_creator_a_supply 3 sells drops A from 10 → 7
test_sell_does_not_affect_other_creator_supply B stays at 5 after A sells 3
test_unregistered_creator_returns_not_registered_error Unregistered → ContractError::NotRegistered

All 6 tests pass locally.

…rg#701)

Add unit tests confirming that the supply view tracks keys independently
per creator and does not bleed across registrations:

- Supply increments correctly after 10 buys (creator A) and 5 buys (creator B)
- Creator A supply stays at 10 after creator B buys 5 keys
- Selling 3 keys from creator A decrements supply to 7
- Creator B supply is unaffected by creator A sells
- Unregistered creator address returns ContractError::NotRegistered from
  the checked get_creator_supply view

Closes accesslayerorg#701
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant