Page MenuHomePhabricator

Merge #14987: RPCHelpMan: Pass through Result and Examples
AbandonedPublic

Authored by nakihito on Mar 26 2020, 23:53.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

faa1522e5e RPCHelpMan: Pass through Result and Examples (MarcoFalke)

Pull request description:

Passing the rpc result and rpc examples through `RPCHelpMan` makes it clear in what order they appear in the stringified version. Future improvements could then autoformat or autogenerate them.

Tree-SHA512: b32a5c178cc80f50a7e9b93a38e2b26d5994188ecafe9e61bbc599941b44b9b0e4e4be6413d4464fac6e8e73661a191a77d34917f2e6293de19fb59519dd4487

Backport of Core PR14987

Depends on D5571

Test Plan
ninja
./bitcoind
./bitcoin-cli <all rpcs>

Verify the help text is similar to pre-patch

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR14987
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10003
Build 17852: Default Diff Build & Tests
Build 17851: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Mar 26 2020, 23:53

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

Snippet of first build failure:

[23:54:38] :	 [Step 1/1]  class RPCHelpMan {
[23:54:38] :	 [Step 1/1]        ^~~~~~~~~~
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:147:7: note:   candidate expects 1 argument, 4 provided
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:147:7: note: candidate: 'RPCHelpMan::RPCHelpMan(RPCHelpMan&&)'
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:147:7: note:   candidate expects 1 argument, 4 provided
[23:54:38] :	 [Step 1/1] ../src/rpc/blockchain.cpp: In function 'UniValue unparkblock(const Config&, const JSONRPCRequest&)':
[23:54:38] :	 [Step 1/1] ../src/rpc/blockchain.cpp:1979:17: error: no matching function for call to 'RPCResult::RPCResult(<brace-enclosed initializer list>)'
[23:54:38] :	 [Step 1/1]                  },
[23:54:38] :	 [Step 1/1]                  ^
[23:54:38] :	 [Step 1/1] In file included from ../src/rpc/blockchain.cpp:22:
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:119:5: note: candidate: 'RPCResult::RPCResult(std::__cxx11::string, std::__cxx11::string)'
[23:54:38] :	 [Step 1/1]      RPCResult(std::string cond, std::string result)
[23:54:38] :	 [Step 1/1]      ^~~~~~~~~
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:119:5: note:   candidate expects 2 arguments, 0 provided
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:114:14: note: candidate: 'RPCResult::RPCResult(std::__cxx11::string)'
[23:54:38] :	 [Step 1/1]      explicit RPCResult(std::string result)
[23:54:38] :	 [Step 1/1]               ^~~~~~~~~
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:114:14: note:   candidate expects 1 argument, 0 provided
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:110:8: note: candidate: 'RPCResult::RPCResult(const RPCResult&)'
[23:54:38] :	 [Step 1/1]  struct RPCResult {
[23:54:38] :	 [Step 1/1]         ^~~~~~~~~
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:110:8: note:   candidate expects 1 argument, 0 provided
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:110:8: note: candidate: 'RPCResult::RPCResult(RPCResult&&)'
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:110:8: note:   candidate expects 1 argument, 0 provided
[23:54:38] :	 [Step 1/1] ../src/rpc/blockchain.cpp:1983:13: error: no matching function for call to 'RPCHelpMan::RPCHelpMan(<brace-enclosed initializer list>)'
[23:54:38] :	 [Step 1/1]              }.ToString();
[23:54:38] :	 [Step 1/1]              ^
[23:54:38] :	 [Step 1/1] In file included from ../src/rpc/blockchain.cpp:22:
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:149:5: note: candidate: 'RPCHelpMan::RPCHelpMan(std::__cxx11::string, std::__cxx11::string, std::vector<RPCArg>, RPCResults, RPCExamples)'
[23:54:38] :	 [Step 1/1]      RPCHelpMan(std::string name, std::string description,
[23:54:38] :	 [Step 1/1]      ^~~~~~~~~~
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:149:5: note:   conversion of argument 4 would be ill-formed:
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:147:7: note: candidate: 'RPCHelpMan::RPCHelpMan(const RPCHelpMan&)'
[23:54:38] :	 [Step 1/1]  class RPCHelpMan {
[23:54:38] :	 [Step 1/1]        ^~~~~~~~~~
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:147:7: note:   candidate expects 1 argument, 5 provided
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:147:7: note: candidate: 'RPCHelpMan::RPCHelpMan(RPCHelpMan&&)'
[23:54:38] :	 [Step 1/1] ../src/./rpc/util.h:147:7: note:   candidate expects 1 argument, 5 provided
[23:54:38] :	 [Step 1/1] [285/444] Linking C static library src/secp256k1/libsecp256k1.a
[23:54:38] :	 [Step 1/1] [286/444] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[23:54:39] :	 [Step 1/1] [287/444] Building CXX object src/CMakeFiles/server.dir/script/sigcache.cpp.o
[23:54:40] :	 [Step 1/1] [288/444] Building CXX object src/CMakeFiles/server.dir/avalanche.cpp.o
[23:54:41] :	 [Step 1/1] [289/444] Building CXX object src/CMakeFiles/server.dir/rpc/net.cpp.o
[23:54:42] :	 [Step 1/1] [290/444] Building CXX object src/CMakeFiles/server.dir/rpc/mining.cpp.o
[23:54:42] :	 [Step 1/1] [291/444] Building CXX object src/CMakeFiles/server.dir/rpc/misc.cpp.o
[23:54:42] :	 [Step 1/1] [292/444] Building CXX object src/CMakeFiles/server.dir/txdb.cpp.o
[23:54:43] :	 [Step 1/1] [293/444] Building CXX object src/CMakeFiles/server.dir/rpc/server.cpp.o
[23:54:47] :	 [Step 1/1] [294/444] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[23:54:47] :	 [Step 1/1] [295/444] Building CXX object src/CMakeFiles/server.dir/ui_interface.cpp.o
[23:54:49] :	 [Step 1/1] [296/444] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
[23:54:53] :	 [Step 1/1] [297/444] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[23:54:53] :	 [Step 1/1] ninja: build stopped: subcommand failed.
[23:54:53]W:	 [Step 1/1] ++ print_sanitizers_log
[23:54:53]W:	 [Step 1/1] ++ for log in "${SAN_LOG_DIR}"/*.log.*
[23:54:53]W:	 [Step 1/1] ++ echo '*** Output of /tmp/sanitizer_logs/*.log.* ***'
[23:54:53]W:	 [Step 1/1] ++ cat '/tmp/sanitizer_logs/*.log.*'
[23:54:53]W:	 [Step 1/1] cat: '/tmp/sanitizer_logs/*.log.*': No such file or directory
[23:54:53] :	 [Step 1/1] *** Output of /tmp/sanitizer_logs/*.log.* ***
[23:54:53]W:	 [Step 1/1] Process exited with code 1
[23:54:53]E:	 [Step 1/1] Process exited with code 1 (Step: Command Line)

Forgot to squash changes.

See D5809 and others to follow.