doc: Fix rpc docs

Broken in commit 39d9bbe4ac
This commit is contained in:
MarcoFalke
2022-01-25 19:48:26 +01:00
parent 39d9bbe4ac
commit fac8caaa62
3 changed files with 22 additions and 13 deletions

View File

@@ -240,7 +240,6 @@ struct RPCResult {
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
OBJ_EMPTY, //!< Special type to allow empty OBJ
ARR_FIXED, //!< Special array that has a fixed number of entries
NUM_TIME, //!< Special numeric to denote unix epoch time
ELISION, //!< Special type to denote elision (...)
@@ -268,8 +267,7 @@ struct RPCResult {
m_cond{std::move(cond)}
{
CHECK_NONFATAL(!m_cond.empty());
const bool inner_needed{type == Type::ARR || type == Type::ARR_FIXED || type == Type::OBJ || type == Type::OBJ_DYN};
CHECK_NONFATAL(inner_needed != inner.empty());
CheckInnerDoc();
}
RPCResult(
@@ -293,8 +291,7 @@ struct RPCResult {
m_description{std::move(description)},
m_cond{}
{
const bool inner_needed{type == Type::ARR || type == Type::ARR_FIXED || type == Type::OBJ || type == Type::OBJ_DYN};
CHECK_NONFATAL(inner_needed != inner.empty());
CheckInnerDoc();
}
RPCResult(
@@ -312,6 +309,9 @@ struct RPCResult {
std::string ToDescriptionString() const;
/** Check whether the result JSON type matches. */
bool MatchesType(const UniValue& result) const;
private:
void CheckInnerDoc() const;
};
struct RPCResults {