mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
trivial: add missing rpc help messages, remove segwit references, dashify help text, undashify code comments (#5852)
## Issue being fixed or feature implemented This pull request is a follow-up to [some](https://github.com/dashpay/dash/pull/5834#discussion_r1470105685) [feedback](https://github.com/dashpay/dash/pull/5834#discussion_r1467009815) received on [dash#5834](https://github.com/dashpay/dash/pull/5834) as the patterns highlighted were present in different parts of the codebase and hence not corrected within the PR itself but addressed separately. This is that separate PR 🙂 (with some additional cleanup of my own) ## What was done? * This pull request will remain a draft until [dash#5834](https://github.com/dashpay/dash/pull/5834) as it will introduce more changes that will need to be corrected in this PR. * Code introduced that is unique to Dash Core (CoinJoin, InstantSend, etc.) has been excluded from un-Dashification as the purpose of it is to reduce backport conflicts, which don't apply in those cases. * `CWallet::CreateTransaction` and the `CreateTransactionTest` fixture have been excluded as the former originates from [dash#3668](https://github.com/dashpay/dash/pull/3668) and the latter from [dash#3667](https://github.com/dashpay/dash/pull/3667) and are distinct enough to be unique to Dash Core. * There are certain Dashifications and SegWit-removals that prove frustrating as it would break compatibility with programs that rely on the naming of certain keys * `getrawmempool`, `getmempoolancestors`, `getmempooldescendants` and `getmempoolentry` return `vsize` which is currently an alias of `size`. I have been advised to retain `vsize` in lieu of potential future developments. (this was originally remedied in 219a1d08973e7ccda6e778218b9a8218b4aae034 but has since been dropped) * `getaddressmempool`, `getaddressutxos` and `getaddressdeltas` all return a value with the key `satoshis`. This is frustrating to rename to `duffs` for compatibility reasons. * `decodepsbt` returns (if applicable) `non_witness_utxo` which is frustrating to rename simply to `utxo` for the same reason. * `analyzepsbt` returns (if applicable) `estimated_vsize` which frustrating to rename to `estimated_size` for the same reason. ## How Has This Been Tested? ## Breaking Changes None ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
This commit is contained in:
parent
8dba6559f6
commit
d9c549e541
@ -14,14 +14,14 @@
|
||||
CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)
|
||||
{
|
||||
// "Dust" is defined in terms of dustRelayFee,
|
||||
// which has units duffs-per-kilobyte.
|
||||
// which has units satoshis-per-kilobyte.
|
||||
// If you'd pay more in fees than the value of the output
|
||||
// to spend something, then we consider it dust.
|
||||
// A typical spendable txout is 34 bytes big, and will
|
||||
// need a CTxIn of at least 148 bytes to spend:
|
||||
// so dust is a spendable txout less than
|
||||
// 182*dustRelayFee/1000 (in duffs).
|
||||
// 546 duffs at the default rate of 3000 duff/kB.
|
||||
// 182*dustRelayFee/1000 (in satoshis).
|
||||
// 546 satoshis at the default rate of 3000 sat/kB.
|
||||
if (txout.scriptPubKey.IsUnspendable())
|
||||
return 0;
|
||||
|
||||
|
@ -282,14 +282,14 @@ static UniValue getbestblockhash(const JSONRPCRequest& request)
|
||||
static UniValue getbestchainlock(const JSONRPCRequest& request)
|
||||
{
|
||||
RPCHelpMan{"getbestchainlock",
|
||||
"\nReturns information about the best chainlock. Throws an error if there is no known chainlock yet.",
|
||||
"\nReturns information about the best ChainLock. Throws an error if there is no known ChainLock yet.",
|
||||
{},
|
||||
RPCResult{
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR_HEX, "hash", "The block hash hex-encoded"},
|
||||
{RPCResult::Type::NUM, "height", "The block height or index"},
|
||||
{RPCResult::Type::STR_HEX, "signature", "The chainlock's BLS signature"},
|
||||
{RPCResult::Type::STR_HEX, "signature", "The ChainLock's BLS signature"},
|
||||
{RPCResult::Type::BOOL, "known_block", "True if the block is known by our node"},
|
||||
}},
|
||||
RPCExamples{
|
||||
@ -304,7 +304,7 @@ static UniValue getbestchainlock(const JSONRPCRequest& request)
|
||||
LLMQContext& llmq_ctx = EnsureLLMQContext(node);
|
||||
llmq::CChainLockSig clsig = llmq_ctx.clhandler->GetBestChainLock();
|
||||
if (clsig.IsNull()) {
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to find any chainlock");
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to find any ChainLock");
|
||||
}
|
||||
result.pushKV("blockhash", clsig.getBlockHash().GetHex());
|
||||
result.pushKV("height", clsig.getHeight());
|
||||
@ -877,6 +877,7 @@ static UniValue getblockheader(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
|
||||
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
|
||||
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "The state of the block ChainLock"},
|
||||
}},
|
||||
RPCResult{"for verbose=false",
|
||||
RPCResult::Type::STR_HEX, "", "A string that is serialized, hex-encoded data for block 'hash'"},
|
||||
@ -935,7 +936,7 @@ static UniValue getblockheaders(const JSONRPCRequest& request)
|
||||
RPCResult::Type::ARR, "", "",
|
||||
{{RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR_HEX, "hash", "the block hash (same as provided)"},
|
||||
{RPCResult::Type::STR_HEX, "hash", "The block hash (same as provided)"},
|
||||
{RPCResult::Type::NUM, "confirmations", "The number of confirmations, or -1 if the block is not on the main chain"},
|
||||
{RPCResult::Type::NUM, "height", "The block height or index"},
|
||||
{RPCResult::Type::NUM, "version", "The block version"},
|
||||
@ -950,6 +951,7 @@ static UniValue getblockheaders(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
|
||||
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
|
||||
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "The state of the block ChainLock"},
|
||||
}},
|
||||
}},
|
||||
RPCResult{"for verbose=false",
|
||||
@ -1156,6 +1158,7 @@ static UniValue getblock(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
|
||||
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
|
||||
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "The state of the block ChainLock"},
|
||||
{RPCResult::Type::NUM, "size", "The block size"},
|
||||
{RPCResult::Type::ARR, "tx", "The transaction ids",
|
||||
{{RPCResult::Type::STR_HEX, "", "The transaction id"}}},
|
||||
@ -1459,8 +1462,8 @@ static UniValue gettxout(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::STR_HEX, "hex", ""},
|
||||
{RPCResult::Type::NUM, "reqSigs", "Number of required signatures"},
|
||||
{RPCResult::Type::STR_HEX, "type", "The type, eg pubkeyhash"},
|
||||
{RPCResult::Type::ARR, "addresses", "array of dash addresses",
|
||||
{{RPCResult::Type::STR, "address", "dash address"}}},
|
||||
{RPCResult::Type::ARR, "addresses", "Array of Dash addresses",
|
||||
{{RPCResult::Type::STR, "address", "Dash address"}}},
|
||||
}},
|
||||
{RPCResult::Type::BOOL, "coinbase", "Coinbase or not"},
|
||||
}},
|
||||
@ -1914,7 +1917,7 @@ static UniValue getmempoolinfo(const JSONRPCRequest& request)
|
||||
{
|
||||
{RPCResult::Type::BOOL, "loaded", "True if the mempool is fully loaded"},
|
||||
{RPCResult::Type::NUM, "size", "Current tx count"},
|
||||
{RPCResult::Type::NUM, "bytes", "Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted"},
|
||||
{RPCResult::Type::NUM, "bytes", "Sum of all transaction sizes"},
|
||||
{RPCResult::Type::NUM, "usage", "Total memory usage for the mempool"},
|
||||
{RPCResult::Type::STR_AMOUNT, "total_fee", "Total fees for the mempool in " + CURRENCY_UNIT + ", ignoring modified fees through prioritizetransaction"},
|
||||
{RPCResult::Type::NUM, "maxmempool", "Maximum memory usage for the mempool"},
|
||||
@ -2208,7 +2211,7 @@ static UniValue getblockstats(const JSONRPCRequest& request)
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::NUM, "avgfee", "Average fee in the block"},
|
||||
{RPCResult::Type::NUM, "avgfeerate", "Average feerate (in satoshis per virtual byte)"},
|
||||
{RPCResult::Type::NUM, "avgfeerate", "Average feerate (in duffs per virtual byte)"},
|
||||
{RPCResult::Type::NUM, "avgtxsize", "Average transaction size"},
|
||||
{RPCResult::Type::STR_HEX, "blockhash", "The block hash (to check for potential reorgs)"},
|
||||
{RPCResult::Type::ARR_FIXED, "feerate_percentiles", "Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in duffs per byte)",
|
||||
@ -2222,13 +2225,13 @@ static UniValue getblockstats(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::NUM, "height", "The height of the block"},
|
||||
{RPCResult::Type::NUM, "ins", "The number of inputs (excluding coinbase)"},
|
||||
{RPCResult::Type::NUM, "maxfee", "Maximum fee in the block"},
|
||||
{RPCResult::Type::NUM, "maxfeerate", "Maximum feerate (in satoshis per virtual byte)"},
|
||||
{RPCResult::Type::NUM, "maxfeerate", "Maximum feerate (in duffs per virtual byte)"},
|
||||
{RPCResult::Type::NUM, "maxtxsize", "Maximum transaction size"},
|
||||
{RPCResult::Type::NUM, "medianfee", "Truncated median fee in the block"},
|
||||
{RPCResult::Type::NUM, "mediantime", "The block median time past"},
|
||||
{RPCResult::Type::NUM, "mediantxsize", "Truncated median transaction size"},
|
||||
{RPCResult::Type::NUM, "minfee", "Minimum fee in the block"},
|
||||
{RPCResult::Type::NUM, "minfeerate", "Minimum feerate (in satoshis per virtual byte)"},
|
||||
{RPCResult::Type::NUM, "minfeerate", "Minimum feerate (in duffs per virtual byte)"},
|
||||
{RPCResult::Type::NUM, "mintxsize", "Minimum transaction size"},
|
||||
{RPCResult::Type::NUM, "outs", "The number of outputs"},
|
||||
{RPCResult::Type::NUM, "subsidy", "The block subsidy"},
|
||||
|
@ -45,7 +45,7 @@ static RPCArg GetRpcArg(const std::string& strParamName)
|
||||
static const std::map<std::string, RPCArg> mapParamHelp = {
|
||||
{"collateralAddress",
|
||||
{"collateralAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
|
||||
"The dash address to send the collateral to."}
|
||||
"The Dash address to send the collateral to."}
|
||||
},
|
||||
{"collateralHash",
|
||||
{"collateralHash", RPCArg::Type::STR, RPCArg::Optional::NO,
|
||||
@ -116,17 +116,17 @@ static RPCArg GetRpcArg(const std::string& strParamName)
|
||||
},
|
||||
{"ownerAddress",
|
||||
{"ownerAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
|
||||
"The dash address to use for payee updates and proposal voting.\n"
|
||||
"The Dash address to use for payee updates and proposal voting.\n"
|
||||
"The corresponding private key does not have to be known by your wallet.\n"
|
||||
"The address must be unused and must differ from the collateralAddress."}
|
||||
},
|
||||
{"payoutAddress_register",
|
||||
{"payoutAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
|
||||
"The dash address to use for masternode reward payments."}
|
||||
"The Dash address to use for masternode reward payments."}
|
||||
},
|
||||
{"payoutAddress_update",
|
||||
{"payoutAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
|
||||
"The dash address to use for masternode reward payments.\n"
|
||||
"The Dash address to use for masternode reward payments.\n"
|
||||
"If set to an empty string, the currently active payout address is reused."}
|
||||
},
|
||||
{"proTxHash",
|
||||
|
@ -573,12 +573,12 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
|
||||
{
|
||||
{RPCResult::Type::STR_HEX, "data", "transaction data encoded in hexadecimal (byte-for-byte)"},
|
||||
{RPCResult::Type::STR_HEX, "txid", "transaction id encoded in little-endian hexadecimal"},
|
||||
{RPCResult::Type::STR_HEX, "hash", "hash encoded in little-endian hexadecimal (including witness data)"},
|
||||
{RPCResult::Type::STR_HEX, "hash", "hash encoded in little-endian hexadecimal"},
|
||||
{RPCResult::Type::ARR, "depends", "array of numbers",
|
||||
{
|
||||
{RPCResult::Type::NUM, "", "transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is"},
|
||||
}},
|
||||
{RPCResult::Type::NUM, "fee", "difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one"},
|
||||
{RPCResult::Type::NUM, "fee", "difference in value between transaction inputs and outputs (in duffs); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one"},
|
||||
{RPCResult::Type::NUM, "sigops", "total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any"},
|
||||
}},
|
||||
}},
|
||||
@ -586,7 +586,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
|
||||
{
|
||||
{RPCResult::Type::STR_HEX, "key", "values must be in the coinbase (keys may be ignored)"},
|
||||
}},
|
||||
{RPCResult::Type::NUM, "coinbasevalue", "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)"},
|
||||
{RPCResult::Type::NUM, "coinbasevalue", "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs)"},
|
||||
{RPCResult::Type::STR, "longpollid", "an id to include with a request to longpoll on an update to this template"},
|
||||
{RPCResult::Type::STR, "target", "The hash target"},
|
||||
{RPCResult::Type::NUM_TIME, "mintime", "The minimum timestamp appropriate for the next block time, expressed in " + UNIX_EPOCH_TIME},
|
||||
|
@ -216,15 +216,15 @@ static UniValue sporkupdate(const JSONRPCRequest& request)
|
||||
static UniValue validateaddress(const JSONRPCRequest& request)
|
||||
{
|
||||
RPCHelpMan{"validateaddress",
|
||||
"\nReturn information about the given dash address.\n",
|
||||
"\nReturn information about the given Dash address.\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address to validate"},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to validate"},
|
||||
},
|
||||
RPCResult{
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::BOOL, "isvalid", "If the address is valid or not"},
|
||||
{RPCResult::Type::STR, "address", "The dash address validated"},
|
||||
{RPCResult::Type::STR, "address", "The Dash address validated"},
|
||||
{RPCResult::Type::STR_HEX, "scriptPubKey", "The hex-encoded scriptPubKey generated by the address"},
|
||||
{RPCResult::Type::BOOL, "isscript", "If the key is a script"},
|
||||
{RPCResult::Type::STR, "error", /* optional */ true, "Error message, if any"},
|
||||
@ -441,7 +441,7 @@ static UniValue verifymessage(const JSONRPCRequest& request)
|
||||
RPCHelpMan{"verifymessage",
|
||||
"\nVerify a signed message\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address to use for the signature."},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to use for the signature."},
|
||||
{"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "The signature provided by the signer in base 64 encoding (see signmessage)."},
|
||||
{"message", RPCArg::Type::STR, RPCArg::Optional::NO, "The message that was signed."},
|
||||
},
|
||||
|
@ -373,7 +373,7 @@ static UniValue getaddednodeinfo(const JSONRPCRequest& request)
|
||||
{
|
||||
{RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR, "address", "The dash server IP and port we're connected to"},
|
||||
{RPCResult::Type::STR, "address", "The Dash server IP and port we're connected to"},
|
||||
{RPCResult::Type::STR, "connected", "connection, inbound or outbound"},
|
||||
}},
|
||||
}},
|
||||
|
@ -172,7 +172,7 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
|
||||
{RPCResult::Type::ARR, "addresses", "",
|
||||
{
|
||||
{RPCResult::Type::STR, "address", "dash address"},
|
||||
{RPCResult::Type::STR, "address", "Dash address"},
|
||||
}},
|
||||
}},
|
||||
}},
|
||||
@ -187,7 +187,7 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::NUM, "time", "Same as \"blocktime\""},
|
||||
{RPCResult::Type::BOOL, "instantlock", "Current transaction lock state"},
|
||||
{RPCResult::Type::BOOL, "instantlock_internal", "Current internal transaction lock state"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "he state of the corresponding block chainlock"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block ChainLock"},
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -355,7 +355,7 @@ static UniValue gettxchainlocks(const JSONRPCRequest& request)
|
||||
{
|
||||
RPCHelpMan{
|
||||
"gettxchainlocks",
|
||||
"\nReturns the block height at which each transaction was mined, and indicates whether it is in the mempool, chainlocked, or neither.\n",
|
||||
"\nReturns the block height at which each transaction was mined, and indicates whether it is in the mempool, ChainLocked, or neither.\n",
|
||||
{
|
||||
{"txids", RPCArg::Type::ARR, RPCArg::Optional::NO, "The transaction ids (no more than 100)",
|
||||
{
|
||||
@ -369,7 +369,7 @@ static UniValue gettxchainlocks(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::NUM, "height", "The block height"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "Chainlock status for the block containing the transaction"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block ChainLock"},
|
||||
{RPCResult::Type::BOOL, "mempool", "Mempool status for the transaction"},
|
||||
}},
|
||||
}
|
||||
@ -744,7 +744,7 @@ static UniValue createrawtransaction(const JSONRPCRequest& request)
|
||||
{
|
||||
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
|
||||
{
|
||||
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "A key-value pair. The key (string) is the dash address, the value (float or string) is the amount in " + CURRENCY_UNIT},
|
||||
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "A key-value pair. The key (string) is the Dash address, the value (float or string) is the amount in " + CURRENCY_UNIT},
|
||||
},
|
||||
},
|
||||
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
|
||||
@ -822,7 +822,7 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
|
||||
{RPCResult::Type::ARR, "addresses", "",
|
||||
{
|
||||
{RPCResult::Type::STR, "address", "dash address"},
|
||||
{RPCResult::Type::STR, "address", "Dash address"},
|
||||
}},
|
||||
}},
|
||||
}},
|
||||
@ -875,7 +875,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::NUM, "reqSigs", "The required signatures"},
|
||||
{RPCResult::Type::ARR, "addresses", "",
|
||||
{
|
||||
{RPCResult::Type::STR, "address", "dash address"},
|
||||
{RPCResult::Type::STR, "address", "Dash address"},
|
||||
}},
|
||||
{RPCResult::Type::STR, "p2sh", "address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH)"},
|
||||
}
|
||||
|
@ -798,7 +798,7 @@ UniValue dumpprivkey(const JSONRPCRequest& request)
|
||||
"\nReveals the private key corresponding to 'address'.\n"
|
||||
"Then the importprivkey can be used with this output\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address for the private key"},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address for the private key"},
|
||||
},
|
||||
RPCResult{
|
||||
RPCResult::Type::STR, "key", "The private key"
|
||||
|
@ -245,7 +245,7 @@ UniValue getnewaddress(const JSONRPCRequest& request)
|
||||
{"label", RPCArg::Type::STR, /* default */ "\"\"", "The label name for the address to be linked to. It can also be set to the empty string \"\" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name."},
|
||||
},
|
||||
RPCResult{
|
||||
RPCResult::Type::STR, "address", "The new dash address"
|
||||
RPCResult::Type::STR, "address", "The new Dash address"
|
||||
},
|
||||
RPCExamples{
|
||||
HelpExampleCli("getnewaddress", "")
|
||||
@ -315,7 +315,7 @@ static UniValue setlabel(const JSONRPCRequest& request)
|
||||
RPCHelpMan{"setlabel",
|
||||
"\nSets the label associated with the given address.\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address to be associated with a label."},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to be associated with a label."},
|
||||
{"label", RPCArg::Type::STR, RPCArg::Optional::NO, "The label to assign to the address."},
|
||||
},
|
||||
RPCResult{RPCResult::Type::NONE, "", ""},
|
||||
@ -393,7 +393,7 @@ static UniValue sendtoaddress(const JSONRPCRequest& request)
|
||||
"\nSend an amount to a given address." +
|
||||
HELP_REQUIRING_PASSPHRASE,
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address to send to."},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to send to."},
|
||||
{"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The amount in " + CURRENCY_UNIT + " to send. eg 0.1"},
|
||||
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment used to store what the transaction is for.\n"
|
||||
" This is not part of the transaction, just kept in your wallet."},
|
||||
@ -494,7 +494,7 @@ static UniValue listaddressgroupings(const JSONRPCRequest& request)
|
||||
{
|
||||
{RPCResult::Type::ARR, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR, "address", "The dash address"},
|
||||
{RPCResult::Type::STR, "address", "The Dash address"},
|
||||
{RPCResult::Type::STR_AMOUNT, "amount", "The amount in " + CURRENCY_UNIT},
|
||||
{RPCResult::Type::STR, "label", /* optional */ true, "The label"},
|
||||
}},
|
||||
@ -548,7 +548,7 @@ static UniValue listaddressbalances(const JSONRPCRequest& request)
|
||||
RPCResult{
|
||||
RPCResult::Type::ARR, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR_AMOUNT, "amount", "The dash address and the amount in " + CURRENCY_UNIT},
|
||||
{RPCResult::Type::STR_AMOUNT, "amount", "The Dash address and the amount in " + CURRENCY_UNIT},
|
||||
}
|
||||
},
|
||||
RPCExamples{
|
||||
@ -587,7 +587,7 @@ static UniValue signmessage(const JSONRPCRequest& request)
|
||||
"\nSign a message with the private key of an address" +
|
||||
HELP_REQUIRING_PASSPHRASE,
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address to use for the private key."},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to use for the private key."},
|
||||
{"message", RPCArg::Type::STR, RPCArg::Optional::NO, "The message to create a signature of."},
|
||||
},
|
||||
RPCResult{
|
||||
@ -690,7 +690,7 @@ static UniValue getreceivedbyaddress(const JSONRPCRequest& request)
|
||||
RPCHelpMan{"getreceivedbyaddress",
|
||||
"\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address for transactions."},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address for transactions."},
|
||||
{"minconf", RPCArg::Type::NUM, /* default */ "1", "Only include transactions confirmed at least this many times."},
|
||||
{"addlocked", RPCArg::Type::BOOL, /* default */ "false", "Whether to include transactions locked via InstantSend."},
|
||||
},
|
||||
@ -853,7 +853,7 @@ static UniValue sendmany(const JSONRPCRequest& request)
|
||||
{"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, "Must be set to \"\" for backwards compatibility.", "\"\""},
|
||||
{"amounts", RPCArg::Type::OBJ, RPCArg::Optional::NO, "The addresses and amounts",
|
||||
{
|
||||
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The dash address is the key, the numeric amount (can be string) in " + CURRENCY_UNIT + " is the value"},
|
||||
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The Dash address is the key, the numeric amount (can be string) in " + CURRENCY_UNIT + " is the value"},
|
||||
},
|
||||
},
|
||||
{"minconf", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "Ignored dummy value"},
|
||||
@ -861,7 +861,7 @@ static UniValue sendmany(const JSONRPCRequest& request)
|
||||
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment"},
|
||||
{"subtractfeefrom", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "The addresses.\n"
|
||||
" The fee will be equally deducted from the amount of each selected address.\n"
|
||||
" Those recipients will receive less dash than you enter in their corresponding amount field.\n"
|
||||
" Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
|
||||
" If no addresses are specified here, the sender pays the fee.",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Subtract fee from this address"},
|
||||
@ -978,9 +978,9 @@ UniValue addmultisigaddress(const JSONRPCRequest& request)
|
||||
"If 'label' is specified, assign address to that label.\n",
|
||||
{
|
||||
{"nrequired", RPCArg::Type::NUM, RPCArg::Optional::NO, "The number of required signatures out of the n keys or addresses."},
|
||||
{"keys", RPCArg::Type::ARR, RPCArg::Optional::NO, "The dash addresses or hex-encoded public keys",
|
||||
{"keys", RPCArg::Type::ARR, RPCArg::Optional::NO, "The Dash addresses or hex-encoded public keys",
|
||||
{
|
||||
{"key", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "dash address or hex-encoded public key"},
|
||||
{"key", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Dash address or hex-encoded public key"},
|
||||
},
|
||||
},
|
||||
{"label", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A label to assign the addresses to."},
|
||||
@ -1402,7 +1402,7 @@ static const std::vector<RPCResult> TransactionDescriptionString()
|
||||
"transaction conflicts with the block chain"},
|
||||
{RPCResult::Type::BOOL, "instantlock", "Current transaction lock state. Available for 'send' and 'receive' category of transactions"},
|
||||
{RPCResult::Type::BOOL, "instantlock-internal", "Current internal transaction lock state. Available for 'send' and 'receive' category of transactions"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block chainlock"},
|
||||
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block ChainLock"},
|
||||
{RPCResult::Type::BOOL, "trusted", "Whether we consider the outputs of this unconfirmed transaction safe to spend."},
|
||||
{RPCResult::Type::STR_HEX, "blockhash", "The block hash containing the transaction. Available for 'send' and 'receive'\n"
|
||||
"category of transactions."},
|
||||
@ -1435,7 +1435,7 @@ static UniValue listtransactions(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
|
||||
{
|
||||
{RPCResult::Type::BOOL, "involvesWatchonly", "Only returns true if imported addresses were involved in transaction"},
|
||||
{RPCResult::Type::STR, "address", "The dash address of the transaction. Not present for\n"
|
||||
{RPCResult::Type::STR, "address", "The Dash address of the transaction. Not present for\n"
|
||||
"move transactions (category = move)."},
|
||||
{RPCResult::Type::STR, "category", "The transaction category.\n"
|
||||
"\"send\" Transactions sent.\n"
|
||||
@ -1550,7 +1550,7 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
|
||||
{
|
||||
{RPCResult::Type::BOOL, "involvesWatchonly", "Only returns true if imported addresses were involved in transaction"},
|
||||
{RPCResult::Type::STR, "address", "The dash address of the transaction."},
|
||||
{RPCResult::Type::STR, "address", "The Dash address of the transaction."},
|
||||
{RPCResult::Type::STR, "category", "The transaction category.\n"
|
||||
"\"send\" Transactions sent.\n"
|
||||
"\"coinjoin\" Transactions sent using CoinJoin funds.\n"
|
||||
@ -1689,7 +1689,7 @@ static UniValue gettransaction(const JSONRPCRequest& request)
|
||||
{RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::BOOL, "involvesWatchonly", "Only returns true if imported addresses were involved in transaction"},
|
||||
{RPCResult::Type::STR, "address", "The dash address involved in the transaction."},
|
||||
{RPCResult::Type::STR, "address", "The Dash address involved in the transaction."},
|
||||
{RPCResult::Type::STR, "category", "The transaction category.\n"
|
||||
"\"send\" Transactions sent.\n"
|
||||
"\"coinjoin\" Transactions sent using CoinJoin funds.\n"
|
||||
@ -1896,7 +1896,7 @@ static UniValue walletpassphrase(const JSONRPCRequest& request)
|
||||
{
|
||||
RPCHelpMan{"walletpassphrase",
|
||||
"\nStores the wallet decryption key in memory for 'timeout' seconds.\n"
|
||||
"This is needed prior to performing transactions related to private keys such as sending dash\n"
|
||||
"This is needed prior to performing transactions related to private keys such as sending Dash\n"
|
||||
"\nNote:\n"
|
||||
"Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock\n"
|
||||
"time that overrides the old one.\n",
|
||||
@ -2098,7 +2098,7 @@ static UniValue encryptwallet(const JSONRPCRequest& request)
|
||||
RPCExamples{
|
||||
"\nEncrypt your wallet\n"
|
||||
+ HelpExampleCli("encryptwallet", "\"my pass phrase\"") +
|
||||
"\nNow set the passphrase to use the wallet, such as for signing or sending dash\n"
|
||||
"\nNow set the passphrase to use the wallet, such as for signing or sending Dash\n"
|
||||
+ HelpExampleCli("walletpassphrase", "\"my pass phrase\"") +
|
||||
"\nNow we can do something like sign\n"
|
||||
+ HelpExampleCli("signmessage", "\"address\" \"test message\"") +
|
||||
@ -2146,7 +2146,7 @@ static UniValue lockunspent(const JSONRPCRequest& request)
|
||||
"\nUpdates list of temporarily unspendable outputs.\n"
|
||||
"Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\n"
|
||||
"If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.\n"
|
||||
"A locked transaction output will not be chosen by automatic coin selection, when spending dash.\n"
|
||||
"A locked transaction output will not be chosen by automatic coin selection, when spending Dash.\n"
|
||||
"Manually selected coins are automatically unlocked.\n"
|
||||
"Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\n"
|
||||
"is always cleared (by virtue of process exit) when a node stops or fails.\n"
|
||||
@ -3008,9 +3008,9 @@ static UniValue listunspent(const JSONRPCRequest& request)
|
||||
{
|
||||
{"minconf", RPCArg::Type::NUM, /* default */ "1", "The minimum confirmations to filter"},
|
||||
{"maxconf", RPCArg::Type::NUM, /* default */ "9999999", "The maximum confirmations to filter"},
|
||||
{"addresses", RPCArg::Type::ARR, /* default */ "empty array", "The dash addresses to filter",
|
||||
{"addresses", RPCArg::Type::ARR, /* default */ "empty array", "The Dash addresses to filter",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "dash address"},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Dash address"},
|
||||
},
|
||||
},
|
||||
{"include_unsafe", RPCArg::Type::BOOL, /* default */ "true", "Include outputs that are not safe to spend\n"
|
||||
@ -3034,7 +3034,7 @@ static UniValue listunspent(const JSONRPCRequest& request)
|
||||
{
|
||||
{RPCResult::Type::STR_HEX, "txid", "the transaction id"},
|
||||
{RPCResult::Type::NUM, "vout", "the vout value"},
|
||||
{RPCResult::Type::STR, "address", "the dash address"},
|
||||
{RPCResult::Type::STR, "address", "the Dash address"},
|
||||
{RPCResult::Type::STR, "label", "The associated label, or \"\" for the default label"},
|
||||
{RPCResult::Type::STR, "scriptPubKey", "the script key"},
|
||||
{RPCResult::Type::STR_AMOUNT, "amount", "the transaction output amount in " + CURRENCY_UNIT},
|
||||
@ -3250,7 +3250,7 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
|
||||
CTxDestination dest = DecodeDestination(options["changeAddress"].get_str());
|
||||
|
||||
if (!IsValidDestination(dest)) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "changeAddress must be a valid dash address");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "changeAddress must be a valid Dash address");
|
||||
}
|
||||
|
||||
coinControl.destChange = dest;
|
||||
@ -3329,7 +3329,7 @@ static UniValue fundrawtransaction(const JSONRPCRequest& request)
|
||||
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"},
|
||||
{"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}",
|
||||
{
|
||||
{"changeAddress", RPCArg::Type::STR, /* default */ "pool address", "The dash address to receive the change"},
|
||||
{"changeAddress", RPCArg::Type::STR, /* default */ "pool address", "The Dash address to receive the change"},
|
||||
{"changePosition", RPCArg::Type::NUM, /* default */ "random", "The index of the change output"},
|
||||
{"includeWatching", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Also select inputs which are watch only.\n"
|
||||
"Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,\n"
|
||||
@ -3338,7 +3338,7 @@ static UniValue fundrawtransaction(const JSONRPCRequest& request)
|
||||
{"feeRate", RPCArg::Type::AMOUNT, /* default */ "not set: makes wallet determine the fee", "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
|
||||
{"subtractFeeFromOutputs", RPCArg::Type::ARR, /* default */ "empty array", "The integers.\n"
|
||||
" The fee will be equally deducted from the amount of each specified output.\n"
|
||||
" Those recipients will receive less dash than you enter in their corresponding amount field.\n"
|
||||
" Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
|
||||
" If no outputs are specified here, the sender pays the fee.",
|
||||
{
|
||||
{"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
|
||||
@ -3707,15 +3707,15 @@ static UniValue AddressBookDataToJSON(const CAddressBookData& data, const bool v
|
||||
UniValue getaddressinfo(const JSONRPCRequest& request)
|
||||
{
|
||||
RPCHelpMan{"getaddressinfo",
|
||||
"\nReturn information about the given dash address.\n"
|
||||
"\nReturn information about the given Dash address.\n"
|
||||
"Some of the information will only be present if the address is in the active wallet.\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address for which to get information."},
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address for which to get information."},
|
||||
},
|
||||
RPCResult{
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR, "address", "The dash address validated."},
|
||||
{RPCResult::Type::STR, "address", "The Dash address validated."},
|
||||
{RPCResult::Type::STR_HEX, "scriptPubKey", "The hex-encoded scriptPubKey generated by the address."},
|
||||
{RPCResult::Type::BOOL, "ismine", "If the address is yours."},
|
||||
{RPCResult::Type::BOOL, "iswatchonly", "If the address is watchonly."},
|
||||
@ -4065,7 +4065,7 @@ UniValue walletcreatefundedpsbt(const JSONRPCRequest& request)
|
||||
{
|
||||
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
|
||||
{
|
||||
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "A key-value pair. The key (string) is the dash address, the value (float or string) is the amount in " + CURRENCY_UNIT + ""},
|
||||
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "A key-value pair. The key (string) is the Dash address, the value (float or string) is the amount in " + CURRENCY_UNIT + ""},
|
||||
},
|
||||
},
|
||||
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
|
||||
@ -4078,7 +4078,7 @@ UniValue walletcreatefundedpsbt(const JSONRPCRequest& request)
|
||||
{"locktime", RPCArg::Type::NUM, /* default */ "0", "Raw locktime. Non-0 value also locktime-activates inputs"},
|
||||
{"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "",
|
||||
{
|
||||
{"changeAddress", RPCArg::Type::STR_HEX, /* default */ "pool address", "The dash address to receive the change"},
|
||||
{"changeAddress", RPCArg::Type::STR_HEX, /* default */ "pool address", "The Dash address to receive the change"},
|
||||
{"changePosition", RPCArg::Type::NUM, /* default */ "random", "The index of the change output"},
|
||||
{"includeWatching", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Also select inputs which are watch only"},
|
||||
{"lockUnspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"},
|
||||
|
@ -85,9 +85,9 @@ static const bool DEFAULT_WALLETBROADCAST = true;
|
||||
static const bool DEFAULT_DISABLE_WALLET = false;
|
||||
//! -maxtxfee default
|
||||
static const CAmount DEFAULT_TRANSACTION_MAXFEE = COIN / 10;
|
||||
//! Discourage users to set fees higher than this amount (in duffs) per kB
|
||||
//! Discourage users to set fees higher than this amount (in satoshis) per kB
|
||||
static const CAmount HIGH_TX_FEE_PER_KB = COIN / 100;
|
||||
//! -maxtxfee will warn if called with a higher fee than this amount (in duffs)
|
||||
//! -maxtxfee will warn if called with a higher fee than this amount (in satoshis)
|
||||
static const CAmount HIGH_MAX_TX_FEE = 100 * HIGH_TX_FEE_PER_KB;
|
||||
|
||||
//! if set, all keys will be derived by using BIP39/BIP44
|
||||
|
@ -233,7 +233,7 @@ class LLMQChainLocksTest(DashTestFramework):
|
||||
self.log.info("Add a new node and let it sync")
|
||||
self.dynamically_add_masternode(evo=False)
|
||||
added_idx = len(self.nodes) - 1
|
||||
assert_raises_rpc_error(-32603, "Unable to find any chainlock", self.nodes[added_idx].getbestchainlock)
|
||||
assert_raises_rpc_error(-32603, "Unable to find any ChainLock", self.nodes[added_idx].getbestchainlock)
|
||||
|
||||
self.log.info("Test that new node can mine without Chainlock info")
|
||||
tip_0 = self.nodes[0].getblock(self.nodes[0].getbestblockhash(), 2)
|
||||
|
@ -231,7 +231,7 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||
dec_tx = self.nodes[2].decoderawtransaction(rawtx)
|
||||
assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])
|
||||
|
||||
assert_raises_rpc_error(-5, "changeAddress must be a valid dash address", self.nodes[2].fundrawtransaction, rawtx, {'changeAddress':'foobar'})
|
||||
assert_raises_rpc_error(-5, "changeAddress must be a valid Dash address", self.nodes[2].fundrawtransaction, rawtx, {'changeAddress':'foobar'})
|
||||
|
||||
def test_valid_change_address(self):
|
||||
self.log.info("Test fundrawtxn with a provided change address")
|
||||
|
Loading…
Reference in New Issue
Block a user