fix: wrong name of arguments for RPC

This commit is contained in:
Konstantin Akimov 2024-02-26 22:38:48 +07:00 committed by pasta
parent c30c8f22dd
commit af9eb81e56
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
4 changed files with 5 additions and 5 deletions

View File

@ -964,7 +964,7 @@ static RPCHelpMan getblockheaders()
"\nIf verbose is false, each item is a string that is serialized, hex-encoded data for a single blockheader.\n"
"If verbose is true, each item is an Object with information about a single blockheader.\n",
{
{"hash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"count", RPCArg::Type::NUM, /* default */ strprintf("%s", MAX_HEADERS_RESULTS), ""},
{"verbose", RPCArg::Type::BOOL, /* default */ "true", "true for a json object, false for the hex-encoded data"},
},
@ -1100,7 +1100,7 @@ static RPCHelpMan getmerkleblocks()
"\nReturns an array of hex-encoded merkleblocks for <count> blocks starting from <hash> which match <filter>.\n",
{
{"filter", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded bloom filter"},
{"hash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"count", RPCArg::Type::NUM, /* default */ strprintf("%s", MAX_HEADERS_RESULTS), ""},
},
RPCResult{

View File

@ -109,7 +109,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "gettransaction", 1, "include_watchonly" },
{ "gettransaction", 2, "verbose" },
{ "getrawtransaction", 1, "verbose" },
{ "getrawtransactionmulti", 0, "txid_map" },
{ "getrawtransactionmulti", 0, "transactions" },
{ "getrawtransactionmulti", 1, "verbose" },
{ "gettxchainlocks", 0, "txids" },
{ "createrawtransaction", 0, "inputs" },

View File

@ -2076,7 +2076,7 @@ static const CRPCCommand commands[] =
// --------------------- ------------------------ ----------------------- ----------
{ "rawtransactions", "getassetunlockstatuses", &getassetunlockstatuses, {"indexes","height"} },
{ "rawtransactions", "getrawtransaction", &getrawtransaction, {"txid","verbose","blockhash"} },
{ "rawtransactions", "getrawtransactionmulti", &getrawtransactionmulti, {"txid_map","verbose"} },
{ "rawtransactions", "getrawtransactionmulti", &getrawtransactionmulti, {"transactions","verbose"} },
{ "rawtransactions", "gettxchainlocks", &gettxchainlocks, {"txids"} },
{ "rawtransactions", "createrawtransaction", &createrawtransaction, {"inputs","outputs","locktime"} },
{ "rawtransactions", "decoderawtransaction", &decoderawtransaction, {"hexstring"} },

View File

@ -339,7 +339,7 @@ class RawTransactionsTest(BitcoinTestFramework):
# 5. valid parameters - supply txid and True for non-verbose
assert_equal(self.nodes[0].getrawtransaction(txId, True)["hex"], rawTxSigned['hex'])
assert_equal(self.nodes[0].getrawtransactionmulti({"0":[txId]}, True)[txId]['hex'], rawTxSigned['hex'])
assert_equal(self.nodes[0].getrawtransactionmulti(verbose=True, transactions={"0":[txId]})[txId]['hex'], rawTxSigned['hex'])
# 6. invalid parameters - supply txid and string "Flase"
assert_raises_rpc_error(-1, "not a boolean", self.nodes[0].getrawtransaction, txId, "Flase")