Skip to content

ForceCancelReasonHashMissing (#34) is documented but never actually returned #777

Description

@dinahmaccodes

Tier: Easy
Description: force_cancel_shipment (lib.rs:4340-4356) validates its reason hash via the generic validation::validate_hash(), which returns InvalidHash for an all-zero hash — never the dedicated variant. Compare resolve_dispute (lib.rs:4882-4885), which has an inline comment explaining it uses a specific error rather than the generic one, and correctly returns DisputeReasonHashMissing.
Files: contracts/shipment/src/errors.rs:84, contracts/shipment/src/error_map.rs:249, 540, contracts/shipment/src/lib.rs:4340-4356
Tasks:

  • Make force_cancel_shipment return ForceCancelReasonHashMissing for a missing/zero reason hash, following the resolve_dispute pattern
    Acceptance Criteria:
  • ForceCancelReasonHashMissing is actually returned by the code path it was designed for

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