Skip to content

Contracts: Window edge-cases — start==end, zero window, and ledger clock-skew in is_within_window #741

Description

@joelpeace48-cell

Context

set_window/get_window/is_within_window (campaign/src/lib.rs ~L217–L253) gate registration by time.
Edge conditions (start == end, end < start, window of zero, boundary timestamp equality, reliance on
ledger().timestamp() skew) are easy to get subtly wrong and lock users in/out.

Scope

  • Define inclusive/exclusive bounds explicitly.
  • Validate start <= end on set; reject degenerate windows or define their semantics.
  • Test boundary timestamps exactly at start and end.

Acceptance criteria

  • Documented bound semantics.
  • Tests at exact boundaries and degenerate windows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions