Skip to content

Commit

Permalink
fix: Fix uuid by env variable (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb authored Jul 1, 2020
1 parent b11a28d commit 4ec46c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions raiden/src/id_generator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
pub trait IdGenerator {
#[cfg(not(test))]
fn gen() -> String {
uuid::Uuid::new_v4().to_string()
match std::env::var("RAIDEN_UUID_FIXED_BY") {
Ok(v) => v,
Err(_) => uuid::Uuid::new_v4().to_string(),
}
}

#[cfg(test)]
fn gen() -> String {
"01234567-89ab-cdef-0123-456789abcdef".to_owned()
}
}

0 comments on commit 4ec46c0

Please sign in to comment.