test: verify get_total_key_supply is scoped per creator - #703
Closed
stableprogrammer wants to merge 1 commit into
Closed
test: verify get_total_key_supply is scoped per creator#703stableprogrammer wants to merge 1 commit into
stableprogrammer wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #701
Adds 6 unit tests confirming that
get_total_key_supplytracks supply independently per creator and does not bleed across registrations.Tests added (
creator-keys/tests/total_supply_per_creator.rs)test_supply_scoped_per_creator_after_ten_buystest_supply_scoped_per_creator_after_five_buystest_creator_a_supply_unaffected_by_creator_b_buystest_sell_decrements_creator_a_supplytest_sell_does_not_affect_other_creator_supplytest_unregistered_creator_returns_not_registered_errorContractError::NotRegisteredAll 6 tests pass locally.