Currently a few return values are undocumented. This is causing confusion at the least. See for example #18476
Fix this by treating it as an internal bug to return undocumented return values.
Currently a few return values are undocumented. This is causing confusion at the least. See for example #18476
Fix this by treating it as an internal bug to return undocumented return values.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
No conflicts as of last run.
552- },
553- RPCResult{
554- RPCResult::Type::OBJ, "", "",
555+ },
556+ {
557+ RPCResult{"When mode=='proposal'", RPCResult::Type::STR, "", ""},
The existing docs use single quotes:
So I used that. Also, a lot of RPC clients are implemented in python, which also allows single quotes.
2182- },
2183- RPCResult{
2184- RPCResult::Type::OBJ, "", "",
2185+ },
2186+ {
2187+ RPCResult{"When action=='abort'", RPCResult::Type::BOOL, "", ""},
748+ case Type::STR:
749+ case Type::STR_HEX: {
750+ return UniValue::VSTR == result.getType();
751+ }
752+ case Type::NUM:
753+ case Type::NUM_AMOUNT:
148@@ -149,6 +149,7 @@ static RPCHelpMan help()
149 }
150 if (strCommand == "dump_all_command_conversions") {
151 // Used for testing only, undocumented
152+ const_cast<JSONRPCRequest&>(jsonRequest).mode = JSONRPCRequest::GET_ARGS;
re: #20459 (review)
This is currently safe to do, because JSONRPCRequest isn’t const where it is (copy-)constructed. I don’t like the const_cast myself, but the only alternative I came up with was to change every rpc method with the new signature. Any other ideas? Maybe @ryanofsky
I think it would be better add ANY to list of acceptable result types: 4d692e282d404ce3d25a51261a1c6958ebd8b196 (tag). Advantages of this approach:
GET_ARGS
can still mean “get arguments” instead of “get arguments and ignore result type”