Skip to content

Add reporting-window boundary tests for report_revenue at exact start and end timestamps #374

@thlpkee20-wq

Description

@thlpkee20-wq

Description

require_report_window_open uses inclusive bounds (now >= start && now <= end), and report_revenue returns ReportingWindowClosed outside the window. Boundary coverage at now == start, now == end, now == start - 1, now == end + 1, and zero-width windows (start == end) should be explicit. Add a ledger-timestamp-driven matrix.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs (report_revenue, set_report_window, is_window_open, require_report_window_open), src/test_time_windows.rs
  • Confirm an unset window means always-open

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/report-window-boundary-tests
  • Implement changes
    • Set a window [start, end] and drive ledger timestamp across all five boundary points
    • Assert ReportingWindowClosed outside and Ok at inclusive edges
    • Add a zero-width single-second window case
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test
  • Cover edge cases
    • Unset window, zero-width window, window reconfigured mid-flight
  • Include test output and security notes

Example commit message

test: cover report window inclusive boundaries and zero-width slot

Guidelines

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

Metadata

Metadata

Assignees

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