mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
Add SetMockTime for time_point types
This commit is contained in:
@@ -38,6 +38,7 @@ NodeClock::time_point NodeClock::now() noexcept
|
||||
};
|
||||
|
||||
void SetMockTime(int64_t nMockTimeIn) { SetMockTime(std::chrono::seconds{nMockTimeIn}); }
|
||||
void SetMockTime(std::chrono::time_point<NodeClock, std::chrono::seconds> mock) { SetMockTime(mock.time_since_epoch()); }
|
||||
void SetMockTime(std::chrono::seconds mock_time_in)
|
||||
{
|
||||
Assert(mock_time_in >= 0s);
|
||||
|
||||
@@ -107,6 +107,7 @@ void SetMockTime(int64_t nMockTimeIn);
|
||||
|
||||
/** For testing. Set e.g. with the setmocktime rpc, or -mocktime argument */
|
||||
void SetMockTime(std::chrono::seconds mock_time_in);
|
||||
void SetMockTime(std::chrono::time_point<NodeClock, std::chrono::seconds> mock);
|
||||
|
||||
/** For testing */
|
||||
std::chrono::seconds GetMockTime();
|
||||
|
||||
Reference in New Issue
Block a user