Skip to content

Commit

Permalink
test: Add missing Assert(mock_time_in >= 0s) to SetMockTime
Browse files Browse the repository at this point in the history
Also, inline the deprecated alias to avoid having the two go out of sync
again in the future.
  • Loading branch information
MarcoFalke committed Apr 15, 2024
1 parent 3abee5e commit fa382d3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/util/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ NodeClock::time_point NodeClock::now() noexcept
return time_point{ret};
};

void SetMockTime(int64_t nMockTimeIn)
{
Assert(nMockTimeIn >= 0);
nMockTime.store(nMockTimeIn, std::memory_order_relaxed);
}

void SetMockTime(int64_t nMockTimeIn) { SetMockTime(std::chrono::seconds{nMockTimeIn}); }
void SetMockTime(std::chrono::seconds mock_time_in)
{
Assert(mock_time_in >= 0s);
nMockTime.store(mock_time_in.count(), std::memory_order_relaxed);
}

Expand Down

0 comments on commit fa382d3

Please sign in to comment.