doc: Fix RPC result documentation#22798
Conversation
|
Wow. Concept ACK. |
|
If RPC result documentation is fixed in bulk, maybe this can be added: #22430 |
|
Concept ACK |
|
@prayank23 My plan is to auto-generate the RPC examples, so that such issues are impossible. See #22799 for the meta issue. |
|
For reference, if someone wants to export the RPC docs to produce a rendered diff, the following patch might be useful: (dump_dir is a directory created by diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index cf80b08b96..6c6a71c6e4 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -95,7 +95,7 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest&
{
const CRPCCommand *pcmd = command.second;
std::string strMethod = pcmd->name;
- if ((strCommand != "" || pcmd->category == "hidden") && strMethod != strCommand)
+ if ((strCommand != "") && strMethod != strCommand)
continue;
jreq.strMethod = strMethod;
try
diff --git a/test/functional/rpc_help.py b/test/functional/rpc_help.py
index de21f43747..753ee771ad 100755
--- a/test/functional/rpc_help.py
+++ b/test/functional/rpc_help.py
@@ -100,7 +100,7 @@ class HelpRpcTest(BitcoinTestFramework):
# command titles
titles = [line[3:-3] for line in node.help().splitlines() if line.startswith('==')]
- components = ['Blockchain', 'Control', 'Generating', 'Mining', 'Network', 'Rawtransactions', 'Util']
+ components = ['Blockchain', 'Control', 'Generating', 'Hidden', 'Mining', 'Network', 'Rawtransactions', 'Util']
if self.is_wallet_compiled():
components.append('Wallet')
@@ -116,7 +116,8 @@ class HelpRpcTest(BitcoinTestFramework):
def dump_help(self):
dump_dir = os.path.join(self.options.tmpdir, 'rpc_help_dump')
os.mkdir(dump_dir)
- calls = [line.split(' ', 1)[0] for line in self.nodes[0].help().splitlines() if line and not line.startswith('==')]
+ dump_dir = '/tmp/temp_git/' ##HACK
+ calls = [line.split(' ', 1)[0].split('|', 1)[0] for line in self.nodes[0].help().splitlines() if line and not line.startswith('==')]
for call in calls:
with open(os.path.join(dump_dir, call), 'w', encoding='utf-8') as f:
# Make sure the node can generate the help at runtime without crashing |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Herrytheeagle
left a comment
There was a problem hiding this comment.
Properly fixed with the comment integration for clear and understandable codebase
|
Concept ACK |
|
Concept ACK |
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
In decodepsbt, looks like scriptPubKey -> address should also be marked optional.
src/wallet/rpcwallet.cpp
Outdated
There was a problem hiding this comment.
Should be added to signrawtransactionwithkey() as well?
src/rpc/net.cpp
Outdated
There was a problem hiding this comment.
Should startingheight, synced_headers, synced_blocks .... addr_rate_limited be optional as well? They are dependant on fStateStats same as pingwait.
There was a problem hiding this comment.
Strictly they are conditional. Though I think the RPC should be changed to not be racy, unless there is a strong reason for it to prefer to be racy.
fa1d3dd to
fa10fbc
Compare
maflcko
left a comment
There was a problem hiding this comment.
Force pushed to reply to feedback
src/rpc/net.cpp
Outdated
There was a problem hiding this comment.
Strictly they are conditional. Though I think the RPC should be changed to not be racy, unless there is a strong reason for it to prefer to be racy.
src/wallet/rpcwallet.cpp
Outdated
src/rpc/rawtransaction.cpp
Outdated
|
Failing CI can be ignored |
Github-Pull: bitcoin#22798 Rebased-From: fa10fbc
Fix: