test: add regression tests and docs for issues #476, #478, #479, #480#494
Open
harystyleseze wants to merge 2 commits into
Open
test: add regression tests and docs for issues #476, #478, #479, #480#494harystyleseze wants to merge 2 commits into
harystyleseze wants to merge 2 commits into
Conversation
|
@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! 🚀 |
…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.
4624122 to
a6c09d3
Compare
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.
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_keyreturns 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_dividendreturns exactly0(not the previously claimed amount)after a successful
claim_dividendcall, and that a subsequent claim attempt reverts withNoDividendClaimable.docs/transfer-supply-cap-and-dividend-interaction.md(closes #479)Documents four non-obvious interactions between
transfer_keysand the supply cap / dividend system:buy_key, not totransfer_keys(supply is invariant across a transfer).claimable is unaffected by the transfer.
decreases).
creator-keys/tests/buyback_event_new_supply_regression.rs(closes #480)Regression tests confirming the
KeysBoughtBackEvent.new_supplyfield equals pre-buyback supply minus buybackamount, 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 passescargo test --test dividend_claim_zeroes_claimable_regression— 2 tests passcargo test --test buyback_event_new_supply_regression— 3 tests passCloses #476
Closes #478
Closes #479
Closes #480