aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-01-25 19:48:26 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-01-25 20:05:44 +0100
commitfac8caaa6252c6e18301a263d325d63197062639 (patch)
tree7b4e5d71b0129733cb82148afcbd0452355e165b /src/rpc/util.h
parent39d9bbe4acd7441aa9a61c57b76d887c4225a0e2 (diff)
downloadbitcoin-fac8caaa6252c6e18301a263d325d63197062639.tar.xz
doc: Fix rpc docs
Broken in commit 39d9bbe4acd7441aa9a61c57b76d887c4225a0e2
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r--src/rpc/util.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h
index 352a3e4e4e..25ebf78fa1 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -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 {