Skip to content
Snippets Groups Projects
Commit 13d098ea authored by Vecna's avatar Vecna
Browse files

Artificially advance time on BridgeDb

parent 766516ce
No related branches found
No related tags found
No related merge requests found
Pipeline #174968 failed
......@@ -415,6 +415,9 @@ impl LoxServerContext {
let mut ba_obj = self.ba.lock().unwrap();
ba_obj.advance_days(num); // FOR TESTING ONLY
println!("Today's date according to server: {}", ba_obj.today());
// Also advance days for BridgeDb
let mut db_obj = self.db.lock().unwrap();
db_obj.advance_days(num); // FOR TESTING ONLY
}
// Encrypts the Lox bridge table, should be called after every sync
......
......@@ -287,6 +287,17 @@ impl BridgeDb {
Err(SignatureError::new())
}
}
///#[cfg(test)]
/// For testing only: manually advance the day by the given number
/// of days
pub fn advance_days(&mut self, days: u16) {
if days > 0 {
self.today += Duration::days(days.into());
// Reset daily bridges distributed count
self.daily_bridges_distributed = 0;
}
}
}
impl Default for BridgeDb {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment