test(escrow): add storage footprint regression checks for investor maps#132
Merged
mikewheeleer merged 4 commits intoLiquifact:mainfrom Apr 1, 2026
Merged
Conversation
|
@RemmyAcee 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! 🚀 |
Contributor
Author
|
Done, Close: #132 |
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.
Close: #109
Implemented the storage-growth guard in the escrow contract and documented the product limit. The main changes are in [lib.rs], [test.rs], and [README.md].
The contract now tracks per-investor contributions, exposes get_investor_count, get_investor_contribution, and max_investors, and enforces a hard cap of 128 distinct investors per escrow. Funding must be positive, and both investor balances and total funding use checked addition. This turns the storage-growth concern into an actual on-chain guard instead of just a test-only warning.
Tests now cover init, funding/settlement, zero-amount rejection, overflow-cardinality rejection, top-up behavior at the cap, and a storage regression guard at the 128-investor boundary. The measured baseline used for the guard is:
Investor map XDR size: 7692 bytes
Full escrow XDR size: 8040 bytes
Final insert write footprint: 8164 bytes
cargo test -- --nocapture passed with 6 passed; 0 failed. cargo fmt --all also passed. I could not verify the requested 95% coverage target because cargo llvm-cov is not installed in this environment.