From 2447385f47a99e8a9c08c20ff98b7147fe08b7df Mon Sep 17 00:00:00 2001 From: "satsfy (Renato Britto)" Date: Fri, 12 Jun 2026 21:56:34 -0300 Subject: [PATCH] rpc: remove unused RPCResult::Type::ELISION RPCResult::Type::ELISION is not used anymore because it is not machine readable for OpenRPC specs. To prevent future usage, it has been removed. --- src/rpc/util.cpp | 11 ++--------- src/rpc/util.h | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index e96a19b467f..f0afa5c97c5 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -1031,11 +1031,6 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const } switch (m_type) { - case Type::ELISION: { - // Deprecated alias of m_opts.print_elision - sections.PushSection({indent + "..." + maybe_separator, m_description}); - return; - } case Type::ANY: { NONFATAL_UNREACHABLE(); // Only for testing } @@ -1075,7 +1070,7 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const } CHECK_NONFATAL(!m_inner.empty()); CHECK_NONFATAL(elision_has_description(m_inner)); - if (m_type == Type::ARR && m_inner.back().m_type != Type::ELISION && !std::holds_alternative(m_inner.back().m_opts.print_elision)) { + if (m_type == Type::ARR && !std::holds_alternative(m_inner.back().m_opts.print_elision)) { sections.PushSection({indent_next + "...", ""}); } else { // Remove final comma, which would be invalid JSON @@ -1095,7 +1090,7 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const for (const auto& i : m_inner) { i.ToSections(sections, OuterType::OBJ, current_indent + 2); } - if (m_type == Type::OBJ_DYN && m_inner.back().m_type != Type::ELISION) { + if (m_type == Type::OBJ_DYN) { // If the dictionary keys are dynamic, use three dots for continuation sections.PushSection({indent_next + "...", ""}); } else { @@ -1113,7 +1108,6 @@ static std::optional ExpectedType(RPCResult::Type type) { using Type = RPCResult::Type; switch (type) { - case Type::ELISION: case Type::ANY: { return std::nullopt; } @@ -1171,7 +1165,6 @@ UniValue RPCResult::MatchesType(const UniValue& result) const } if (UniValue::VOBJ == result.getType()) { - if (!m_inner.empty() && m_inner.at(0).m_type == Type::ELISION) return true; UniValue errors(UniValue::VOBJ); if (m_type == Type::OBJ_DYN) { const RPCResult& doc_inner{m_inner.at(0)}; // Assume all types are the same, randomly pick the first diff --git a/src/rpc/util.h b/src/rpc/util.h index ce3d507e3b0..9627e945392 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -318,7 +318,6 @@ struct RPCResult { OBJ_DYN, //!< Special dictionary with keys that are not literals 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 (...) }; const Type m_type;