Skip to content

Error::InvalidTimestamp and Error::InvalidTimestamps are confusingly similar names for different conditions #354

Description

@1nonlypiece

The Error enum in src/lib.rs declares both InvalidTimestamp = 4 (create_vault's start_timestamp is in the past, or redirect_funds is called before the deadline) and InvalidTimestamps = 8 (create_vault's end_timestamp is not strictly after start_timestamp) — two error variants whose names differ only by a trailing 's', representing entirely unrelated validation failures across two different functions. README.md's own error table has to add an extra disambiguating sentence ('The exact deadline case returns #4') specifically to compensate for how easy it is to confuse the two, which is itself evidence the naming is a real usability problem for anyone integrating against these error codes without the table in front of them. Consider renaming one of the two variants to something clearly distinct (e.g. PastStartTimestamp and InvalidTimestampOrdering) in a deliberate, documented ABI-breaking change.

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