cairo_lang_starknet_classes/
compiler_version.rsuse serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct VersionId {
pub major: usize,
pub minor: usize,
pub patch: usize,
}
pub const CONTRACT_SEGMENTATION_MINOR_VERSION: usize = 5;
impl std::fmt::Display for VersionId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}.{}.{}", self.major, self.minor, self.patch)
}
}
pub fn current_compiler_version_id() -> VersionId {
VersionId {
major: env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(),
minor: env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(),
patch: env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(),
}
}
pub fn current_sierra_version_id() -> VersionId {
VersionId { major: 1, minor: 6, patch: 0 }
}