use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionMismatchError {
pub supported: Vec<String>,
pub requested: String,
}
pub fn is_supported_version(version: &str) -> bool {
version == crate::constants::PROTOCOL_VERSION
}
pub fn version_mismatch_error(requested: &str) -> VersionMismatchError {
VersionMismatchError {
supported: vec![crate::constants::PROTOCOL_VERSION.to_string()],
requested: requested.to_string(),
}
}