Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 434 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"setmocktime", | "setmocktime", | ||||
"Set the local time to given timestamp (-regtest only)\n", | "Set the local time to given timestamp (-regtest only)\n", | ||||
{ | { | ||||
{"timestamp", RPCArg::Type::NUM, RPCArg::Optional::NO, | {"timestamp", RPCArg::Type::NUM, RPCArg::Optional::NO, | ||||
UNIX_EPOCH_TIME + | UNIX_EPOCH_TIME + | ||||
"\n" | "\n" | ||||
" Pass 0 to go back to using the system time."}, | " Pass 0 to go back to using the system time."}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{""}, | RPCExamples{""}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
if (!config.GetChainParams().IsMockableChain()) { | if (!config.GetChainParams().IsMockableChain()) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"setmocktime for regression testing (-regtest mode) only"); | "setmocktime for regression testing (-regtest mode) only"); | ||||
} | } | ||||
Show All 26 Lines | static UniValue mockscheduler(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"mockscheduler", | "mockscheduler", | ||||
"Bump the scheduler into the future (-regtest only)\n", | "Bump the scheduler into the future (-regtest only)\n", | ||||
{ | { | ||||
{"delta_time", RPCArg::Type::NUM, RPCArg::Optional::NO, | {"delta_time", RPCArg::Type::NUM, RPCArg::Optional::NO, | ||||
"Number of seconds to forward the scheduler into the future."}, | "Number of seconds to forward the scheduler into the future."}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{""}, | RPCExamples{""}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
if (!Params().IsMockableChain()) { | if (!Params().IsMockableChain()) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"mockscheduler is for regression testing (-regtest mode) only"); | "mockscheduler is for regression testing (-regtest mode) only"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | if (request.fHelp) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"echo|echojson ...", | "echo|echojson ...", | ||||
"Simply echo back the input arguments. This command is for " | "Simply echo back the input arguments. This command is for " | ||||
"testing.\n" | "testing.\n" | ||||
"\nThe difference between echo and echojson is that echojson has " | "\nThe difference between echo and echojson is that echojson has " | ||||
"argument conversion enabled in the client-side table in " | "argument conversion enabled in the client-side table in " | ||||
"bitcoin-cli and the GUI. There is no server-side difference.", | "bitcoin-cli and the GUI. There is no server-side difference.", | ||||
{}, | {}, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", | ||||
"Returns whatever was passed in"}, | |||||
RPCExamples{""}, | RPCExamples{""}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
CHECK_NONFATAL(request.params.size() != 100); | CHECK_NONFATAL(request.params.size() != 100); | ||||
return request.params; | return request.params; | ||||
Show All 28 Lines |