refactor(core): WallClockStore trait replaces the store_mut backdoor
Task 10b reached LogStore::set_wall_clock through a general Node::store_mut. Kyle: replace it with a narrower accessor. A WallClockStore trait (set_wall_clock + peer_time_estimate, implemented only by LogStore) now backs Node::set_wall_clock and Node::peer_time_estimate, so no &mut Store escapes the facade.
This commit is contained in:
@@ -223,10 +223,10 @@ impl TinesNode {
|
||||
if self.clock.is_trusted() {
|
||||
return;
|
||||
}
|
||||
let Some(est) = self.tines.store_mut().peer_time_estimate(now) else {
|
||||
let Some(est) = self.tines.peer_time_estimate(now) else {
|
||||
return;
|
||||
};
|
||||
let report = self.tines.store_mut().set_wall_clock(est, now);
|
||||
let report = self.tines.set_wall_clock(est, now);
|
||||
self.clock.anchor_wall(est, now);
|
||||
match report.downtime_ms {
|
||||
Some(ms) => println!("tines: trusted wall clock from peer (folded {ms} ms downtime)"),
|
||||
|
||||
Reference in New Issue
Block a user