diff --git a/src/rpc/util.h b/src/rpc/util.h --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -106,6 +106,8 @@ AMOUNT, //! Special type that is a STR with only hex chars STR_HEX, + //! Special type that is a NUM or [NUM,NUM] + RANGE, }; enum class Optional { diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -337,6 +337,7 @@ case RPCArg::Type::STR: case RPCArg::Type::NUM: case RPCArg::Type::AMOUNT: + case RPCArg::Type::RANGE: case RPCArg::Type::BOOL: { // Nothing more to do for non-recursive types on first recursion if (outer_type == OuterType::NAMED_ARG) { @@ -566,6 +567,10 @@ ret += "numeric or string"; break; } + case Type::RANGE: { + ret += "numeric or array"; + break; + } case Type::BOOL: { ret += "boolean"; break; @@ -625,6 +630,8 @@ return res + "\"hex\""; case Type::NUM: return res + "n"; + case Type::RANGE: + return res + "n or [n,n]"; case Type::AMOUNT: return res + "amount"; case Type::BOOL: @@ -656,6 +663,7 @@ return "\"" + m_name + "\""; } case Type::NUM: + case Type::RANGE: case Type::AMOUNT: case Type::BOOL: { return m_name;