Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/util.cpp
Show First 20 Lines • Show All 640 Lines • ▼ Show 20 Lines | switch (m_type) { | ||||
res += "["; | res += "["; | ||||
for (const auto &i : m_inner) { | for (const auto &i : m_inner) { | ||||
res += i.ToString(oneline) + ","; | res += i.ToString(oneline) + ","; | ||||
} | } | ||||
return res + "...]"; | return res + "...]"; | ||||
case Type::OBJ: | case Type::OBJ: | ||||
case Type::OBJ_USER_KEYS: | case Type::OBJ_USER_KEYS: | ||||
// Currently unused, so avoid writing dead code | // Currently unused, so avoid writing dead code | ||||
assert(false); | CHECK_NONFATAL(false); | ||||
// no default case, so the compiler can warn about missing cases | // no default case, so the compiler can warn about missing cases | ||||
} | } | ||||
assert(false); | CHECK_NONFATAL(false); | ||||
} | } | ||||
std::string RPCArg::ToString(const bool oneline) const { | std::string RPCArg::ToString(const bool oneline) const { | ||||
if (oneline && !m_oneline_description.empty()) { | if (oneline && !m_oneline_description.empty()) { | ||||
return m_oneline_description; | return m_oneline_description; | ||||
} | } | ||||
switch (m_type) { | switch (m_type) { | ||||
Show All 23 Lines | switch (m_type) { | ||||
for (const auto &i : m_inner) { | for (const auto &i : m_inner) { | ||||
res += i.ToString(oneline) + ","; | res += i.ToString(oneline) + ","; | ||||
} | } | ||||
return "[" + res + "...]"; | return "[" + res + "...]"; | ||||
} | } | ||||
// no default case, so the compiler can warn about missing cases | // no default case, so the compiler can warn about missing cases | ||||
} | } | ||||
assert(false); | CHECK_NONFATAL(false); | ||||
} | } | ||||
static std::pair<int64_t, int64_t> ParseRange(const UniValue &value) { | static std::pair<int64_t, int64_t> ParseRange(const UniValue &value) { | ||||
if (value.isNum()) { | if (value.isNum()) { | ||||
return {0, value.get_int64()}; | return {0, value.get_int64()}; | ||||
} | } | ||||
if (value.isArray() && value.size() == 2 && value[0].isNum() && | if (value.isArray() && value.size() == 2 && value[0].isNum() && | ||||
value[1].isNum()) { | value[1].isNum()) { | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |