Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add version constant #38

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 29 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions zkevm-circuits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#![deny(unsafe_code)]
#![deny(clippy::debug_assert_with_mut_call)]

pub mod version;
pub mod bytecode_circuit;
pub mod copy_circuit;
pub mod evm_circuit;
Expand Down
28 changes: 28 additions & 0 deletions zkevm-circuits/src/version.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/// Version
pub mod version {
/// Major version
pub const MAJOR: u32 = 0;
/// Minor version
pub const MINOR: u32 = 1;
/// Patch version
pub const PATCH: u32 = 0;

/// Export versions as string
pub fn as_string() -> String {
format!("{}.{}.{}", MAJOR, MINOR, PATCH)
}
}

mod tests {
use crate::version::version;

#[test]
fn test_version_string() {
let expected = "0.1.0";

assert_eq!(version::MAJOR, 0, "wrong version");
assert_eq!(version::MINOR, 1, "wrong version");
assert_eq!(version::PATCH, 0, "wrong version");
assert_eq!(version::as_string(), expected, "wrong version");
}
}
Loading