Test/accrual reconciliation prop - #716
Open
Glam26 wants to merge 4 commits into
Open
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
- 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
Add property-based test that exercises randomized report and claim sequences and asserts: sum(accrued_unclaimed) + sum(claimed) == total_deposited_revenue Key design: - 512 proptest cases with 12-25 operations each across 4 holders - Initial shares sum to exactly 10000 bps so entire invariant is exact - Rebalance after every SetShare to keep total_bps at 10000 - Check invariant after EVERY operation (SetShare, Deposit, Claim) - Amounts are multiples of 10000 so integer division is exact - Two edge-case tests: no-share period and single-holder full drain
|
@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! 🚀 |
Expose get_holder_tax_year returning TaxYearSummary per fiscal year. - Configurable fiscal-year start month per offering - Accumulated on claim via update_tax_year_accumulator - Comprehensive tests for boundaries, multi-year, no-activity
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:
Changes Summary
New file: src/test_accrual_reconciliation_prop.rs
A property-based test that asserts the accrual ledger reconciliation invariant: sum(accrued_per_holder) + sum(claimed) == total_revenue at every step.
Structure:
Two edge-case tests (standalone):
┌──────────────────┬───────────────────────────────────────────────────┐
│ Test │ What it verifies │
├──────────────────┼───────────────────────────────────────────────────┤
│ edge_no_share_ho │ Revenue deposited when no holder has shares stays │
│ lder_sequence │ in the accrual index (expected behavior) │
│ edge_single_hold │ 100% holder can fully deposit → claim → drain │
│ er_full_drain │ │
└──────────────────┴───────────────────────────────────────────────────┘
Key design decisions validated by review:
Modified: src/lib.rs
Added module declaration:
// rust
#[cfg(test)]
mod test_accrual_reconciliation_prop;
Build note
The codebase has 100 pre-existing compilation errors (duplicate contractimpl functions, missing struct fields, custom attribute panics, etc.) — all unrelated to this change. The new test file compiles cleanly with no errors from its code.
closes #532