0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

rpc: Rename first arg of generateblock RPC to "output"

This commit is contained in:
MarcoFalke 2020-04-12 17:02:22 -04:00
parent ed3b8eada8
commit fa86a4bbfc
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
2 changed files with 5 additions and 5 deletions

View file

@ -277,19 +277,19 @@ static UniValue generateblock(const JSONRPCRequest& request)
RPCHelpMan{"generateblock", RPCHelpMan{"generateblock",
"\nMine a block with a set of ordered transactions immediately to a specified address or descriptor (before the RPC call returns)\n", "\nMine a block with a set of ordered transactions immediately to a specified address or descriptor (before the RPC call returns)\n",
{ {
{"address/descriptor", RPCArg::Type::STR, RPCArg::Optional::NO, "The address or descriptor to send the newly generated bitcoin to."}, {"output", RPCArg::Type::STR, RPCArg::Optional::NO, "The address or descriptor to send the newly generated bitcoin to."},
{"transactions", RPCArg::Type::ARR, RPCArg::Optional::NO, "An array of hex strings which are either txids or raw transactions.\n" {"transactions", RPCArg::Type::ARR, RPCArg::Optional::NO, "An array of hex strings which are either txids or raw transactions.\n"
"Txids must reference transactions currently in the mempool.\n" "Txids must reference transactions currently in the mempool.\n"
"All transactions must be valid and in valid order, otherwise the block will be rejected.", "All transactions must be valid and in valid order, otherwise the block will be rejected.",
{ {
{"rawtx/txid", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, ""}, {"rawtx/txid", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, ""},
}, },
} },
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
{ {
{RPCResult::Type::STR_HEX, "hash", "hash of generated block"} {RPCResult::Type::STR_HEX, "hash", "hash of generated block"},
} }
}, },
RPCExamples{ RPCExamples{
@ -1188,7 +1188,7 @@ static const CRPCCommand commands[] =
{ "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} }, { "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
{ "generating", "generatetodescriptor", &generatetodescriptor, {"num_blocks","descriptor","maxtries"} }, { "generating", "generatetodescriptor", &generatetodescriptor, {"num_blocks","descriptor","maxtries"} },
{ "generating", "generateblock", &generateblock, {"address","transactions"} }, { "generating", "generateblock", &generateblock, {"output","transactions"} },
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} }, { "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },

View file

@ -23,7 +23,7 @@ class GenerateBlockTest(BitcoinTestFramework):
self.log.info('Generate an empty block to address') self.log.info('Generate an empty block to address')
address = node.getnewaddress() address = node.getnewaddress()
hash = node.generateblock(address, [])['hash'] hash = node.generateblock(output=address, transactions=[])['hash']
block = node.getblock(hash, 2) block = node.getblock(hash, 2)
assert_equal(len(block['tx']), 1) assert_equal(len(block['tx']), 1)
assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['addresses'][0], address) assert_equal(block['tx'][0]['vout'][0]['scriptPubKey']['addresses'][0], address)