Skip to content

Contracts - Add get_user_commitments returning full records to match backend read path #480

@1nonlypiece

Description

@1nonlypiece

Contracts - Add get_user_commitments returning full records to match backend read path

Description

The backend tries get_user_commitments (full records) before falling back to get_user_commitment_ids, but contracts/escrow/src/lib.rs only exposes get_owner_commitments (ids). Add a get_user_commitments(owner) reader returning full Commitment records to satisfy the primary backend read path.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Add get_user_commitments returning a Vec<Commitment>
  • Keep the id-only reader for the fallback path
  • Bound the returned size to stay within limits
  • Add tests in contracts/escrow/src/test.rs for the full-record read

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/get-user-commitments-full-records
  • Implement changes
    • Add get_user_commitments in contracts/escrow/src/lib.rs
    • Add tests in contracts/escrow/src/test.rs
    • Document the reader in contracts/README.md
    • Add size-bound comments
  • Test and commit
    • Run tests, cover edge cases
    • Include test output and notes

Example commit message

feat: add get_user_commitments full-record reader

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