Page MenuHomePhabricator

Merge #14530: Use RPCHelpMan to generate RPC doc strings
ClosedPublic

Authored by markblundeberg on Feb 10 2020, 14:40.

Details

Summary

Backport PR14530

Pull request description:

This introduces a manager for the RPC help generation and demonstrates its use of it in some RPCs.
...

Backport note:
This change is nice when backporting additional RPC, so we can grab the
RPCHelpMan stuff and keep it in.

Some changes were made as we don't have replaceability or smart fees, otherwise
pretty much just lint differences.

Test Plan

ninja check-all ; read carefully

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pr14530
Lint
Lint Passed
SeverityLocationCodeMessage
Auto-Fixsrc/rpc/util.h:41DOXYGEN1Misplaced inline doxygen comment.
Auto-Fixsrc/rpc/util.h:42DOXYGEN1Misplaced inline doxygen comment.
Auto-Fixsrc/rpc/util.h:44DOXYGEN1Misplaced inline doxygen comment.
Unit
No Test Coverage
Build Status
Buildable 9387
Build 16705: Default Diff Build & Tests
Build 16704: arc lint + arc unit

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those Bitcoin Core PRs have been inserted into the summary for reference.

src/rpc/util.h
41

note: these lint advices are wrong (appeared due to wrapping) ... will fix.

a few examples of the changes:

src/rpc/rawtransaction.cpp
248

changes to:

gettxoutproof ["txid",...] ( "blockhash" )
1019

changes to:

signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","amount":amount},...] "sighashtype" )
src/wallet/rpcwallet.cpp
4024

changes to

listunspent ( minconf maxconf ["address",...] include_unsafe {"minimumAmount":amount,"maximumAmount":amount,"maximumCount":n,"minimumSumAmount":amount} )
5334

changes to

walletcreatefundedpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime {"changeAddress":"hex","changePosition":n,"change_type":"str","includeWatching":bool,"lockUnspents":bool,"feeRate":n,"subtractFeeFromOutputs":[int,...]} bip32derivs )

fix //!< comments to be in front

Fabien requested changes to this revision.Feb 11 2020, 09:54
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/rpc/util.cpp
126 ↗(On Diff #16219)

You should enable clang-tidy :) Missing braces here

137 ↗(On Diff #16219)

Dito.

188 ↗(On Diff #16219)

Dito

src/wallet/rpcwallet.cpp
4515 ↗(On Diff #16219)

STR_HEX ?

5398 ↗(On Diff #16219)

sequence is optional.

This revision now requires changes to proceed.Feb 11 2020, 09:54
src/wallet/rpcwallet.cpp
5426 ↗(On Diff #16219)

Note: this is unsupported, and would fail if passed (out of scope for this diff).
This will require a rebase/removal after the help is fixed.

src/wallet/rpcwallet.cpp
4515 ↗(On Diff #16219)

heh the name is kind of a giveaway isn't it :D

5398 ↗(On Diff #16219)

good catch, it's labelled wrong in Core even still

5426 ↗(On Diff #16219)

I already ripped out various 'replaceable' things so it's fine to remove this too.

braces; drop nonexistent param

actually various wrong params -- moved to D5257

src/rpc/rawtransaction.cpp
1043 ↗(On Diff #16219)

this should just be STR (it's base58 format not base16)

src/wallet/rpcwallet.cpp
4047 ↗(On Diff #16219)

should just be STR

5424 ↗(On Diff #16219)

this should just be STR

This revision is now accepted and ready to land.Feb 11 2020, 12:52