-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: multiple help string for RPC result #6886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
cc1a8fd
b174fe0
b216d13
3b4095c
7d6b606
72284b5
661db51
6e89094
690ff3a
9af4c55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,7 +49,9 @@ static RPCHelpMan masternode_connect() | |||||||||||||||||||||||||
| {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The address of the masternode to connect"}, | ||||||||||||||||||||||||||
| {"v2transport", RPCArg::Type::BOOL, RPCArg::DefaultHint{"set by -v2transport"}, "Attempt to connect using BIP324 v2 transport protocol"}, | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCResults{}, | ||||||||||||||||||||||||||
| RPCResult{ | ||||||||||||||||||||||||||
| RPCResult::Type::STR, "status", "Returns 'successfully connected' if successful" | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCExamples{""}, | ||||||||||||||||||||||||||
| [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
|
@@ -85,7 +87,28 @@ static RPCHelpMan masternode_count() | |||||||||||||||||||||||||
| return RPCHelpMan{"masternode count", | ||||||||||||||||||||||||||
| "Get information about number of masternodes.\n", | ||||||||||||||||||||||||||
| {}, | ||||||||||||||||||||||||||
| RPCResults{}, | ||||||||||||||||||||||||||
| RPCResult{ | ||||||||||||||||||||||||||
| RPCResult::Type::OBJ, "", "", | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| {RPCResult::Type::NUM, "total", "Total number of Masternodes"}, | ||||||||||||||||||||||||||
| {RPCResult::Type::NUM, "enabled", "Number of enabled Masternodes"}, | ||||||||||||||||||||||||||
| {RPCResult::Type::OBJ, "details", "Breakdown of masternodes by type", | ||||||||||||||||||||||||||
| {{RPCResult::Type::OBJ, "", "", | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| {RPCResult::Type::OBJ, "regular", "Details for regular masternodes", | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| {RPCResult::Type::NUM, "total", "Total number of regular Masternodes"}, | ||||||||||||||||||||||||||
| {RPCResult::Type::NUM, "enabled", "Number of enabled regular Masternodes"} | ||||||||||||||||||||||||||
| }}, | ||||||||||||||||||||||||||
| {RPCResult::Type::OBJ, "evo", "Details for Evo nodes", | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| {RPCResult::Type::NUM, "total", "Total number of Evo nodes"}, | ||||||||||||||||||||||||||
| {RPCResult::Type::NUM, "enabled", "Number of enabled Evo nodes"} | ||||||||||||||||||||||||||
| }}, | ||||||||||||||||||||||||||
| }}, | ||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCExamples{""}, | ||||||||||||||||||||||||||
| [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
|
@@ -157,7 +180,13 @@ static RPCHelpMan masternode_status() | |||||||||||||||||||||||||
| return RPCHelpMan{"masternode status", | ||||||||||||||||||||||||||
| "Print masternode status information\n", | ||||||||||||||||||||||||||
| {}, | ||||||||||||||||||||||||||
| RPCResults{}, | ||||||||||||||||||||||||||
| RPCResult{ | ||||||||||||||||||||||||||
| RPCResult::Type::OBJ, "", "", | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| // TODO: implement proper type validator instead ELISION | ||||||||||||||||||||||||||
| {RPCResult::Type::ELISION, "", ""} | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCExamples{""}, | ||||||||||||||||||||||||||
| [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
|
@@ -232,7 +261,12 @@ static RPCHelpMan masternode_winners() | |||||||||||||||||||||||||
| {"count", RPCArg::Type::NUM, RPCArg::Default{10}, "number of last winners to return"}, | ||||||||||||||||||||||||||
| {"filter", RPCArg::Type::STR, RPCArg::Default{""}, "filter for returned winners"}, | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCResults{}, | ||||||||||||||||||||||||||
| RPCResult{ | ||||||||||||||||||||||||||
| RPCResult::Type::OBJ_DYN, "", "Keys are block heights (as strings); values describe the payees for that height", | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| {RPCResult::Type::STR, "payee", "Payee for the height"} | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
|
Comment on lines
+264
to
+269
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify that values are comma-separated payment strings, not single payees. The description at line 267 says Apply this diff to clarify: - {RPCResult::Type::STR, "payee", "Payee for the height"}
+ {RPCResult::Type::STR, "payments", "Comma-separated list of payment addresses (masternode payout, operator reward if applicable, and superblock payees if triggered)"}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| RPCExamples{""}, | ||||||||||||||||||||||||||
| [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
|
@@ -454,7 +488,7 @@ static RPCHelpMan masternode_help() | |||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| {"command", RPCArg::Type::STR, RPCArg::Optional::NO, "The command to execute"}, | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCResults{}, | ||||||||||||||||||||||||||
| RPCResult{RPCResult::Type::NONE, "", ""}, | ||||||||||||||||||||||||||
| RPCExamples{""}, | ||||||||||||||||||||||||||
| [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
|
@@ -491,7 +525,13 @@ static RPCHelpMan masternodelist_helper(bool is_composite) | |||||||||||||||||||||||||
| {"mode", RPCArg::Type::STR, RPCArg::DefaultHint{"json"}, "The mode to run list in"}, | ||||||||||||||||||||||||||
| {"filter", RPCArg::Type::STR, RPCArg::Default{""}, "Filter results. Partial match by outpoint by default in all modes, additional matches in some modes are also available"}, | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCResults{}, | ||||||||||||||||||||||||||
| RPCResult{ | ||||||||||||||||||||||||||
| RPCResult::Type::OBJ, "", "", | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| // TODO: implement proper type validator instead ELISION | ||||||||||||||||||||||||||
| {RPCResult::Type::ELISION, "", ""} | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| RPCExamples{""}, | ||||||||||||||||||||||||||
| [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix misleading field description.
The description parameter should describe what the field contains, not show the literal value. Line 115 currently has
"OK"as the description, but it should explain that this field contains the validation status.Apply this diff:
{ - {RPCResult::Type::STR, "Object status", "OK"}, + {RPCResult::Type::STR, "Object status", "Validation status (\"OK\" if valid)"}, }📝 Committable suggestion
🤖 Prompt for AI Agents