Skip to content

Commit

Permalink
Fix git-version bug (#216)
Browse files Browse the repository at this point in the history
Fix git-version bug.
  • Loading branch information
silathdiir authored Aug 16, 2023
1 parent 9b498b2 commit fcf4bf3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions prover/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use types::eth::{BlockTrace, BlockTraceJsonRpcResult};
use zkevm_circuits::evm_circuit::witness::Block;

pub const DEFAULT_SERDE_FORMAT: SerdeFormat = SerdeFormat::RawBytesUnchecked;
pub const GIT_VERSION: &str = git_version!();
pub const GIT_VERSION: &str = git_version!(args = ["--abbrev=7", "--always"]);
pub static LOGGER: Once = Once::new();

/// Load setup params from a file.
Expand Down Expand Up @@ -194,7 +194,14 @@ pub fn gen_rng() -> impl Rng + Send {
}

pub fn short_git_version() -> String {
GIT_VERSION.split('-').last().unwrap()[1..8].to_string()
let commit_version = GIT_VERSION.split('-').last().unwrap();

// Check if use commit object as fallback.
if commit_version.len() < 8 {
commit_version.to_string()
} else {
commit_version[1..8].to_string()
}
}

pub fn tick(desc: &str) {
Expand Down

0 comments on commit fcf4bf3

Please sign in to comment.