1 2 3 4 5 6 7 8 9 10
use chia_protocol::Bytes; use hex::FromHexError; pub fn parse_hex(mut hex: &str) -> Result<Bytes, FromHexError> { if let Some(stripped) = hex.strip_prefix("0x") { hex = stripped; } Ok(hex::decode(hex)?.into()) }