0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-04 10:07:27 -05:00
bitcoin-bitcoin-core/src/rpc
Wladimir J. van der Laan dabab06a1a
Merge #19455: rpc generate: print useful help and error message
f0aa8aeea5 test: add rpc_generate functional test (Jon Atack)
92d94ffb8d rpc: print useful help and error message for generate (Jon Atack)
8d32d2011d test: consider generate covered in _get_uncovered_rpc_commands() (Jon Atack)

Pull request description:

  This was a requested follow-up to #19133 and #17700 to alleviate confusion and head-scratching by people following tutorials that use `generate`. See https://github.com/bitcoin/bitcoin/pull/19455#issuecomment-668172916 below, https://github.com/bitcoin/bitcoin/pull/19133#issuecomment-636860943 and https://github.com/bitcoin/bitcoin/pull/17700#issuecomment-566159096.

  before
  ```
  $ bitcoin-cli help generate
  help: unknown command: generate

  $ bitcoin-cli generate
  error code: -32601
  error message:
  Method not found
  ```

  after
  ```
  $ bitcoin-cli help generate
  generate ( nblocks maxtries ) has been replaced by the -generate cli option. Refer to -help for more information.

  $ bitcoin-cli generate
  error code: -32601
  error message:
  generate ( nblocks maxtries ) has been replaced by the -generate cli option. Refer to -help for more information.
  ```

  In the general help it remains hidden, as requested by laanwj.
  ```
  $ bitcoin-cli help

  == Generating ==
  generateblock "output" ["rawtx/txid",...]
  generatetoaddress nblocks "address" ( maxtries )
  generatetodescriptor num_blocks "descriptor" ( maxtries )
  ```

ACKs for top commit:
  adamjonas:
    utACK f0aa8aeea5
  pinheadmz:
    ACK f0aa8aeea5

Tree-SHA512: d083652589ad3e8228c733455245001db22397559c3946e7e573cf9bd01c46e9e88b72d934728ec7f4361436ae4c74adb8f579670b09f479011924357e729af5
2020-08-14 11:29:05 +02:00
..
blockchain.cpp refactor: Use C++11 range based for loops to simplify rpc code 2020-08-02 21:32:36 +02:00
blockchain.h validation: Make ProcessNewBlock*() members of ChainstateManager 2020-05-21 09:56:16 -04:00
client.cpp Merge #18654: rpc: separate bumpfee's psbt creation function into psbtbumpfee 2020-08-13 12:21:11 +12:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp Merge #19455: rpc generate: print useful help and error message 2020-08-14 11:29:05 +02:00
mining.h rpc: create rpc/mining.h, hoist default max tries values to constant 2020-06-01 15:08:36 +02:00
misc.cpp rpc: Assert that RPCArg names are equal to CRPCCommand ones (misc) 2020-08-02 21:33:27 +02:00
net.cpp Merge #19528: rpc: Assert that RPCArg names are equal to CRPCCommand ones (misc) 2020-08-14 09:26:37 +02:00
protocol.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
rawtransaction.cpp Merge #19528: rpc: Assert that RPCArg names are equal to CRPCCommand ones (misc) 2020-08-14 09:26:37 +02:00
rawtransaction_util.cpp refactor: Replace HexStr(o.begin(), o.end()) with HexStr(o) 2020-06-24 18:41:45 +02:00
rawtransaction_util.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
register.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
request.cpp refactor: Make HexStr take a span 2020-08-06 19:41:43 +02:00
request.h Remove g_rpc_chain global 2020-05-28 02:13:19 -04:00
server.cpp refactor: Use C++11 range based for loops to simplify rpc code 2020-08-02 21:32:36 +02:00
server.h rpc: Assert that passed arg names are equal to hardcoded ones 2020-07-03 10:32:36 -04:00
util.cpp Merge #19528: rpc: Assert that RPCArg names are equal to CRPCCommand ones (misc) 2020-08-14 09:26:37 +02:00
util.h Merge #19386: rpc: Assert that RPCArg names are equal to CRPCCommand ones (server) 2020-07-15 19:20:21 +02:00