Skip to content

test: add regression tests and docs for issues #476, #478, #479, #480#494

Merged
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
harystyleseze:feat/issues-476-478-479-480
Jun 28, 2026
Merged

test: add regression tests and docs for issues #476, #478, #479, #480#494
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
harystyleseze:feat/issues-476-478-479-480

Conversation

@harystyleseze

Copy link
Copy Markdown
Contributor

Summary

Adds three regression test files and one documentation file to address issues #476, #478, #479, and #480. No
existing source code or tests are modified.

Changes

creator-keys/tests/holder_count_unchanged_after_supply_cap_exceeded.rs (closes #476)

Regression test confirming that when a buy reverts with SupplyCapExceeded, the holder count is not incremented,
the second wallet's balance stays zero, and total supply remains unchanged. The supply cap check in buy_key
returns early before any holder count or balance mutation, locking in this invariant.

creator-keys/tests/dividend_claim_zeroes_claimable_regression.rs (closes #478)

Regression test confirming that get_claimable_dividend returns exactly 0 (not the previously claimed amount)
after a successful claim_dividend call, and that a subsequent claim attempt reverts with NoDividendClaimable.

docs/transfer-supply-cap-and-dividend-interaction.md (closes #479)

Documents four non-obvious interactions between transfer_keys and the supply cap / dividend system:

  • Supply cap applies only to buy_key, not to transfer_keys (supply is invariant across a transfer).
  • Dividend claimable balances for past distributions are settled before balance changes on transfer; neither party's
    claimable is unaffected by the transfer.
  • Future distributions after a transfer use post-transfer balances (recipient share increases, sender share
    decreases).
  • Pending claimable dividend is not carried with keys on transfer — each holder claims their own independently.

creator-keys/tests/buyback_event_new_supply_regression.rs (closes #480)

Regression tests confirming the KeysBoughtBackEvent.new_supply field equals pre-buyback supply minus buyback
amount, is zero after a full buyback of all supply, and is nonzero when supply remains after a partial buyback.

Test Plan

  • cargo test --test holder_count_unchanged_after_supply_cap_exceeded — 1 test passes
  • cargo test --test dividend_claim_zeroes_claimable_regression — 2 tests pass
  • cargo test --test buyback_event_new_supply_regression — 3 tests pass
  • No existing tests modified; no warnings in new files

Closes #476
Closes #478
Closes #479
Closes #480

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@harystyleseze 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

…cesslayerorg#478, accesslayerorg#479, accesslayerorg#480

Resolves accesslayerorg#476 - holder_count_unchanged_after_supply_cap_exceeded.rs:
regression test confirming holder count is not incremented when a buy
reverts due to SupplyCapExceeded; the second wallet must not appear in
the holder list and total supply must remain unchanged.

Resolves accesslayerorg#478 - dividend_claim_zeroes_claimable_regression.rs:
regression test confirming get_claimable_dividend returns exactly zero
after a successful claim, and that a second claim attempt reverts with
NoDividendClaimable.

Resolves accesslayerorg#479 - docs/transfer-supply-cap-and-dividend-interaction.md:
documents that the supply cap only applies to buy_key (not transfer),
that past claimable amounts are settled before balance changes on
transfer so neither party's claimable is affected, that future
distributions use post-transfer balances, and that pending claimable
is not carried with keys on transfer.

Resolves accesslayerorg#480 - buyback_event_new_supply_regression.rs:
regression tests confirming the KeysBoughtBackEvent new_supply field
equals pre-buyback supply minus buyback amount, is zero on a full
buyback, and is nonzero when supply remains.
@harystyleseze harystyleseze force-pushed the feat/issues-476-478-479-480 branch from 4624122 to a6c09d3 Compare June 27, 2026 15:13
@Chucks1093 Chucks1093 merged commit 449c6fd into accesslayerorg:main Jun 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment