Skip to content

Commit fa382d3

Browse files
author
MarcoFalke
committed
test: Add missing Assert(mock_time_in >= 0s) to SetMockTime
Also, inline the deprecated alias to avoid having the two go out of sync again in the future.
1 parent 3abee5e commit fa382d3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/util/time.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ NodeClock::time_point NodeClock::now() noexcept
2929
return time_point{ret};
3030
};
3131

32-
void SetMockTime(int64_t nMockTimeIn)
33-
{
34-
Assert(nMockTimeIn >= 0);
35-
nMockTime.store(nMockTimeIn, std::memory_order_relaxed);
36-
}
37-
32+
void SetMockTime(int64_t nMockTimeIn) { SetMockTime(std::chrono::seconds{nMockTimeIn}); }
3833
void SetMockTime(std::chrono::seconds mock_time_in)
3934
{
35+
Assert(mock_time_in >= 0s);
4036
nMockTime.store(mock_time_in.count(), std::memory_order_relaxed);
4137
}
4238

0 commit comments

Comments
 (0)