1use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct VersionMismatchError {
7 pub supported: Vec<String>,
8 pub requested: String,
9}
10
11pub fn is_supported_version(version: &str) -> bool {
13 version == crate::constants::PROTOCOL_VERSION
15}
16
17pub fn version_mismatch_error(requested: &str) -> VersionMismatchError {
19 VersionMismatchError {
20 supported: vec![crate::constants::PROTOCOL_VERSION.to_string()],
21 requested: requested.to_string(),
22 }
23}