aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index d476feb962..fbd51784a7 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -418,7 +418,11 @@ struct Sections {
};
RPCHelpMan::RPCHelpMan(std::string name, std::string description, std::vector<RPCArg> args, RPCResults results, RPCExamples examples)
+ : RPCHelpMan{std::move(name), std::move(description), std::move(args), std::move(results), std::move(examples), nullptr} {}
+
+RPCHelpMan::RPCHelpMan(std::string name, std::string description, std::vector<RPCArg> args, RPCResults results, RPCExamples examples, RPCMethodImpl fun)
: m_name{std::move(name)},
+ m_fun{std::move(fun)},
m_description{std::move(description)},
m_args{std::move(args)},
m_results{std::move(results)},
@@ -467,6 +471,16 @@ bool RPCHelpMan::IsValidNumArgs(size_t num_args) const
}
return num_required_args <= num_args && num_args <= m_args.size();
}
+
+std::vector<std::string> RPCHelpMan::GetArgNames() const
+{
+ std::vector<std::string> ret;
+ for (const auto& arg : m_args) {
+ ret.emplace_back(arg.m_names);
+ }
+ return ret;
+}
+
std::string RPCHelpMan::ToString() const
{
std::string ret;