Merge pull request #5684 from nuttycom/feature/wallet_orchard-rpc_doc_cleanup

Address minor issues from #5605
This commit is contained in:
Kris Nuttycombe 2022-03-15 21:43:47 -06:00 committed by GitHub
commit b9b471bfa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 12 deletions

View File

@ -91,7 +91,7 @@ UniValue importprivkey(const UniValue& params, bool fHelp)
"1. \"zcashprivkey\" (string, required) The private key (see dumpprivkey)\n"
"2. \"label\" (string, optional, default=\"\") An optional label\n"
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
"\nNote: This call can take minutes to complete if rescan is true.\n"
"\nNote: This call can take a long time to complete if rescan is true.\n"
"\nExamples:\n"
"\nDump a private key\n"
+ HelpExampleCli("dumpprivkey", "\"myaddress\"") +
@ -202,7 +202,7 @@ UniValue importaddress(const UniValue& params, bool fHelp)
"2. \"label\" (string, optional, default=\"\") An optional label\n"
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
"4. p2sh (boolean, optional, default=false) Add the P2SH version of the script as well\n"
"\nNote: This call can take minutes to complete if rescan is true.\n"
"\nNote: This call can take a long time to complete if rescan is true.\n"
"If you have the full public key, you should call importpubkey instead of this.\n"
"\nNote: If you import a non-standard raw script in hex form, outputs sending to it will be treated\n"
"as change, and not show up in many RPCs.\n"
@ -271,7 +271,7 @@ UniValue importpubkey(const UniValue& params, bool fHelp)
"1. \"pubkey\" (string, required) The hex-encoded public key\n"
"2. \"label\" (string, optional, default=\"\") An optional label\n"
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
"\nNote: This call can take minutes to complete if rescan is true.\n"
"\nNote: This call can take a long time to complete if rescan is true.\n"
"\nExamples:\n"
"\nImport a public key with rescan\n"
+ HelpExampleCli("importpubkey", "\"mypubkey\"") +
@ -710,12 +710,13 @@ UniValue z_importkey(const UniValue& params, bool fHelp)
if (fHelp || params.size() < 1 || params.size() > 3)
throw runtime_error(
"z_importkey \"zkey\" ( rescan startHeight )\n"
"\nAdds a zkey (as returned by z_exportkey) to your wallet.\n"
"\nAdds a zkey (as returned by z_exportkey) to your wallet."
"\nImport of Orchard keys is not supported.\n"
"\nArguments:\n"
"1. \"zkey\" (string, required) The zkey (see z_exportkey)\n"
"2. rescan (string, optional, default=\"whenkeyisnew\") Rescan the wallet for transactions - can be \"yes\", \"no\" or \"whenkeyisnew\"\n"
"3. startHeight (numeric, optional, default=0) Block height to start rescan from\n"
"\nNote: This call can take minutes to complete if rescan is true.\n"
"\nNote: This call can take a long time to complete if rescan is true.\n"
"\nResult:\n"
"{\n"
" \"type\" : \"xxxx\", (string) \"sprout\" or \"sapling\"\n"
@ -821,7 +822,7 @@ UniValue z_importviewingkey(const UniValue& params, bool fHelp)
"1. \"vkey\" (string, required) The viewing key (see z_exportviewingkey)\n"
"2. rescan (string, optional, default=\"whenkeyisnew\") Rescan the wallet for transactions - can be \"yes\", \"no\" or \"whenkeyisnew\"\n"
"3. startHeight (numeric, optional, default=0) Block height to start rescan from\n"
"\nNote: This call can take minutes to complete if rescan is true.\n"
"\nNote: This call can take a long time to complete if rescan is true. Import of Unified viewing keys is not yet supported.\n"
"\nResult:\n"
"{\n"
" \"type\" : \"xxxx\", (string) \"sprout\" or \"sapling\"\n"
@ -989,8 +990,10 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 1)
throw runtime_error(
"z_exportviewingkey \"zaddr\"\n"
"\nReveals the viewing key corresponding to 'zaddr'.\n"
"Then the z_importviewingkey can be used with this output\n"
"\nReturns the full viewing key corresponding to 'zaddr' in the format specified by\n"
"https://zips.z.cash/protocol/protocol.pdf#addressandkeyencoding.\n"
"z_importviewingkey can be used to import Sprout and Sapling exported in this format;\n"
"import of unified viewing keys is not yet supported.\n"
"\nArguments:\n"
"1. \"zaddr\" (string, required) The zaddr for the viewing key\n"
"\nResult:\n"

View File

@ -2412,6 +2412,8 @@ UniValue z_listunspent(const UniValue& params, bool fHelp)
results.push_back(obj);
}
// TODO ORCHARD #5683
return results;
}
@ -2982,7 +2984,7 @@ UniValue z_getnewaddress(const UniValue& params, bool fHelp)
if (fHelp || params.size() > 1)
throw runtime_error(
"z_getnewaddress ( type )\n"
"\nDEPRECATED\n"
"\nDEPRECATED. Use z_getnewaccount and z_getaddressforaccount instead.\n"
"\nReturns a new shielded address for receiving payments.\n"
"\nWith no arguments, returns a Sapling address.\n"
"Generating a Sprout address is not allowed after Canopy has activated.\n"
@ -5615,11 +5617,12 @@ UniValue z_getnotescount(const UniValue& params, bool fHelp)
"z_getnotescount\n"
"\nArguments:\n"
"1. minconf (numeric, optional, default=1) Only include notes in transactions confirmed at least this many times.\n"
"\nReturns the number of sprout and sapling notes available in the wallet.\n"
"\nReturns the number of shielded notes of each pool available in the wallet.\n"
"\nResult:\n"
"{\n"
" \"sprout\" (numeric) the number of sprout notes in the wallet\n"
" \"sapling\" (numeric) the number of sapling notes in the wallet\n"
" \"sprout\" (numeric) the number of Sprout notes in the wallet\n"
" \"sapling\" (numeric) the number of Sapling notes in the wallet\n"
" \"orchard\" (numeric) the number of Orchard notes in the wallet\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("z_getnotescount", "0")
@ -5634,15 +5637,18 @@ UniValue z_getnotescount(const UniValue& params, bool fHelp)
int sprout = 0;
int sapling = 0;
int orchard = 0;
for (auto& wtx : pwalletMain->mapWallet) {
if (wtx.second.GetDepthInMainChain() >= nMinDepth) {
sprout += wtx.second.mapSproutNoteData.size();
sapling += wtx.second.mapSaplingNoteData.size();
orchard += wtx.second.orchardTxMeta.GetMyActionIVKs().size();
}
}
UniValue ret(UniValue::VOBJ);
ret.pushKV("sprout", sprout);
ret.pushKV("sapling", sapling);
ret.pushKV("orchard", orchard);
return ret;
}