-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: check for invalid seirra version in stateless validator
- Loading branch information
1 parent
0b9493f
commit 58327dc
Showing
6 changed files
with
112 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use cairo_lang_starknet_classes::compiler_version::VersionId as CairoLangVersionId; | ||
use validator::Validate; | ||
|
||
// TODO(Arni): Share this struct with the Cairo lang crate. | ||
#[derive(Clone, Copy, Debug, Validate, PartialEq)] | ||
pub struct VersionId { | ||
pub major: usize, | ||
pub minor: usize, | ||
pub patch: usize, | ||
} | ||
|
||
impl From<VersionId> for CairoLangVersionId { | ||
fn from(version: VersionId) -> Self { | ||
CairoLangVersionId { major: version.major, minor: version.minor, patch: version.patch } | ||
} | ||
} | ||
|
||
impl std::fmt::Display for VersionId { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
let version_id: CairoLangVersionId = (*self).into(); | ||
version_id.fmt(f) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod compiler_version; | ||
pub mod config; | ||
pub mod errors; | ||
pub mod gateway; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters