feat: add per-holder accrual snapshot query - #708
Merged
thlpkee20-wq merged 2 commits intoJul 30, 2026
Conversation
- Add get_holder_accrued_unclaimed public query that walks the accrual ledger and returns total unclaimed dividend balance - Add EVENT_ACC_SNAP debug tracing event for simulation visibility - Add 8 comprehensive tests covering blacklist, partial claims, share changes, zero shares, and full-claim scenarios - Fix pre-existing storage layout registry drift in schema tool
|
@Glam26 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! 🚀 |
- Fix missing newline after RedemptionWindowClosed enum variant - Fix module list ordering in test module declarations - Fix long tuple expression formatting in emit_v2_event - Fix assertion and method call formatting in test_transfer_cooldown - Fix let+match binding formatting in vesting.rs - Additional minor whitespace adjustments in test files
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.
Here's a summary of all changes made across 3 files (258 additions, 8 deletions):
──────────────────────────────────────────────────────────────────────
Event constant ( EVENT_ACC_SNAP ):
New public function get_holder_accrued_unclaimed(env, issuer, namespace, token, holder) -> i128 :
──────────────────────────────────────────────────────────────────────
┌───────────────────────────────────────┬──────────────────────────────┐
│ Test │ What it checks │
├───────────────────────────────────────┼──────────────────────────────┤
│ accrued_unclaimed_returns_zero_for_bl │ Fast-path guard works │
│ acklisted_holder │ │
│ accrued_unclaimed_matches_claimable_f │ 50% share → accrued == │
│ or_single_period │ claimable == 50k │
│ accrued_unclaimed_matches_claimable_a │ 50% → 25% share: accrued == │
│ fter_share_change │ claimable == 75k │
│ accrued_unclaimed_returns_zero_for_ho │ Never had share → 0 │
│ lder_with_no_share │ │
│ accrued_unclaimed_respects_partial_cl │ Claimed 1 of 2 periods → │
│ aim │ remaining = 50k │
│ accrued_unclaimed_after_full_claim_re │ All periods claimed → 0 │
│ turns_zero │ │
│ accrued_unclaimed_zero_share_does_not │ Had 50% share then set to 0 │
│ _erase_past_accrual │ → past accrual (50k) │
│ │ preserved │
│ accrued_unclaimed_matches_claimable_a │ Combination: share changes + │
│ fter_partial_claim_with_share_change │ partial claim → matches │
└───────────────────────────────────────┴──────────────────────────────┘
Every test asserts accrued == claimable when both are meaningful.
──────────────────────────────────────────────────────────────────────
closes #529