Skip to content

Add Display trait for SuspicionReason enum #1

@jason-h23

Description

@jason-h23

Summary

The SuspicionReason enum in src/sentinel/types.rs has a score() method but no human-readable Display implementation. Adding one improves debugging, CLI output, and alert readability.

Current State

Each variant contains diagnostic data (addresses, gas values, counts) but Debug output is the only way to print them.

What To Do

Implement Display for SuspicionReason so each variant produces a readable string like:

  • "Flash loan detected from 0x7d27..., score 0.4"
  • "High value revert: 50.5 ETH, 250000 gas used"

Files

  • src/sentinel/types.rs (lines 48-64)

Acceptance Criteria

  • Display trait implemented for all variants
  • Output is human-readable (not Debug format)
  • Existing tests still pass (cargo test --all-features)
  • cargo clippy --all-features -- -D warnings passes

Estimated Effort

~30-50 lines, 1-2 hours

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