mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 06:09:48 +02:00
rpc: Fail to return undocumented return values
This commit is contained in:
@@ -223,6 +223,7 @@ struct RPCResult {
|
||||
NUM,
|
||||
BOOL,
|
||||
NONE,
|
||||
ANY, //!< Special type to disable type checks (for testing only)
|
||||
STR_AMOUNT, //!< Special string to represent a floating point amount
|
||||
STR_HEX, //!< Special string with only hex chars
|
||||
OBJ_DYN, //!< Special dictionary with keys that are not literals
|
||||
@@ -295,6 +296,8 @@ struct RPCResult {
|
||||
std::string ToStringObj() const;
|
||||
/** Return the description string, including the result type. */
|
||||
std::string ToDescriptionString() const;
|
||||
/** Check whether the result JSON type matches. */
|
||||
bool MatchesType(const UniValue& result) const;
|
||||
};
|
||||
|
||||
struct RPCResults {
|
||||
@@ -333,7 +336,7 @@ public:
|
||||
using RPCMethodImpl = std::function<UniValue(const RPCHelpMan&, const JSONRPCRequest&)>;
|
||||
RPCHelpMan(std::string name, std::string description, std::vector<RPCArg> args, RPCResults results, RPCExamples examples, RPCMethodImpl fun);
|
||||
|
||||
UniValue HandleRequest(const JSONRPCRequest& request);
|
||||
UniValue HandleRequest(const JSONRPCRequest& request) const;
|
||||
std::string ToString() const;
|
||||
/** Return the named args that need to be converted from string to another JSON type */
|
||||
UniValue GetArgMap() const;
|
||||
|
||||
Reference in New Issue
Block a user