diff --git a/lib/src/settings.rs b/lib/src/settings.rs index 2002e7ac1..afdf09770 100644 --- a/lib/src/settings.rs +++ b/lib/src/settings.rs @@ -42,7 +42,8 @@ use crate::signing::SignBehavior; #[derive(Debug, Clone)] pub struct UserSettings { config: StackedConfig, - timestamp: Option, + commit_timestamp: Option, + operation_timestamp: Option, rng: Arc, } @@ -136,11 +137,13 @@ fn get_timestamp_config(config: &StackedConfig, key: &'static str) -> Option Self { - let timestamp = get_timestamp_config(&config, "debug.commit-timestamp"); + let commit_timestamp = get_timestamp_config(&config, "debug.commit-timestamp"); + let operation_timestamp = get_timestamp_config(&config, "debug.operation-timestamp"); let rng_seed = config.get::("debug.randomness-seed").ok(); UserSettings { config, - timestamp, + commit_timestamp, + operation_timestamp, rng: Arc::new(JJRng::new(rng_seed)), } } @@ -176,11 +179,11 @@ impl UserSettings { pub const USER_EMAIL_PLACEHOLDER: &'static str = "(no email configured)"; pub fn commit_timestamp(&self) -> Option { - self.timestamp + self.commit_timestamp } pub fn operation_timestamp(&self) -> Option { - get_timestamp_config(&self.config, "debug.operation-timestamp") + self.operation_timestamp } pub fn operation_hostname(&self) -> String { @@ -212,7 +215,7 @@ impl UserSettings { } pub fn signature(&self) -> Signature { - let timestamp = self.timestamp.unwrap_or_else(Timestamp::now); + let timestamp = self.commit_timestamp.unwrap_or_else(Timestamp::now); Signature { name: self.user_name(), email: self.user_email(),