mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #18531: rpc: remove deprecated CRPCCommand constructor
faaf9c58e4remove CRPCCommand constructor that takes rpcfn_type function pointer (MarcoFalke)fa19bb2cd8remove dead rpc code (MarcoFalke) Pull request description: Remove the CRPCCommand arguments, now that they are asserted to be equal and thus redundant ### Future work > Here or follow up, makes sense to also assert type of returned UniValue? Sure, but let's not get ahead of ourselves. I am going to submit any further works as follow-ups, including: * Removing all python regex linters on the args, now that RPCMan can be used to generate any output, including the cli.cpp table * Auto-formatting and sanity checking the RPCExamples with RPCMan * Checking passed-in json in self-check. Removing redundant checks * Checking returned json against documentation to avoid regressions or false documentation * Compile the RPC documentation at compile-time to ensure it doesn't change at runtime and is completely static ### Bugs found * The assert identified issue #18607 * The changes itself fixed bug #19250 ACKs for top commit: fjahr: tested ACKfaaf9c58e4promag: Tested ACKfaaf9c58e4. ryanofsky: Code review ACKfaaf9c58e4. Two obviously good simplifications. Tree-SHA512: 5de3b440f7b2ed2c3e86655d4f0e2e5df9c67e8ce3c7817d5ea5311d1a38690f2f3e28fab41aad6936be9fc884326d037e5f19e85d4d2fe281474dada13911ee
This commit is contained in:
@@ -242,12 +242,7 @@ static RPCHelpMan generatetodescriptor()
|
||||
static RPCHelpMan generate()
|
||||
{
|
||||
return RPCHelpMan{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
|
||||
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error(self.ToString());
|
||||
} else {
|
||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, self.ToString());
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user