Skip to content

Add get_check_in_timestamp read-only accessor for milestone check-in time in accountability_vault #482

@1nonlypiece

Description

@1nonlypiece

Add get_check_in_timestamp read-only accessor for milestone check-in time in accountability_vault

Description

check_in in contracts/accountability_vault/src/lib.rs stores DataKey::CheckIn(index) -> timestamp but no public accessor exposes it. The backend ETL (src/services/etlWorker.ts) currently has no way to read the recorded check-in time without scanning events. Add a get_check_in_timestamp(index: u32) -> Option<u64> returning the stored value or None if not yet checked in.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Add get_check_in_timestamp to contracts/accountability_vault/src/lib.rs
  • Return Option<u64> keyed by DataKey::CheckIn(index)
  • Add read tests in contracts/accountability_vault/src/test.rs
  • Document the function in contracts/README.md

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/get-check-in-timestamp
  • Implement changes
    • Modify contracts/accountability_vault/src/lib.rs
    • Add tests in contracts/accountability_vault/src/test.rs
    • Update contracts/README.md
    • Add index bounds check
  • Test and commit
    • Run tests, cover edge cases
    • Include test output and notes

Example commit message

feat: add get_check_in_timestamp read accessor

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions