Skip to content

Commit d9c549e

Browse files
authored
trivial: add missing rpc help messages, remove segwit references, dashify help text, undashify code comments (dashpay#5852)
## Issue being fixed or feature implemented This pull request is a follow-up to [some](dashpay#5834 (comment)) [feedback](dashpay#5834 (comment)) received on [dash#5834](dashpay#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](dashpay#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](dashpay#3668) and the latter from [dash#3667](dashpay#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 219a1d0 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)_
1 parent 8dba655 commit d9c549e

File tree

12 files changed

+69
-66
lines changed

12 files changed

+69
-66
lines changed

src/policy/policy.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)
1515
{
1616
// "Dust" is defined in terms of dustRelayFee,
17-
// which has units duffs-per-kilobyte.
17+
// which has units satoshis-per-kilobyte.
1818
// If you'd pay more in fees than the value of the output
1919
// to spend something, then we consider it dust.
2020
// A typical spendable txout is 34 bytes big, and will
2121
// need a CTxIn of at least 148 bytes to spend:
2222
// so dust is a spendable txout less than
23-
// 182*dustRelayFee/1000 (in duffs).
24-
// 546 duffs at the default rate of 3000 duff/kB.
23+
// 182*dustRelayFee/1000 (in satoshis).
24+
// 546 satoshis at the default rate of 3000 sat/kB.
2525
if (txout.scriptPubKey.IsUnspendable())
2626
return 0;
2727

src/rpc/blockchain.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,14 @@ static UniValue getbestblockhash(const JSONRPCRequest& request)
282282
static UniValue getbestchainlock(const JSONRPCRequest& request)
283283
{
284284
RPCHelpMan{"getbestchainlock",
285-
"\nReturns information about the best chainlock. Throws an error if there is no known chainlock yet.",
285+
"\nReturns information about the best ChainLock. Throws an error if there is no known ChainLock yet.",
286286
{},
287287
RPCResult{
288288
RPCResult::Type::OBJ, "", "",
289289
{
290290
{RPCResult::Type::STR_HEX, "hash", "The block hash hex-encoded"},
291291
{RPCResult::Type::NUM, "height", "The block height or index"},
292-
{RPCResult::Type::STR_HEX, "signature", "The chainlock's BLS signature"},
292+
{RPCResult::Type::STR_HEX, "signature", "The ChainLock's BLS signature"},
293293
{RPCResult::Type::BOOL, "known_block", "True if the block is known by our node"},
294294
}},
295295
RPCExamples{
@@ -304,7 +304,7 @@ static UniValue getbestchainlock(const JSONRPCRequest& request)
304304
LLMQContext& llmq_ctx = EnsureLLMQContext(node);
305305
llmq::CChainLockSig clsig = llmq_ctx.clhandler->GetBestChainLock();
306306
if (clsig.IsNull()) {
307-
throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to find any chainlock");
307+
throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to find any ChainLock");
308308
}
309309
result.pushKV("blockhash", clsig.getBlockHash().GetHex());
310310
result.pushKV("height", clsig.getHeight());
@@ -877,6 +877,7 @@ static UniValue getblockheader(const JSONRPCRequest& request)
877877
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
878878
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
879879
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
880+
{RPCResult::Type::BOOL, "chainlock", "The state of the block ChainLock"},
880881
}},
881882
RPCResult{"for verbose=false",
882883
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)
935936
RPCResult::Type::ARR, "", "",
936937
{{RPCResult::Type::OBJ, "", "",
937938
{
938-
{RPCResult::Type::STR_HEX, "hash", "the block hash (same as provided)"},
939+
{RPCResult::Type::STR_HEX, "hash", "The block hash (same as provided)"},
939940
{RPCResult::Type::NUM, "confirmations", "The number of confirmations, or -1 if the block is not on the main chain"},
940941
{RPCResult::Type::NUM, "height", "The block height or index"},
941942
{RPCResult::Type::NUM, "version", "The block version"},
@@ -950,6 +951,7 @@ static UniValue getblockheaders(const JSONRPCRequest& request)
950951
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
951952
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
952953
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
954+
{RPCResult::Type::BOOL, "chainlock", "The state of the block ChainLock"},
953955
}},
954956
}},
955957
RPCResult{"for verbose=false",
@@ -1156,6 +1158,7 @@ static UniValue getblock(const JSONRPCRequest& request)
11561158
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
11571159
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
11581160
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
1161+
{RPCResult::Type::BOOL, "chainlock", "The state of the block ChainLock"},
11591162
{RPCResult::Type::NUM, "size", "The block size"},
11601163
{RPCResult::Type::ARR, "tx", "The transaction ids",
11611164
{{RPCResult::Type::STR_HEX, "", "The transaction id"}}},
@@ -1459,8 +1462,8 @@ static UniValue gettxout(const JSONRPCRequest& request)
14591462
{RPCResult::Type::STR_HEX, "hex", ""},
14601463
{RPCResult::Type::NUM, "reqSigs", "Number of required signatures"},
14611464
{RPCResult::Type::STR_HEX, "type", "The type, eg pubkeyhash"},
1462-
{RPCResult::Type::ARR, "addresses", "array of dash addresses",
1463-
{{RPCResult::Type::STR, "address", "dash address"}}},
1465+
{RPCResult::Type::ARR, "addresses", "Array of Dash addresses",
1466+
{{RPCResult::Type::STR, "address", "Dash address"}}},
14641467
}},
14651468
{RPCResult::Type::BOOL, "coinbase", "Coinbase or not"},
14661469
}},
@@ -1914,7 +1917,7 @@ static UniValue getmempoolinfo(const JSONRPCRequest& request)
19141917
{
19151918
{RPCResult::Type::BOOL, "loaded", "True if the mempool is fully loaded"},
19161919
{RPCResult::Type::NUM, "size", "Current tx count"},
1917-
{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"},
1920+
{RPCResult::Type::NUM, "bytes", "Sum of all transaction sizes"},
19181921
{RPCResult::Type::NUM, "usage", "Total memory usage for the mempool"},
19191922
{RPCResult::Type::STR_AMOUNT, "total_fee", "Total fees for the mempool in " + CURRENCY_UNIT + ", ignoring modified fees through prioritizetransaction"},
19201923
{RPCResult::Type::NUM, "maxmempool", "Maximum memory usage for the mempool"},
@@ -2208,7 +2211,7 @@ static UniValue getblockstats(const JSONRPCRequest& request)
22082211
RPCResult::Type::OBJ, "", "",
22092212
{
22102213
{RPCResult::Type::NUM, "avgfee", "Average fee in the block"},
2211-
{RPCResult::Type::NUM, "avgfeerate", "Average feerate (in satoshis per virtual byte)"},
2214+
{RPCResult::Type::NUM, "avgfeerate", "Average feerate (in duffs per virtual byte)"},
22122215
{RPCResult::Type::NUM, "avgtxsize", "Average transaction size"},
22132216
{RPCResult::Type::STR_HEX, "blockhash", "The block hash (to check for potential reorgs)"},
22142217
{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)
22222225
{RPCResult::Type::NUM, "height", "The height of the block"},
22232226
{RPCResult::Type::NUM, "ins", "The number of inputs (excluding coinbase)"},
22242227
{RPCResult::Type::NUM, "maxfee", "Maximum fee in the block"},
2225-
{RPCResult::Type::NUM, "maxfeerate", "Maximum feerate (in satoshis per virtual byte)"},
2228+
{RPCResult::Type::NUM, "maxfeerate", "Maximum feerate (in duffs per virtual byte)"},
22262229
{RPCResult::Type::NUM, "maxtxsize", "Maximum transaction size"},
22272230
{RPCResult::Type::NUM, "medianfee", "Truncated median fee in the block"},
22282231
{RPCResult::Type::NUM, "mediantime", "The block median time past"},
22292232
{RPCResult::Type::NUM, "mediantxsize", "Truncated median transaction size"},
22302233
{RPCResult::Type::NUM, "minfee", "Minimum fee in the block"},
2231-
{RPCResult::Type::NUM, "minfeerate", "Minimum feerate (in satoshis per virtual byte)"},
2234+
{RPCResult::Type::NUM, "minfeerate", "Minimum feerate (in duffs per virtual byte)"},
22322235
{RPCResult::Type::NUM, "mintxsize", "Minimum transaction size"},
22332236
{RPCResult::Type::NUM, "outs", "The number of outputs"},
22342237
{RPCResult::Type::NUM, "subsidy", "The block subsidy"},

src/rpc/evo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static RPCArg GetRpcArg(const std::string& strParamName)
4545
static const std::map<std::string, RPCArg> mapParamHelp = {
4646
{"collateralAddress",
4747
{"collateralAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
48-
"The dash address to send the collateral to."}
48+
"The Dash address to send the collateral to."}
4949
},
5050
{"collateralHash",
5151
{"collateralHash", RPCArg::Type::STR, RPCArg::Optional::NO,
@@ -116,17 +116,17 @@ static RPCArg GetRpcArg(const std::string& strParamName)
116116
},
117117
{"ownerAddress",
118118
{"ownerAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
119-
"The dash address to use for payee updates and proposal voting.\n"
119+
"The Dash address to use for payee updates and proposal voting.\n"
120120
"The corresponding private key does not have to be known by your wallet.\n"
121121
"The address must be unused and must differ from the collateralAddress."}
122122
},
123123
{"payoutAddress_register",
124124
{"payoutAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
125-
"The dash address to use for masternode reward payments."}
125+
"The Dash address to use for masternode reward payments."}
126126
},
127127
{"payoutAddress_update",
128128
{"payoutAddress", RPCArg::Type::STR, RPCArg::Optional::NO,
129-
"The dash address to use for masternode reward payments.\n"
129+
"The Dash address to use for masternode reward payments.\n"
130130
"If set to an empty string, the currently active payout address is reused."}
131131
},
132132
{"proTxHash",

src/rpc/mining.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,20 +573,20 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
573573
{
574574
{RPCResult::Type::STR_HEX, "data", "transaction data encoded in hexadecimal (byte-for-byte)"},
575575
{RPCResult::Type::STR_HEX, "txid", "transaction id encoded in little-endian hexadecimal"},
576-
{RPCResult::Type::STR_HEX, "hash", "hash encoded in little-endian hexadecimal (including witness data)"},
576+
{RPCResult::Type::STR_HEX, "hash", "hash encoded in little-endian hexadecimal"},
577577
{RPCResult::Type::ARR, "depends", "array of numbers",
578578
{
579579
{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"},
580580
}},
581-
{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"},
581+
{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"},
582582
{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"},
583583
}},
584584
}},
585585
{RPCResult::Type::OBJ_DYN, "coinbaseaux", "data that should be included in the coinbase's scriptSig content",
586586
{
587587
{RPCResult::Type::STR_HEX, "key", "values must be in the coinbase (keys may be ignored)"},
588588
}},
589-
{RPCResult::Type::NUM, "coinbasevalue", "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)"},
589+
{RPCResult::Type::NUM, "coinbasevalue", "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs)"},
590590
{RPCResult::Type::STR, "longpollid", "an id to include with a request to longpoll on an update to this template"},
591591
{RPCResult::Type::STR, "target", "The hash target"},
592592
{RPCResult::Type::NUM_TIME, "mintime", "The minimum timestamp appropriate for the next block time, expressed in " + UNIX_EPOCH_TIME},

src/rpc/misc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,15 @@ static UniValue sporkupdate(const JSONRPCRequest& request)
216216
static UniValue validateaddress(const JSONRPCRequest& request)
217217
{
218218
RPCHelpMan{"validateaddress",
219-
"\nReturn information about the given dash address.\n",
219+
"\nReturn information about the given Dash address.\n",
220220
{
221-
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address to validate"},
221+
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to validate"},
222222
},
223223
RPCResult{
224224
RPCResult::Type::OBJ, "", "",
225225
{
226226
{RPCResult::Type::BOOL, "isvalid", "If the address is valid or not"},
227-
{RPCResult::Type::STR, "address", "The dash address validated"},
227+
{RPCResult::Type::STR, "address", "The Dash address validated"},
228228
{RPCResult::Type::STR_HEX, "scriptPubKey", "The hex-encoded scriptPubKey generated by the address"},
229229
{RPCResult::Type::BOOL, "isscript", "If the key is a script"},
230230
{RPCResult::Type::STR, "error", /* optional */ true, "Error message, if any"},
@@ -441,7 +441,7 @@ static UniValue verifymessage(const JSONRPCRequest& request)
441441
RPCHelpMan{"verifymessage",
442442
"\nVerify a signed message\n",
443443
{
444-
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The dash address to use for the signature."},
444+
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to use for the signature."},
445445
{"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "The signature provided by the signer in base 64 encoding (see signmessage)."},
446446
{"message", RPCArg::Type::STR, RPCArg::Optional::NO, "The message that was signed."},
447447
},

src/rpc/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static UniValue getaddednodeinfo(const JSONRPCRequest& request)
373373
{
374374
{RPCResult::Type::OBJ, "", "",
375375
{
376-
{RPCResult::Type::STR, "address", "The dash server IP and port we're connected to"},
376+
{RPCResult::Type::STR, "address", "The Dash server IP and port we're connected to"},
377377
{RPCResult::Type::STR, "connected", "connection, inbound or outbound"},
378378
}},
379379
}},

0 commit comments

Comments
 (0)