lighthouse/common/slot_clock/src
Jimmy Chen 245e922c7b Improve testing slot clock to allow manipulation of time in tests (#3974)
## Issue Addressed

I discovered this issue while implementing [this test](https://github.com/jimmygchen/lighthouse/blob/test-example/beacon_node/network/src/beacon_processor/tests.rs#L895), where I tried to manipulate the slot clock with: 

`rig.chain.slot_clock.set_current_time(duration);`

however the change doesn't get reflected in the `slot_clock` in `ReprocessQueue`, and I realised `slot_clock` was cloned a few times in the code, and therefore changing the time in `rig.chain.slot_clock` doesn't have any effect in `ReprocessQueue`.

I've incorporated the suggestion from the @paulhauner and @michaelsproul - wrapping the `ManualSlotClock.current_time` (`RwLock<Duration>)` in an `Arc`, and the above test now passes. 

Let's see if this breaks any existing tests :)
2023-02-16 23:34:32 +00:00
..
lib.rs Avoid penalizing peers for delays during processing (#2894) 2022-01-12 02:36:24 +00:00
manual_slot_clock.rs Improve testing slot clock to allow manipulation of time in tests (#3974) 2023-02-16 23:34:32 +00:00
metrics.rs Represent slots in secs instead of millisecs (#2163) 2021-01-19 09:39:51 +00:00
system_time_slot_clock.rs Finished Gossip Block Validation Conditions (#2640) 2021-12-02 14:26:51 +11:00