forge::revm::interpreter::primitives::alloy_primitives

Macro fixed_bytes

macro_rules! fixed_bytes {
    () => { ... };
    ($($s:literal)+) => { ... };
}
Expand description

Converts a sequence of string literals containing hex-encoded data into a new FixedBytes at compile time.

If the input is empty, a zero-initialized array is returned.

Note that the strings cannot be prefixed with 0x.

See hex! for more information.

§Examples

use alloy_primitives::{fixed_bytes, FixedBytes};

const ZERO: FixedBytes <0> = fixed_bytes!();
assert_eq!(ZERO, FixedBytes::ZERO);

let byte_array: FixedBytes = fixed_bytes!("0123abcd…");