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