mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge e35e118656 into merged_master (Bitcoin PR #18508)
This commit is contained in:
commit
23ff87c258
1 changed files with 6 additions and 6 deletions
|
|
@ -617,11 +617,11 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
|
|||
switch (m_type) {
|
||||
case Type::ELISION: {
|
||||
// If the inner result is empty, use three dots for elision
|
||||
sections.PushSection({indent_next + "...", m_description});
|
||||
sections.PushSection({indent + "..." + maybe_separator, m_description});
|
||||
return;
|
||||
}
|
||||
case Type::NONE: {
|
||||
sections.PushSection({indent + "None", Description("json null")});
|
||||
sections.PushSection({indent + "null" + maybe_separator, Description("json null")});
|
||||
return;
|
||||
}
|
||||
case Type::STR: {
|
||||
|
|
@ -654,10 +654,10 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
|
|||
for (const auto& i : m_inner) {
|
||||
i.ToSections(sections, OuterType::ARR, current_indent + 2);
|
||||
}
|
||||
if (m_type == Type::ARR) {
|
||||
CHECK_NONFATAL(!m_inner.empty());
|
||||
if (m_type == Type::ARR && m_inner.back().m_type != Type::ELISION) {
|
||||
sections.PushSection({indent_next + "...", ""});
|
||||
} else {
|
||||
CHECK_NONFATAL(!m_inner.empty());
|
||||
// Remove final comma, which would be invalid JSON
|
||||
sections.m_sections.back().m_left.pop_back();
|
||||
}
|
||||
|
|
@ -670,11 +670,11 @@ 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) {
|
||||
CHECK_NONFATAL(!m_inner.empty());
|
||||
if (m_type == Type::OBJ_DYN && m_inner.back().m_type != Type::ELISION) {
|
||||
// If the dictionary keys are dynamic, use three dots for continuation
|
||||
sections.PushSection({indent_next + "...", ""});
|
||||
} else {
|
||||
CHECK_NONFATAL(!m_inner.empty());
|
||||
// Remove final comma, which would be invalid JSON
|
||||
sections.m_sections.back().m_left.pop_back();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue