/// Serialize the off-chain message to bytes including full header
pub fn serialize(&self) -> Result<Vec<u8>, SanitizeError> {
    // serialize signing domain
    let mut data = Self::SIGNING_DOMAIN.to_vec();

    // serialize version and call version specific serializer
    match self {
        Self::V0(msg) => {
            data.push(0);
            msg.serialize(&mut data)?;
        }
    }
    Ok(data)
}