Skip to content

Contracts - Add paginated get_owner_commitments to bound return size #476

@1nonlypiece

Description

@1nonlypiece

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

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions