Skip to content

InvalidPaymentMilestoneName (#62) is unreachable, and a closed issue's tests lock in the wrong code #776

Description

@dinahmaccodes

Tier: Medium
Description: validate_milestone_symbols calls validate_symbol at validation.rs:203 (returns InvalidSymbol/#65 on failure), then calls the same deterministic check again at line 210 mapped to InvalidPaymentMilestoneName/#62 — which can never fire since line 203 already short-circuits. Closed issue #584's resulting tests actually assert Error(Contract, #65), confirming the bug rather than catching it.
Files: contracts/shipment/src/validation.rs:203, 210
Tasks:

  • Differentiate the two checks so InvalidPaymentMilestoneName is actually reachable for its intended condition, and correct the [CONTRACT] Add tests for InvalidPaymentMilestoneName error variant #584 tests
    Acceptance Criteria:
  • InvalidPaymentMilestoneName is returned for the condition it was designed to catch, verified by a passing test that doesn't merely re-assert the bug

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions