Skip to content

test(escrow): add storage footprint regression checks for investor maps#132

Merged
mikewheeleer merged 4 commits intoLiquifact:mainfrom
RemmyAcee:test/escrow-storage-footprint-regression
Apr 1, 2026
Merged

test(escrow): add storage footprint regression checks for investor maps#132
mikewheeleer merged 4 commits intoLiquifact:mainfrom
RemmyAcee:test/escrow-storage-footprint-regression

Conversation

@RemmyAcee
Copy link
Copy Markdown
Contributor

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.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@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! 🚀

Learn more about application limits

@RemmyAcee
Copy link
Copy Markdown
Contributor Author

Done, Close: #132

@mikewheeleer mikewheeleer merged commit 9ffdce7 into Liquifact:main Apr 1, 2026
1 check failed
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 Storage Footprint Regression Tests for Key Growth Paths

2 participants