Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPC] Use "shield" nomenclature instead of "shielded" #2086

Merged
merged 2 commits into from
Dec 21, 2020
Merged
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
18 changes: 9 additions & 9 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
result.pushKV("difficulty", GetDifficulty(blockindex));
result.pushKV("chainwork", blockindex->nChainWork.GetHex());
result.pushKV("acc_checkpoint", blockindex->nAccumulatorCheckpoint.GetHex());
// Sapling shielded pool value
result.pushKV("shielded_pool_value", ValuePoolDesc(blockindex->nChainSaplingValue, blockindex->nSaplingValue));
// Sapling shield pool value
result.pushKV("shield_pool_value", ValuePoolDesc(blockindex->nChainSaplingValue, blockindex->nSaplingValue));
if (blockindex->pprev)
result.pushKV("previousblockhash", blockindex->pprev->GetBlockHash().GetHex());
CBlockIndex *pnext = chainActive.Next(blockindex);
Expand Down Expand Up @@ -594,7 +594,7 @@ UniValue getblockheader(const JSONRPCRequest& request)
" \"mediantime\" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"nonce\" : n, (numeric) The nonce\n"
" \"bits\" : \"1d00ffff\", (string) The bits\n"
" \"shielded_pool_value\": (object) Block shielded pool value\n"
" \"shield_pool_value\": (object) Block shield pool value\n"
" {\n"
" \"chainValue\": (numeric) Total value held by the Sapling circuit up to and including this block\n"
" \"valueDelta\": (numeric) Change in value held by the Sapling circuit over this block\n"
Expand Down Expand Up @@ -650,8 +650,8 @@ UniValue getsupplyinfo(const JSONRPCRequest& request)
"{\n"
" \"updateheight\" : n, (numeric) The chain height when the transparent supply was updated\n"
" \"transparentsupply\" : n (numeric) The sum of all spendable transaction outputs at height updateheight\n"
" \"shieldedsupply\": n (numeric) Chain tip shielded pool value\n"
" \"totalsupply\": n (numeric) The sum of transparentsupply and shieldedsupply\n"
" \"shieldsupply\": n (numeric) Chain tip shield pool value\n"
" \"totalsupply\": n (numeric) The sum of transparentsupply and shieldsupply\n"
"}\n"

"\nExamples:\n" +
Expand All @@ -670,7 +670,7 @@ UniValue getsupplyinfo(const JSONRPCRequest& request)
ret.pushKV("updateheight", MoneySupply.GetCacheHeight());
ret.pushKV("transparentsupply", ValueFromAmount(tSupply));
Optional<CAmount> shieldedPoolValue = WITH_LOCK(cs_main, return (chainActive.Tip() ? chainActive.Tip()->nChainSaplingValue : nullopt); );
ret.pushKV("shieldedsupply", ValuePoolDesc(shieldedPoolValue, nullopt)["chainValue"]);
ret.pushKV("shieldsupply", ValuePoolDesc(shieldedPoolValue, nullopt)["chainValue"]);
const CAmount totalSupply = tSupply + (shieldedPoolValue ? *shieldedPoolValue : 0);
ret.pushKV("totalsupply", ValueFromAmount(totalSupply));

Expand Down Expand Up @@ -980,7 +980,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
" \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n"
" \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n"
" \"shielded_pool_value\": (object) Chain tip shielded pool value\n"
" \"shield_pool_value\": (object) Chain tip shield pool value\n"
" \"initial_block_downloading\" (boolean) whether the node is in initial block downloading state or not"
" {\n"
" \"chainValue\": (numeric) Total value held by the Sapling circuit up to and including the chain tip\n"
Expand Down Expand Up @@ -1020,8 +1020,8 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
obj.pushKV("difficulty", (double)GetDifficulty());
obj.pushKV("verificationprogress", Checkpoints::GuessVerificationProgress(pChainTip));
obj.pushKV("chainwork", pChainTip ? pChainTip->nChainWork.GetHex() : "");
// Sapling shielded pool value
obj.pushKV("shielded_pool_value", ValuePoolDesc(pChainTip->nChainSaplingValue, pChainTip->nSaplingValue));
// Sapling shield pool value
obj.pushKV("shield_pool_value", ValuePoolDesc(pChainTip->nChainSaplingValue, pChainTip->nSaplingValue));
obj.pushKV("initial_block_downloading", IsInitialBlockDownload());
UniValue softforks(UniValue::VARR);
softforks.push_back(SoftForkDesc("bip65", 5, pChainTip));
Expand Down
26 changes: 13 additions & 13 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static const CRPCConvertParam vRPCConvertParams[] = {
{ "sendtoaddress", 1 },
{ "settxfee", 0 },
{ "getreceivedbyaddress", 1 },
{ "listreceivedbyshieldedaddress", 1 },
{ "listreceivedbyshieldaddress", 1 },
{ "getreceivedbylabel", 1 },
{ "listcoldutxos", 0 },
{ "listdelegators", 0 },
Expand All @@ -54,14 +54,14 @@ static const CRPCConvertParam vRPCConvertParams[] = {
{ "getbalance", 2 },
{ "getbalance", 3 },
{ "getbalance", 4 },
{ "getshieldedbalance", 1 },
{ "getshieldedbalance", 2 },
{ "rawshieldedsendmany", 1 },
{ "rawshieldedsendmany", 2 },
{ "rawshieldedsendmany", 3 },
{ "shieldedsendmany", 1 },
{ "shieldedsendmany", 2 },
{ "shieldedsendmany", 3 },
{ "getshieldbalance", 1 },
{ "getshieldbalance", 2 },
{ "rawshieldsendmany", 1 },
{ "rawshieldsendmany", 2 },
{ "rawshieldsendmany", 3 },
{ "shieldsendmany", 1 },
{ "shieldsendmany", 2 },
{ "shieldsendmany", 3 },
{ "getblockhash", 0 },
{ "waitforblockheight", 0 },
{ "waitforblockheight", 1 },
Expand Down Expand Up @@ -89,10 +89,10 @@ static const CRPCConvertParam vRPCConvertParams[] = {
{ "listunspent", 1 },
{ "listunspent", 2 },
{ "listunspent", 3 },
{ "listshieldedunspent", 0 },
{ "listshieldedunspent", 1 },
{ "listshieldedunspent", 2 },
{ "listshieldedunspent", 3 },
{ "listshieldunspent", 0 },
{ "listshieldunspent", 1 },
{ "listshieldunspent", 2 },
{ "listshieldunspent", 3 },
{ "logging", 0 },
{ "logging", 1 },
{ "getblock", 1 },
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ UniValue getinfo(const JSONRPCRequest& request)
" \"transparentsupply\" : n (numeric) The sum of the value of all unspent outputs when the chainstate was\n"
" last flushed to disk (use getsupplyinfo to know the update-height, or\n"
" to trigger the money supply update/recalculation)"
" \"shieldedsupply\": n (numeric) Chain tip shielded pool value\n"
" \"shieldsupply\": n (numeric) Chain tip shield pool value\n"
Fuzzbawls marked this conversation as resolved.
Show resolved Hide resolved
" \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n"
" \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n"
" \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
Expand Down Expand Up @@ -133,7 +133,7 @@ UniValue getinfo(const JSONRPCRequest& request)
UniValue supply_info = getsupplyinfo(JSONRPCRequest());
obj.pushKV("moneysupply", supply_info["totalsupply"]);
obj.pushKV("transparentsupply", supply_info["transparentsupply"]);
obj.pushKV("shieldedsupply", supply_info["shieldedsupply"]);
obj.pushKV("shieldsupply", supply_info["shieldsupply"]);

#ifdef ENABLE_WALLET
if (pwalletMain) {
Expand Down
4 changes: 2 additions & 2 deletions src/sapling/saplingscriptpubkeyman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ Optional<std::pair<
ovks.emplace(getCommonOVK());
} catch (...) {
LogPrintf("WARNING: No CommonOVK found. Some notes might not be correctly recovered. "
"Unlock the wallet and call 'viewshieldedtransaction %s' to fix.\n", txId.ToString());
"Unlock the wallet and call 'viewshieldtransaction %s' to fix.\n", txId.ToString());
}
} else {
for (const auto& spend : tx.sapData->vShieldedSpend) {
Expand Down Expand Up @@ -762,7 +762,7 @@ bool SaplingScriptPubKeyMan::IsNoteSaplingChange(const std::set<std::pair<libzca
// also spent Notes in the same transaction. This will catch,
// for instance:
// - Change created by spending fractions of Notes (because
// shieldedsendmany sends change to the originating shielded address).
// shieldsendmany sends change to the originating shielded address).
// - Notes sent from one address to itself.
const auto& tx = wallet->mapWallet[op.hash];
if (tx.sapData) {
Expand Down
Loading