mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-26 05:48:20 +01:00
rpc: Throw more user friendly arg type check error
This commit is contained in:
@@ -62,11 +62,6 @@ struct UniValueType {
|
||||
UniValue::VType type;
|
||||
};
|
||||
|
||||
/**
|
||||
* Type-check one argument; throws JSONRPCError if wrong type given.
|
||||
*/
|
||||
void RPCTypeCheckArgument(const UniValue& value, const UniValueType& typeExpected);
|
||||
|
||||
/*
|
||||
Check for expected keys/value types in an Object.
|
||||
*/
|
||||
@@ -214,8 +209,11 @@ struct RPCArg {
|
||||
|
||||
bool IsOptional() const;
|
||||
|
||||
/** Check whether the request JSON type matches. */
|
||||
void MatchesType(const UniValue& request) const;
|
||||
/**
|
||||
* Check whether the request JSON type matches.
|
||||
* Returns true if type matches, or object describing error(s) if not.
|
||||
*/
|
||||
UniValue MatchesType(const UniValue& request) const;
|
||||
|
||||
/** Return the first of all aliases */
|
||||
std::string GetFirstName() const;
|
||||
|
||||
Reference in New Issue
Block a user