mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
util: refactor: Remove deprecated SetMockTime(i64) alias
The deprecated test-only alias is only used in three places and required in none. So remove it.
This commit is contained in:
@@ -69,7 +69,7 @@ static RPCMethod setmocktime()
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime must be in the range [0, %s], not %s.", max_time, time));
|
||||
}
|
||||
|
||||
SetMockTime(time);
|
||||
SetMockTime(std::chrono::seconds{time});
|
||||
const NodeContext& node_context{EnsureAnyNodeContext(request.context)};
|
||||
for (const auto& chain_client : node_context.chain_clients) {
|
||||
chain_client->setMockTime(time);
|
||||
|
||||
@@ -100,7 +100,7 @@ static void initialize()
|
||||
SeedRandomStateForTest(SeedRand::ZEROS);
|
||||
|
||||
// Set time to the genesis block timestamp for deterministic initialization.
|
||||
SetMockTime(1231006505);
|
||||
SetMockTime(1231006505s);
|
||||
|
||||
// Terminate immediately if a fuzzing harness ever tries to create a socket.
|
||||
// Individual tests can override this by pointing CreateSock to a mocked alternative.
|
||||
|
||||
@@ -49,7 +49,6 @@ NodeClock::time_point NodeClock::now() noexcept
|
||||
return time_point{ret};
|
||||
};
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -112,14 +112,6 @@ using MillisecondsDouble = std::chrono::duration<double, std::chrono::millisecon
|
||||
*/
|
||||
int64_t GetTime();
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
* Use SetMockTime with chrono type
|
||||
*
|
||||
* @param[in] nMockTimeIn Time in seconds.
|
||||
*/
|
||||
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);
|
||||
|
||||
@@ -562,7 +562,7 @@ public:
|
||||
return StartWallets(m_context);
|
||||
}
|
||||
void stop() override { return UnloadWallets(m_context); }
|
||||
void setMockTime(int64_t time) override { return SetMockTime(time); }
|
||||
void setMockTime(int64_t time) override { return SetMockTime(std::chrono::seconds{time}); }
|
||||
void schedulerMockForward(std::chrono::seconds delta) override { Assert(m_context.scheduler)->MockForward(delta); }
|
||||
|
||||
//! WalletLoader methods
|
||||
|
||||
Reference in New Issue
Block a user