Skip to content

Commit 690ff3a

Browse files
knstUdjinM6coderabbitai[bot]
committed
fix: apply suggestions from code review
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 6e89094 commit 690ff3a

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

src/rpc/governance.cpp

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,7 @@ static RPCHelpMan gobject_deserialize()
8484
{
8585
{"hex_data", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "data in hex string form"},
8686
},
87-
{
88-
RPCResult{
89-
RPCResult::Type::OBJ, "", "Deserialized governance object",
90-
{
91-
// TODO: list fields of output for RPC help instead ELISION
92-
{RPCResult::Type::ELISION, "", ""}
93-
}
94-
},
95-
RPCResult{"for mode = all",
96-
RPCResult::Type::STR, "", "The transaction hash in hex"
97-
},
98-
},
87+
RPCResult{RPCResult::Type::STR, "", "JSON string of the deserialized governance object"},
9988
RPCExamples{""},
10089
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
10190
{
@@ -174,7 +163,7 @@ static RPCHelpMan gobject_prepare()
174163
{"outputHash", RPCArg::Type::STR_HEX, RPCArg::Default{""}, "the single output to submit the proposal fee from"},
175164
{"outputIndex", RPCArg::Type::NUM, RPCArg::Default{0}, "The output index."},
176165
},
177-
{RPCResult{"if object valid", RPCResult::Type::STR, "", "The collateral transaction id (txid)"}},
166+
{RPCResult{"if object valid", RPCResult::Type::STR_HEX, "", "The collateral transaction id (txid)"}},
178167
RPCExamples{""},
179168
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
180169
{
@@ -341,7 +330,7 @@ static RPCHelpMan gobject_submit()
341330
{"data-hex", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "data in hex string form"},
342331
{"fee-txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "txid of the corresponding proposal fee transaction"},
343332
},
344-
RPCResult{RPCResult::Type::STR_HEX, "data", "A string that is serialized, hex-encoded data for the gobject"},
333+
RPCResult{RPCResult::Type::STR_HEX, "hash", "Hash of the submitted governance object"},
345334
RPCExamples{""},
346335
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
347336
{
@@ -886,9 +875,9 @@ static RPCHelpMan gobject_getcurrentvotes()
886875
{"vout", RPCArg::Type::STR, RPCArg::Default{""}, "masternode collateral output index, required if <txid> present"},
887876
},
888877
RPCResult{
889-
RPCResult::Type::OBJ, "", "Map with governance votes",
878+
RPCResult::Type::OBJ_DYN, "", "Keys are hashes of vote, values are votes",
890879
{
891-
{RPCResult::Type::STR, "votehash", "Human-friendly presentation of vote"},
880+
{RPCResult::Type::STR, "votes", "Human-friendly presentation of vote"},
892881
},
893882
},
894883
RPCExamples{""},

src/rpc/masternode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ static RPCHelpMan masternode_winners()
262262
{"filter", RPCArg::Type::STR, RPCArg::Default{""}, "filter for returned winners"},
263263
},
264264
RPCResult{
265-
RPCResult::Type::OBJ, "", "Details about a specific deterministic masternode",
265+
RPCResult::Type::OBJ_DYN, "", "Keys are block heights (as strings); values describe the payees for that height",
266266
{
267-
{RPCResult::Type::STR, "height", "payment string"}
267+
{RPCResult::Type::STR, "payee", "Payee for the height"}
268268
}
269269
},
270270
RPCExamples{""},

0 commit comments

Comments
 (0)