mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
rpc: Keep default argument value in correct type
This commit is contained in:
parent
a12962ca89
commit
f81ef4303e
10 changed files with 187 additions and 183 deletions
|
|
@ -646,7 +646,7 @@ std::string RPCArg::GetName() const
|
|||
|
||||
bool RPCArg::IsOptional() const
|
||||
{
|
||||
if (m_fallback.index() == 1) {
|
||||
if (m_fallback.index() != 0) {
|
||||
return true;
|
||||
} else {
|
||||
return RPCArg::Optional::NO != std::get<RPCArg::Optional>(m_fallback);
|
||||
|
|
@ -694,7 +694,9 @@ std::string RPCArg::ToDescriptionString() const
|
|||
} // no default case, so the compiler can warn about missing cases
|
||||
}
|
||||
if (m_fallback.index() == 1) {
|
||||
ret += ", optional, default=" + std::get<std::string>(m_fallback);
|
||||
ret += ", optional, default=" + std::get<RPCArg::DefaultHint>(m_fallback);
|
||||
} else if (m_fallback.index() == 2) {
|
||||
ret += ", optional, default=" + std::get<RPCArg::Default>(m_fallback).write();
|
||||
} else {
|
||||
switch (std::get<RPCArg::Optional>(m_fallback)) {
|
||||
case RPCArg::Optional::OMITTED: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue