Skip to content

[scanner] Test constant HASH is 62 hex chars — b256! macro requires 64 chars for B256 #235

@obchain

Description

@obchain

Refs #46

PR: feat/21-mempool-monitor
File: crates/charon-scanner/src/mempool.rs
Location: tests module, constant HASH

Problem

The test constant is defined as:

const HASH: B256 = b256!("abababababababababababababababababababababababababababababababab");

B256 is a 32-byte type. The b256!() macro requires exactly 64 hex characters (32 bytes times 2 hex chars each). The literal above contains 62 characters (31 bytes of "ab" pairs), which is one byte short.

If the literal is genuinely 62 chars in the committed diff, the test module will not compile and none of the 15 claimed unit tests can pass.

Required fix

Use a valid 64-character hex literal, for example:

const HASH: B256 = b256!("abababababababababababababababababababababababababababababababababab");

(32 repetitions of "ab" = 64 hex characters = 32 bytes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)priority:p2-polishNice-to-have / polish

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions