mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 21:17:54 -05:00
Revert "[PAN-2950] Use java.time.Clock instead of System.currentTimeMillis()" (#1768)
This reverts commit 814b36e4 The needed chantes to get rid of Instant.now (which is also needed to get rid of the wall clock dependency) are too deep and intrusive into IBFT to try and speed patch them in that some APIs require re-work, so in the interst of test stability this gets sheleved until it is all ready. Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This commit is contained in:
@@ -17,20 +17,14 @@ import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.temporal.TemporalUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.google.common.base.Suppliers;
|
||||
|
||||
public class TestClock extends Clock {
|
||||
|
||||
private static final Supplier<Clock> fixedNow =
|
||||
Suppliers.memoize(() -> Clock.fixed(Instant.now(), ZoneOffset.UTC));
|
||||
private Instant now = fixedNow.get().instant();
|
||||
|
||||
public static Clock fixed() {
|
||||
return fixedNow.get();
|
||||
return Clock.fixed(Instant.ofEpochSecond(10_000_000), ZoneId.systemDefault());
|
||||
}
|
||||
|
||||
private Instant now = Instant.ofEpochSecond(24982948294L);
|
||||
|
||||
@Override
|
||||
public ZoneId getZone() {
|
||||
return ZoneOffset.UTC;
|
||||
|
||||
Reference in New Issue
Block a user