Skip to content

test(vault_factory): verify vault count correctness after multiple removals#245

Open
Majormaxx wants to merge 2 commits into
StellarYield:mainfrom
Majormaxx:feat/vault-count-after-removals-test
Open

test(vault_factory): verify vault count correctness after multiple removals#245
Majormaxx wants to merge 2 commits into
StellarYield:mainfrom
Majormaxx:feat/vault-count-after-removals-test

Conversation

@Majormaxx
Copy link
Copy Markdown

Summary

  • Adds test_vault_count_correct_after_multiple_removals to vault_factory/src/tests.rs
  • Creates 5 vaults, removes 3 (first, middle, last), and after each removal asserts:
    • get_vault_count() decrements correctly
    • get_all_vaults() excludes removed vaults and retains the rest
    • get_single_rwa_vaults() reflects the same exclusions
    • is_registered_vault() returns false for removed vaults
    • Instance-storage counter always equals the vault list length
  • No non-test code changes

Test plan

  • New test passes: cargo test -p vault_factory -- test_vault_count_correct_after_multiple_removals
  • Full suite passes: cargo test -p vault_factory — 28 passed, 0 failed

Closes #192

Majormaxx added 2 commits March 29, 2026 23:12
Add test_partial_early_redemption_then_full_redemption_at_maturity to
test_redemption.rs. The test covers:

- Stage 1: user redeems half their shares early via request_early_redemption
  and process_early_redemption; asserts payout equals assets minus 2% fee
- Yield distribution between the two redemption stages
- Stage 2: user redeems remaining shares at maturity via redeem_at_maturity;
  asserts payout includes pending yield
- Final state: user holds zero vault shares; total received >= deposited principal

No non-test code changes.

Closes StellarYield#194
…movals

Add test_vault_count_correct_after_multiple_removals to tests.rs.

Creates five vaults, removes the first, middle, and last vault in
sequence, and after each removal asserts:
- get_vault_count() decrements correctly
- get_all_vaults() excludes removed vaults and retains the rest
- get_single_rwa_vaults() reflects the same exclusions
- is_registered_vault() returns false for removed vaults
- instance-storage counter always equals the vault list length

No non-test code changes.

Closes StellarYield#192
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 29, 2026

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

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 Test for Factory Tracking Vault Count Correctly After Removals

1 participant