Contracts - Add paginated get_owner_commitments to bound return size
Description
get_owner_commitments in contracts/escrow/src/lib.rs returns the entire id vector, which is unbounded for active owners. Add offset/limit pagination so reads stay within resource limits as the owner's commitment count grows.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Add
start and limit parameters with sane caps
- Return a bounded slice of owner commitment ids
- Keep the existing function or deprecate it cleanly
- Add tests in
contracts/escrow/src/test.rs for paging boundaries
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/paginated-owner-commitments
- Implement changes
- Add a paginated reader in
contracts/escrow/src/lib.rs
- Add tests in
contracts/escrow/src/test.rs
- Document pagination in
contracts/README.md
- Add cap validation comments
- Test and commit
- Run tests, cover edge cases
- Include test output and notes
Example commit message
feat: paginate get_owner_commitments to bound result size
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Contracts - Add paginated get_owner_commitments to bound return size
Description
get_owner_commitmentsincontracts/escrow/src/lib.rsreturns the entire id vector, which is unbounded for active owners. Add offset/limit pagination so reads stay within resource limits as the owner's commitment count grows.Requirements and context
startandlimitparameters with sane capscontracts/escrow/src/test.rsfor paging boundariesSuggested execution
git checkout -b feature/paginated-owner-commitmentscontracts/escrow/src/lib.rscontracts/escrow/src/test.rscontracts/README.mdExample commit message
feat: paginate get_owner_commitments to bound result sizeGuidelines