Skip to content

[CT-70] hash_validator.rs has no test for non-UTF8/binary input #1194

Description

@mftee

Overview

contract/src/hash_validator.rs validates submitted hash strings (feeding CT's SHA-256/SHA-512 support), but has no evident test for malformed binary or non-UTF8 byte sequences arriving in the hash field — worth confirming the Axum extractor/validator rejects this cleanly rather than panicking.

Tasks

  • Add a test submitting invalid UTF-8 bytes in the hash field and assert a clean 4xx response, not a panic or 500
  • Add a test for a hash string of unexpected length (too short/too long for both SHA-256 and SHA-512)

Acceptance Criteria

  • Non-UTF8 or wrong-length input to the hash field never panics the service and always returns a clean validation error

Notes for Contributors

Comment below to be assigned.

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingcontract

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions