Skip to content

Add sell holder count unit tests 675 - #692

Merged
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
somotochukwu-dev:add-sell-holder-count-unit-tests-675
Jul 29, 2026
Merged

Add sell holder count unit tests 675#692
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
somotochukwu-dev:add-sell-holder-count-unit-tests-675

Conversation

@somotochukwu-dev

Copy link
Copy Markdown

Summary

Adds a unit test for the sell function correctly decrementing the holder count when a wallet sells all its keys.

Changes

  • creator-keys/tests/sell_key.rs: Added test_multi_key_full_exit_decrements_holder_count_only_on_last_sell — a wallet holding 3 keys sells 2 (holder count unchanged), then sells the last key (holder count decrements to 0). This fills the gap where no existing test verified holder count only decrements on the final sale when a wallet holds more than one key.

Acceptance criteria coverage

The following scenarios were already covered by existing tests and remain passing:

Criterion Existing test
Selling all keys decrements holder count by 1 test_sell_key_removes_holder_when_last_key_is_sold
Selling partial keys does not change holder count test_sell_key_preserves_holder_count_when_seller_still_has_keys
Two wallets selling all keys decrements count by 2 test_holder_count_reflects_mixed_trade_correctly in supply_invariants.rs
Holder count reaches 0 when the last holder sells all keys Covered by full-exit tests above
State correct after each scenario All tests assert state after each operation

The new test covers the previously untested scenario of a multi-key wallet fully exiting.

Closes #675

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@somotochukwu-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit 3851f0f into accesslayerorg:main Jul 29, 2026
1 check passed
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 sell function correctly decrementing the holder count when a wallet sells all its keys

3 participants