Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ static RPCHelpMan getblock()
{RPCResult::Type::ELISION, "", ""}
}},
}},
{RPCResult::Type::OBJ, "proposed", "Proposed parameters. Uninforced. Must be published in full",
{RPCResult::Type::OBJ, "proposed", "Proposed parameters. Unenforced. Must be published in full",
{
{RPCResult::Type::ELISION, "", "same entries as \"current\""}
}},
Expand Down Expand Up @@ -2732,7 +2732,7 @@ static RPCHelpMan scantxoutset()
{RPCResult::Type::STR_HEX, "scriptPubKey", "The script key"},
{RPCResult::Type::STR, "desc", "A specialized descriptor for the matched scriptPubKey"},
{RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " of the unspent output"},
{RPCResult::Type::STR_HEX, "asset", "The asset ID"},
{RPCResult::Type::STR_HEX, "asset", /*optional=*/true, "The asset ID"},
{RPCResult::Type::NUM, "height", "Height of the unspent transaction output"},
}},
}},
Expand Down Expand Up @@ -2776,7 +2776,7 @@ static RPCHelpMan scantxoutset()
throw JSONRPCError(RPC_INVALID_PARAMETER, "Scan already in progress, use action \"abort\" or \"status\"");
}

if (request.params.size() < 2) {
if (request.params[1].isNull()) {
throw JSONRPCError(RPC_MISC_ERROR, "scanobjects argument is required for the start action");
}

Expand Down Expand Up @@ -3101,10 +3101,10 @@ static RPCHelpMan getsidechaininfo()
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "fedpegscript", "The fedpegscript from genesis block"},
{RPCResult::Type::ARR, "current_fedpegscripts", "The currently-enforced fedpegscripts in hex. Peg-ins for any entries on this list are honored by consensus and policy. Newest first. Two total entries are possible",
{{RPCResult::Type::STR_HEX, "", "active fedpegscript"}}},
{RPCResult::Type::ARR, "current_fedpeg_programs", "The currently-enforced fedpegscript scriptPubKeys in hex. Prior to a transition this may be P2SH scriptpubkey, otherwise it will be a native segwit script. Results are paired in-order with current_fedpegscripts",
{{RPCResult::Type::STR_HEX, "", "active fedpegscript scriptPubKeys"}}},
{RPCResult::Type::ARR, "current_fedpegscripts", "The currently-enforced fedpegscripts in hex. Peg-ins for any entries on this list are honored by consensus and policy. Newest first. Two total entries are possible",
{{RPCResult::Type::STR_HEX, "", "active fedpegscript"}}},
{RPCResult::Type::STR_HEX, "pegged_asset", "Pegged asset type"},
{RPCResult::Type::STR, "min_peg_diff", "The minimum difficulty parent chain header target. Peg-in headers that have less work will be rejected as an anti-Dos measure"},
{RPCResult::Type::STR_HEX, "parent_blockhash", "The parent genesis blockhash as source of pegged-in funds"},
Expand Down
14 changes: 7 additions & 7 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,10 @@ static RPCHelpMan getblocktemplate()
RPCResult{"If the proposal was not accepted with mode=='proposal'", RPCResult::Type::STR, "", "According to BIP22"},
RPCResult{"Otherwise", RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ARR, "capabilities", "",
{
{RPCResult::Type::STR, "value", "A supported feature, for example 'proposal'"},
}},
{RPCResult::Type::NUM, "version", "The preferred block version"},
{RPCResult::Type::ARR, "rules", "specific block rules that are to be enforced",
{
Expand All @@ -581,10 +585,6 @@ static RPCHelpMan getblocktemplate()
{
{RPCResult::Type::NUM, "rulename", "identifies the bit number as indicating acceptance and readiness for the named softfork rule"},
}},
{RPCResult::Type::ARR, "capabilities", "",
{
{RPCResult::Type::STR, "value", "A supported feature, for example 'proposal'"},
}},
{RPCResult::Type::NUM, "vbrequired", "bit mask of versionbits the server requires set in submissions"},
{RPCResult::Type::STR, "previousblockhash", "The hash of current highest block"},
{RPCResult::Type::ARR, "transactions", "contents of non-coinbase transactions that should be included in the next block",
Expand Down Expand Up @@ -1393,7 +1393,7 @@ static RPCHelpMan getnewblockhex()
const NodeContext& node = EnsureAnyNodeContext(request.context);
std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(chainman.ActiveChainstate(), *node.mempool, Params()).CreateNewBlock(feeDestinationScript, std::chrono::seconds(required_wait), &proposed, data_commitments.empty() ? nullptr : &data_commitments));
if (!pblocktemplate.get()) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty");
throw JSONRPCError(RPC_INTERNAL_ERROR, "Block template empty");
}

{
Expand Down Expand Up @@ -1433,7 +1433,7 @@ static RPCHelpMan combineblocksigs()
},
},
},
{"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "The hex-encoded witnessScript for the signblockscript"},
{"witnessScript", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "The hex-encoded witnessScript for the signblockscript. Required for dynafed blocks; omitted for non-dynafed blocks."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
Expand Down Expand Up @@ -1514,7 +1514,7 @@ static RPCHelpMan getcompactsketch()
{"block_hex", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Hex serialized block proposal from `getnewblockhex`."},
},
RPCResult{
RPCResult::Type::STR, "sketch", "serialized block sketch",
RPCResult::Type::STR_HEX, "sketch", "serialized block sketch",
},
RPCExamples{
HelpExampleCli("getcompactsketch", ""),
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static RPCHelpMan deriveaddresses()
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, error);
}

if (!desc->IsRange() && request.params.size() > 1) {
if (!desc->IsRange() && !request.params[1].isNull()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Range should not be specified for an un-ranged descriptor");
}

Expand Down
22 changes: 10 additions & 12 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static RPCHelpMan getrawtransaction()
},
{
RPCResult{"if verbose is not set or set to false",
RPCResult::Type::STR, "data", "The serialized, hex-encoded data for 'txid'"
RPCResult::Type::STR_HEX, "data", "The serialized, hex-encoded data for 'txid'"
},
RPCResult{"if verbose is set to true",
RPCResult::Type::OBJ, "", "",
Expand Down Expand Up @@ -812,7 +812,7 @@ static RPCHelpMan combinerawtransaction()
},
},
RPCResult{
RPCResult::Type::STR, "", "The hex-encoded raw transaction with signature(s)"
RPCResult::Type::STR_HEX, "", "The hex-encoded raw transaction with signature(s)"
},
RPCExamples{
HelpExampleCli("combinerawtransaction", R"('["myhex1", "myhex2", "myhex3"]')")
Expand Down Expand Up @@ -893,7 +893,7 @@ static RPCHelpMan signrawtransactionwithkey()
{"hexstring", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction hex string"},
{"privkeys", RPCArg::Type::ARR, RPCArg::Optional::NO, "The base58-encoded private keys for signing",
{
{"privatekey", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "private key in base58-encoding"},
{"privatekey", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "private key in base58-encoding"},
},
},
{"prevtxs", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "The previous dependent transaction outputs",
Expand Down Expand Up @@ -1237,11 +1237,9 @@ static RPCHelpMan decodepsbt()
{RPCResult::Type::NUM, "fallback_locktime", /*optional=*/true, "The locktime to fallback to if no inputs specify a required locktime."},
{RPCResult::Type::NUM, "input_count", /*optional=*/true, "The number of inputs in this psbt"},
{RPCResult::Type::NUM, "output_count", /*optional=*/true, "The number of outputs in this psbt."},
{RPCResult::Type::NUM, "inputs_modifiable", /*optional=*/true, "Whether inputs can be modified"},
{RPCResult::Type::NUM, "outputs_modifiable", /*optional=*/true, "Whether outputs can be modified"},
{RPCResult::Type::ARR, "sighash_single_indexes", /*optional=*/true, "The indexes which have SIGHASH_SINGLE signatures",
{{RPCResult::Type::NUM, "", "Index of an input with a SIGHASH_SINGLE signature"}},
},
{RPCResult::Type::BOOL, "inputs_modifiable", /*optional=*/true, "Whether inputs can be modified"},
{RPCResult::Type::BOOL, "outputs_modifiable", /*optional=*/true, "Whether outputs can be modified"},
{RPCResult::Type::BOOL, "has_sighash_single", /*optional=*/true, "Whether this PSBT has SIGHASH_SINGLE inputs"},
{RPCResult::Type::NUM, "psbt_version", "The PSBT version number. Not to be confused with the unsigned transaction version"},
{RPCResult::Type::OBJ_DYN, "scalar_offsets", /*optional=*/true, "The PSET scalar elements",
{
Expand Down Expand Up @@ -2781,7 +2779,7 @@ static RPCHelpMan rawblindrawtransaction()
"Returns the hex-encoded raw transaction.\n"
"The input raw transaction cannot have already-blinded outputs.\n"
"The output keys used can be specified by using a confidential address in createrawtransaction.\n"
"If an additional blinded output is required to make a balanced blinding, a 0-value unspendable output will be added. Since there is no access to the wallet the blinding pubkey from the last output with blinding key will be repeated.\n"
"If blinded inputs exist but no output has a blinding pubkey, the caller must add another blindable output; this RPC cannot derive a wallet blinding key and will fail instead of adding a dummy output.\n"
"You can not blind issuances with this call.\n",
{
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A hex-encoded raw transaction."},
Expand Down Expand Up @@ -2810,7 +2808,7 @@ static RPCHelpMan rawblindrawtransaction()
{"ignoreblindfail", RPCArg::Type::BOOL, RPCArg::Default{true}, "Return a transaction even when a blinding attempt fails due to number of blinded inputs/outputs."},
},
RPCResult{
RPCResult::Type::STR, "transaction", "hex string of the transaction"
RPCResult::Type::STR_HEX, "transaction", "hex string of the transaction"
},
RPCExamples{""},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
Expand Down Expand Up @@ -2844,7 +2842,7 @@ static RPCHelpMan rawblindrawtransaction()
}
if (inputAmounts.size() != tx.vin.size()) {
throw JSONRPCError(RPC_INVALID_PARAMETER,
"Invalid parameter: one (potentially empty) input blind for each input must be provided");
"Invalid parameter: one (potentially empty) input amount for each input must be provided");
}
if (inputAssets.size() != tx.vin.size()) {
throw JSONRPCError(RPC_INVALID_PARAMETER,
Expand Down Expand Up @@ -2895,7 +2893,7 @@ static RPCHelpMan rawblindrawtransaction()
if (!IsHex(assetblind) || assetblind.length() != 32*2)
throw JSONRPCError(RPC_INVALID_PARAMETER, "input asset blinds must be an array of 32-byte hex-encoded strings");
if (!IsHex(asset) || asset.length() != 32*2)
throw JSONRPCError(RPC_INVALID_PARAMETER, "input asset blinds must be an array of 32-byte hex-encoded strings");
throw JSONRPCError(RPC_INVALID_PARAMETER, "input asset IDs must be an array of 32-byte hex-encoded strings");

input_blinds.push_back(uint256S(blind));
input_asset_blinds.push_back(uint256S(assetblind));
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static RPCHelpMan help()
[&](const RPCHelpMan& self, const JSONRPCRequest& jsonRequest) -> UniValue
{
std::string strCommand;
if (jsonRequest.params.size() > 0) {
if (!jsonRequest.params[0].isNull()) {
strCommand = jsonRequest.params[0].get_str();
}
if (strCommand == "dump_all_command_conversions") {
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/rpc/backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ RPCHelpMan restorewallet()
RPCHelpMan getwalletpakinfo()
{
return RPCHelpMan{"getwalletpakinfo",
"\nReturns relevant pegout authorization key (PAK) information about this wallet. Throws an error if initpegoutwallet` has not been invoked on this wallet.\n",
"\nReturns relevant pegout authorization key (PAK) information about this wallet. Throws an error if `initpegoutwallet` has not been invoked on this wallet.\n",
{},
RPCResult{
RPCResult::Type::OBJ, "", "",
Expand Down Expand Up @@ -2153,7 +2153,7 @@ RPCHelpMan importissuanceblindingkey()
},
RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{
HelpExampleCli("importblindingkey", "\"my blinded CT address\" <blindinghex>")
HelpExampleCli("importissuanceblindingkey", "\"<txid>\" 0 \"<blindingkey>\"")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
Expand Down
14 changes: 7 additions & 7 deletions src/wallet/rpc/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ RPCHelpMan getreceivedbyaddress()
"\nThe amount with at least 6 confirmations\n"
+ HelpExampleCli("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\" 6") +
"\nThe amount with at least 6 confirmations including immature coinbase outputs\n"
+ HelpExampleCli("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\" 6 true") +
+ HelpExampleCli("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\" 6 \"\" true") +
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\", 6")
},
Expand Down Expand Up @@ -177,9 +177,9 @@ RPCHelpMan getreceivedbylabel()
"\nThe amount with at least 6 confirmations\n"
+ HelpExampleCli("getreceivedbylabel", "\"tabby\" 6") +
"\nThe amount with at least 6 confirmations including immature coinbase outputs\n"
+ HelpExampleCli("getreceivedbylabel", "\"tabby\" 6 true") +
+ HelpExampleCli("getreceivedbylabel", "\"tabby\" 6 \"\" true") +
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6, true")
+ HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6, \"\", true")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
Expand Down Expand Up @@ -614,14 +614,14 @@ RPCHelpMan listunspent()
{RPCResult::Type::STR, "scriptPubKey", "the script key"},
{RPCResult::Type::STR_AMOUNT, "amount", "the transaction output amount in " + CURRENCY_UNIT},
{RPCResult::Type::STR_HEX, "amountcommitment", /*optional=*/true, "the transaction output commitment in hex"},
{RPCResult::Type::STR_HEX, "asset", "the transaction output asset in hex"},
{RPCResult::Type::STR_HEX, "asset", /*optional=*/true, "the transaction output asset in hex"},
{RPCResult::Type::STR_HEX, "assetcommitment", /*optional=*/true, "the transaction output asset commitment in hex"},
{RPCResult::Type::STR_HEX, "amountblinder", "the transaction output amount blinding factor in hex"},
{RPCResult::Type::STR_HEX, "assetblinder", "the transaction output asset blinding factor in hex"},
{RPCResult::Type::STR_HEX, "amountblinder", /*optional=*/true, "the transaction output amount blinding factor in hex"},
{RPCResult::Type::STR_HEX, "assetblinder", /*optional=*/true, "the transaction output asset blinding factor in hex"},
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
{RPCResult::Type::NUM, "ancestorcount", /*optional=*/true, "The number of in-mempool ancestor transactions, including this one (if transaction is in the mempool)"},
{RPCResult::Type::NUM, "ancestorsize", /*optional=*/true, "The virtual transaction size of in-mempool ancestors, including this one (if transaction is in the mempool)"},
{RPCResult::Type::STR_AMOUNT, "ancestorfees", /*optional=*/true, "The total fees of in-mempool ancestors (including this one) with fee deltas used for mining priority in " + CURRENCY_ATOM + " (if transaction is in the mempool)"},
{RPCResult::Type::NUM, "ancestorfees", /*optional=*/true, "The total fees of in-mempool ancestors (including this one) with fee deltas used for mining priority in " + CURRENCY_ATOM + " (if transaction is in the mempool)"},
{RPCResult::Type::STR_HEX, "redeemScript", /*optional=*/true, "The redeemScript if scriptPubKey is P2SH"},
{RPCResult::Type::STR, "witnessScript", /*optional=*/true, "witnessScript if the scriptPubKey is P2WSH or P2SH-P2WSH"},
{RPCResult::Type::BOOL, "spendable", "Whether we have the private keys to spend this output"},
Expand Down
Loading
Loading