Auto merge of #2205 - arcalinea:1804_zcash_addresses_in_help, r=daira

Change help text examples to use Zcash addresses

Closes #1804 and #2109

Ensures command line help text addresses are Zcash addresses.

Didn't change the text strings that say bitcoin or btc, leaving that for #2150 to close

Did I get all the addresses?
This commit is contained in:
zkbot
2017-04-17 15:49:37 +00:00
3 changed files with 79 additions and 79 deletions

View File

@@ -356,9 +356,9 @@ UniValue createmultisig(const UniValue& params, bool fHelp)
"\nExamples:\n" "\nExamples:\n"
"\nCreate a multisig address from 2 addresses\n" "\nCreate a multisig address from 2 addresses\n"
+ HelpExampleCli("createmultisig", "2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") + + HelpExampleCli("createmultisig", "2 \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
"\nAs a json rpc call\n" "\nAs a json rpc call\n"
+ HelpExampleRpc("createmultisig", "2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") + HelpExampleRpc("createmultisig", "2, \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
; ;
throw runtime_error(msg); throw runtime_error(msg);
} }
@@ -391,11 +391,11 @@ UniValue verifymessage(const UniValue& params, bool fHelp)
"\nUnlock the wallet for 30 seconds\n" "\nUnlock the wallet for 30 seconds\n"
+ HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") + + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
"\nCreate the signature\n" "\nCreate the signature\n"
+ HelpExampleCli("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"my message\"") + + HelpExampleCli("signmessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"my message\"") +
"\nVerify the signature\n" "\nVerify the signature\n"
+ HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"signature\" \"my message\"") + + HelpExampleCli("verifymessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"signature\" \"my message\"") +
"\nAs json rpc\n" "\nAs json rpc\n"
+ HelpExampleRpc("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"signature\", \"my message\"") + HelpExampleRpc("verifymessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", \"signature\", \"my message\"")
); );
LOCK(cs_main); LOCK(cs_main);

View File

@@ -511,7 +511,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp)
" \"reqSigs\" : n, (numeric) The required sigs\n" " \"reqSigs\" : n, (numeric) The required sigs\n"
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
" \"addresses\" : [ (json array of string)\n" " \"addresses\" : [ (json array of string)\n"
" \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) bitcoin address\n" " \"t12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) bitcoin address\n"
" ,...\n" " ,...\n"
" ]\n" " ]\n"
" }\n" " }\n"

View File

@@ -110,7 +110,7 @@ UniValue getnewaddress(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 1) if (fHelp || params.size() > 1)
throw runtime_error( throw runtime_error(
"getnewaddress ( \"account\" )\n" "getnewaddress ( \"account\" )\n"
@@ -187,7 +187,7 @@ UniValue getaccountaddress(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() != 1) if (fHelp || params.size() != 1)
throw runtime_error( throw runtime_error(
"getaccountaddress \"account\"\n" "getaccountaddress \"account\"\n"
@@ -219,7 +219,7 @@ UniValue getrawchangeaddress(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 1) if (fHelp || params.size() > 1)
throw runtime_error( throw runtime_error(
"getrawchangeaddress\n" "getrawchangeaddress\n"
@@ -254,7 +254,7 @@ UniValue setaccount(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 1 || params.size() > 2) if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error( throw runtime_error(
"setaccount \"zcashaddress\" \"account\"\n" "setaccount \"zcashaddress\" \"account\"\n"
@@ -263,8 +263,8 @@ UniValue setaccount(const UniValue& params, bool fHelp)
"1. \"zcashaddress\" (string, required) The zcash address to be associated with an account.\n" "1. \"zcashaddress\" (string, required) The zcash address to be associated with an account.\n"
"2. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "2. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("setaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"tabby\"") + HelpExampleCli("setaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"tabby\"")
+ HelpExampleRpc("setaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"tabby\"") + HelpExampleRpc("setaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", \"tabby\"")
); );
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -300,7 +300,7 @@ UniValue getaccount(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() != 1) if (fHelp || params.size() != 1)
throw runtime_error( throw runtime_error(
"getaccount \"zcashaddress\"\n" "getaccount \"zcashaddress\"\n"
@@ -310,8 +310,8 @@ UniValue getaccount(const UniValue& params, bool fHelp)
"\nResult:\n" "\nResult:\n"
"\"accountname\" (string) the account address\n" "\"accountname\" (string) the account address\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("getaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"") + HelpExampleCli("getaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\"")
+ HelpExampleRpc("getaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"") + HelpExampleRpc("getaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\"")
); );
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -332,7 +332,7 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() != 1) if (fHelp || params.size() != 1)
throw runtime_error( throw runtime_error(
"getaddressesbyaccount \"account\"\n" "getaddressesbyaccount \"account\"\n"
@@ -400,7 +400,7 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 2 || params.size() > 5) if (fHelp || params.size() < 2 || params.size() > 5)
throw runtime_error( throw runtime_error(
"sendtoaddress \"zcashaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount )\n" "sendtoaddress \"zcashaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount )\n"
@@ -419,10 +419,10 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp)
"\nResult:\n" "\nResult:\n"
"\"transactionid\" (string) The transaction id.\n" "\"transactionid\" (string) The transaction id.\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1") + HelpExampleCli("sendtoaddress", "\"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1")
+ HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"") + HelpExampleCli("sendtoaddress", "\"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"")
+ HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true") + HelpExampleCli("sendtoaddress", "\"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true")
+ HelpExampleRpc("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\"") + HelpExampleRpc("sendtoaddress", "\"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\"")
); );
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -458,7 +458,7 @@ UniValue listaddressgroupings(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp) if (fHelp)
throw runtime_error( throw runtime_error(
"listaddressgroupings\n" "listaddressgroupings\n"
@@ -509,7 +509,7 @@ UniValue signmessage(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() != 2) if (fHelp || params.size() != 2)
throw runtime_error( throw runtime_error(
"signmessage \"zcashaddress\" \"message\"\n" "signmessage \"zcashaddress\" \"message\"\n"
@@ -524,11 +524,11 @@ UniValue signmessage(const UniValue& params, bool fHelp)
"\nUnlock the wallet for 30 seconds\n" "\nUnlock the wallet for 30 seconds\n"
+ HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") + + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
"\nCreate the signature\n" "\nCreate the signature\n"
+ HelpExampleCli("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"my message\"") + + HelpExampleCli("signmessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"my message\"") +
"\nVerify the signature\n" "\nVerify the signature\n"
+ HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"signature\" \"my message\"") + + HelpExampleCli("verifymessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"signature\" \"my message\"") +
"\nAs json rpc\n" "\nAs json rpc\n"
+ HelpExampleRpc("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"my message\"") + HelpExampleRpc("signmessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", \"my message\"")
); );
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -565,7 +565,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 1 || params.size() > 2) if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error( throw runtime_error(
"getreceivedbyaddress \"zcashaddress\" ( minconf )\n" "getreceivedbyaddress \"zcashaddress\" ( minconf )\n"
@@ -577,13 +577,13 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
"amount (numeric) The total amount in btc received at this address.\n" "amount (numeric) The total amount in btc received at this address.\n"
"\nExamples:\n" "\nExamples:\n"
"\nThe amount from transactions with at least 1 confirmation\n" "\nThe amount from transactions with at least 1 confirmation\n"
+ HelpExampleCli("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"") + + HelpExampleCli("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\"") +
"\nThe amount including unconfirmed transactions, zero confirmations\n" "\nThe amount including unconfirmed transactions, zero confirmations\n"
+ HelpExampleCli("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" 0") + + HelpExampleCli("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" 0") +
"\nThe amount with at least 6 confirmation, very safe\n" "\nThe amount with at least 6 confirmation, very safe\n"
+ HelpExampleCli("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" 6") + + HelpExampleCli("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" 6") +
"\nAs a json rpc call\n" "\nAs a json rpc call\n"
+ HelpExampleRpc("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", 6") + HelpExampleRpc("getreceivedbyaddress", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", 6")
); );
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -623,7 +623,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 1 || params.size() > 2) if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error( throw runtime_error(
"getreceivedbyaccount \"account\" ( minconf )\n" "getreceivedbyaccount \"account\" ( minconf )\n"
@@ -712,7 +712,7 @@ UniValue getbalance(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 3) if (fHelp || params.size() > 3)
throw runtime_error( throw runtime_error(
"getbalance ( \"account\" minconf includeWatchonly )\n" "getbalance ( \"account\" minconf includeWatchonly )\n"
@@ -784,7 +784,7 @@ UniValue getunconfirmedbalance(const UniValue &params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 0) if (fHelp || params.size() > 0)
throw runtime_error( throw runtime_error(
"getunconfirmedbalance\n" "getunconfirmedbalance\n"
@@ -800,7 +800,7 @@ UniValue movecmd(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 3 || params.size() > 5) if (fHelp || params.size() < 3 || params.size() > 5)
throw runtime_error( throw runtime_error(
"move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n" "move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n"
@@ -872,7 +872,7 @@ UniValue sendfrom(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 3 || params.size() > 6) if (fHelp || params.size() < 3 || params.size() > 6)
throw runtime_error( throw runtime_error(
"sendfrom \"fromaccount\" \"tozcashaddress\" amount ( minconf \"comment\" \"comment-to\" )\n" "sendfrom \"fromaccount\" \"tozcashaddress\" amount ( minconf \"comment\" \"comment-to\" )\n"
@@ -893,11 +893,11 @@ UniValue sendfrom(const UniValue& params, bool fHelp)
"\"transactionid\" (string) The transaction id.\n" "\"transactionid\" (string) The transaction id.\n"
"\nExamples:\n" "\nExamples:\n"
"\nSend 0.01 btc from the default account to the address, must have at least 1 confirmation\n" "\nSend 0.01 btc from the default account to the address, must have at least 1 confirmation\n"
+ HelpExampleCli("sendfrom", "\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") + + HelpExampleCli("sendfrom", "\"\" \"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") +
"\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\n" "\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\n"
+ HelpExampleCli("sendfrom", "\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"") + + HelpExampleCli("sendfrom", "\"tabby\" \"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"") +
"\nAs a json rpc call\n" "\nAs a json rpc call\n"
+ HelpExampleRpc("sendfrom", "\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\"") + HelpExampleRpc("sendfrom", "\"tabby\", \"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\"")
); );
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -937,7 +937,7 @@ UniValue sendmany(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 2 || params.size() > 5) if (fHelp || params.size() < 2 || params.size() > 5)
throw runtime_error( throw runtime_error(
"sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] )\n" "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] )\n"
@@ -965,13 +965,13 @@ UniValue sendmany(const UniValue& params, bool fHelp)
" the number of addresses.\n" " the number of addresses.\n"
"\nExamples:\n" "\nExamples:\n"
"\nSend two amounts to two different addresses:\n" "\nSend two amounts to two different addresses:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"") + + HelpExampleCli("sendmany", "\"\" \"{\\\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\\\":0.01,\\\"t1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"") +
"\nSend two amounts to two different addresses setting the confirmation and comment:\n" "\nSend two amounts to two different addresses setting the confirmation and comment:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 6 \"testing\"") + + HelpExampleCli("sendmany", "\"\" \"{\\\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\\\":0.01,\\\"t1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 6 \"testing\"") +
"\nSend two amounts to two different addresses, subtract fee from amount:\n" "\nSend two amounts to two different addresses, subtract fee from amount:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 1 \"\" \"[\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\",\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"") + + HelpExampleCli("sendmany", "\"\" \"{\\\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\\\":0.01,\\\"t1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 1 \"\" \"[\\\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\\\",\\\"t1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"") +
"\nAs a json rpc call\n" "\nAs a json rpc call\n"
+ HelpExampleRpc("sendmany", "\"\", \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\", 6, \"testing\"") + HelpExampleRpc("sendmany", "\"\", \"{\\\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\\\":0.01,\\\"t1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\", 6, \"testing\"")
); );
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -1051,7 +1051,7 @@ UniValue addmultisigaddress(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 2 || params.size() > 3) if (fHelp || params.size() < 2 || params.size() > 3)
{ {
string msg = "addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n" string msg = "addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n"
@@ -1073,9 +1073,9 @@ UniValue addmultisigaddress(const UniValue& params, bool fHelp)
"\nExamples:\n" "\nExamples:\n"
"\nAdd a multisig address from 2 addresses\n" "\nAdd a multisig address from 2 addresses\n"
+ HelpExampleCli("addmultisigaddress", "2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") + + HelpExampleCli("addmultisigaddress", "2 \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
"\nAs json rpc call\n" "\nAs json rpc call\n"
+ HelpExampleRpc("addmultisigaddress", "2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") + HelpExampleRpc("addmultisigaddress", "2, \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
; ;
throw runtime_error(msg); throw runtime_error(msg);
} }
@@ -1232,7 +1232,7 @@ UniValue listreceivedbyaddress(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 3) if (fHelp || params.size() > 3)
throw runtime_error( throw runtime_error(
"listreceivedbyaddress ( minconf includeempty includeWatchonly)\n" "listreceivedbyaddress ( minconf includeempty includeWatchonly)\n"
@@ -1269,7 +1269,7 @@ UniValue listreceivedbyaccount(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 3) if (fHelp || params.size() > 3)
throw runtime_error( throw runtime_error(
"listreceivedbyaccount ( minconf includeempty includeWatchonly)\n" "listreceivedbyaccount ( minconf includeempty includeWatchonly)\n"
@@ -1401,7 +1401,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 4) if (fHelp || params.size() > 4)
throw runtime_error( throw runtime_error(
"listtransactions ( \"account\" count from includeWatchonly)\n" "listtransactions ( \"account\" count from includeWatchonly)\n"
@@ -1523,7 +1523,7 @@ UniValue listaccounts(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 2) if (fHelp || params.size() > 2)
throw runtime_error( throw runtime_error(
"listaccounts ( minconf includeWatchonly)\n" "listaccounts ( minconf includeWatchonly)\n"
@@ -1603,7 +1603,7 @@ UniValue listsinceblock(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp) if (fHelp)
throw runtime_error( throw runtime_error(
"listsinceblock ( \"blockhash\" target-confirmations includeWatchonly)\n" "listsinceblock ( \"blockhash\" target-confirmations includeWatchonly)\n"
@@ -1694,7 +1694,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 1 || params.size() > 2) if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error( throw runtime_error(
"gettransaction \"txid\" ( includeWatchonly )\n" "gettransaction \"txid\" ( includeWatchonly )\n"
@@ -1783,7 +1783,7 @@ UniValue backupwallet(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() != 1) if (fHelp || params.size() != 1)
throw runtime_error( throw runtime_error(
"backupwallet \"destination\"\n" "backupwallet \"destination\"\n"
@@ -1826,7 +1826,7 @@ UniValue keypoolrefill(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 1) if (fHelp || params.size() > 1)
throw runtime_error( throw runtime_error(
"keypoolrefill ( newsize )\n" "keypoolrefill ( newsize )\n"
@@ -1870,7 +1870,7 @@ UniValue walletpassphrase(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2)) if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
throw runtime_error( throw runtime_error(
"walletpassphrase \"passphrase\" timeout\n" "walletpassphrase \"passphrase\" timeout\n"
@@ -1932,7 +1932,7 @@ UniValue walletpassphrasechange(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2)) if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
throw runtime_error( throw runtime_error(
"walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n" "walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n"
@@ -1978,7 +1978,7 @@ UniValue walletlock(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0)) if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0))
throw runtime_error( throw runtime_error(
"walletlock\n" "walletlock\n"
@@ -1989,7 +1989,7 @@ UniValue walletlock(const UniValue& params, bool fHelp)
"\nSet the passphrase for 2 minutes to perform a transaction\n" "\nSet the passphrase for 2 minutes to perform a transaction\n"
+ HelpExampleCli("walletpassphrase", "\"my pass phrase\" 120") + + HelpExampleCli("walletpassphrase", "\"my pass phrase\" 120") +
"\nPerform a send (requires passphrase set)\n" "\nPerform a send (requires passphrase set)\n"
+ HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") + + HelpExampleCli("sendtoaddress", "\"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") +
"\nClear the passphrase since we are done before 2 minutes is up\n" "\nClear the passphrase since we are done before 2 minutes is up\n"
+ HelpExampleCli("walletlock", "") + + HelpExampleCli("walletlock", "") +
"\nAs json rpc call\n" "\nAs json rpc call\n"
@@ -2085,7 +2085,7 @@ UniValue lockunspent(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 1 || params.size() > 2) if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error( throw runtime_error(
"lockunspent unlock [{\"txid\":\"txid\",\"vout\":n},...]\n" "lockunspent unlock [{\"txid\":\"txid\",\"vout\":n},...]\n"
@@ -2169,7 +2169,7 @@ UniValue listlockunspent(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 0) if (fHelp || params.size() > 0)
throw runtime_error( throw runtime_error(
"listlockunspent\n" "listlockunspent\n"
@@ -2218,7 +2218,7 @@ UniValue settxfee(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() < 1 || params.size() > 1) if (fHelp || params.size() < 1 || params.size() > 1)
throw runtime_error( throw runtime_error(
"settxfee amount\n" "settxfee amount\n"
@@ -2245,7 +2245,7 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() != 0) if (fHelp || params.size() != 0)
throw runtime_error( throw runtime_error(
"getwalletinfo\n" "getwalletinfo\n"
@@ -2287,7 +2287,7 @@ UniValue resendwallettransactions(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() != 0) if (fHelp || params.size() != 0)
throw runtime_error( throw runtime_error(
"resendwallettransactions\n" "resendwallettransactions\n"
@@ -2312,7 +2312,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
{ {
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue; return NullUniValue;
if (fHelp || params.size() > 3) if (fHelp || params.size() > 3)
throw runtime_error( throw runtime_error(
"listunspent ( minconf maxconf [\"address\",...] )\n" "listunspent ( minconf maxconf [\"address\",...] )\n"
@@ -2345,8 +2345,8 @@ UniValue listunspent(const UniValue& params, bool fHelp)
"\nExamples\n" "\nExamples\n"
+ HelpExampleCli("listunspent", "") + HelpExampleCli("listunspent", "")
+ HelpExampleCli("listunspent", "6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"") + HelpExampleCli("listunspent", "6 9999999 \"[\\\"t1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"t1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
+ HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"") + HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"t1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"t1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
); );
RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VARR)); RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VARR));
@@ -2971,8 +2971,8 @@ UniValue z_listaddresses(const UniValue& params, bool fHelp)
CAmount getBalanceTaddr(std::string transparentAddress, int minDepth=1) { CAmount getBalanceTaddr(std::string transparentAddress, int minDepth=1) {
set<CBitcoinAddress> setAddress; set<CBitcoinAddress> setAddress;
vector<COutput> vecOutputs; vector<COutput> vecOutputs;
CAmount balance = 0; CAmount balance = 0;
if (transparentAddress.length() > 0) { if (transparentAddress.length() > 0) {
CBitcoinAddress taddr = CBitcoinAddress(transparentAddress); CBitcoinAddress taddr = CBitcoinAddress(transparentAddress);
if (!taddr.IsValid()) { if (!taddr.IsValid()) {
@@ -2980,7 +2980,7 @@ CAmount getBalanceTaddr(std::string transparentAddress, int minDepth=1) {
} }
setAddress.insert(taddr); setAddress.insert(taddr);
} }
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain->cs_wallet);
pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); pwalletMain->AvailableCoins(vecOutputs, false, NULL, true);
@@ -3000,7 +3000,7 @@ CAmount getBalanceTaddr(std::string transparentAddress, int minDepth=1) {
continue; continue;
} }
} }
CAmount nValue = out.tx->vout[out.i].nValue; CAmount nValue = out.tx->vout[out.i].nValue;
balance += nValue; balance += nValue;
} }
@@ -3048,7 +3048,7 @@ UniValue z_listreceivedbyaddress(const UniValue& params, bool fHelp)
if (nMinDepth < 0) { if (nMinDepth < 0) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Minimum number of confirmations cannot be less than 0"); throw JSONRPCError(RPC_INVALID_PARAMETER, "Minimum number of confirmations cannot be less than 0");
} }
// Check that the from address is valid. // Check that the from address is valid.
auto fromaddress = params[0].get_str(); auto fromaddress = params[0].get_str();
@@ -3063,8 +3063,8 @@ UniValue z_listreceivedbyaddress(const UniValue& params, bool fHelp)
if (!pwalletMain->HaveSpendingKey(zaddr)) { if (!pwalletMain->HaveSpendingKey(zaddr)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "From address does not belong to this node, zaddr spending key not found."); throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "From address does not belong to this node, zaddr spending key not found.");
} }
UniValue result(UniValue::VARR); UniValue result(UniValue::VARR);
std::vector<CNotePlaintextEntry> entries; std::vector<CNotePlaintextEntry> entries;
pwalletMain->GetFilteredNotes(entries, fromaddress, nMinDepth, false); pwalletMain->GetFilteredNotes(entries, fromaddress, nMinDepth, false);
@@ -3112,7 +3112,7 @@ UniValue z_getbalance(const UniValue& params, bool fHelp)
if (nMinDepth < 0) { if (nMinDepth < 0) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Minimum number of confirmations cannot be less than 0"); throw JSONRPCError(RPC_INVALID_PARAMETER, "Minimum number of confirmations cannot be less than 0");
} }
// Check that the from address is valid. // Check that the from address is valid.
auto fromaddress = params[0].get_str(); auto fromaddress = params[0].get_str();
bool fromTaddr = false; bool fromTaddr = false;
@@ -3179,7 +3179,7 @@ UniValue z_gettotalbalance(const UniValue& params, bool fHelp)
} }
// getbalance and "getbalance * 1 true" should return the same number // getbalance and "getbalance * 1 true" should return the same number
// but they don't because wtx.GetAmounts() does not handle tx where there are no outputs // but they don't because wtx.GetAmounts() does not handle tx where there are no outputs
// pwalletMain->GetBalance() does not accept min depth parameter // pwalletMain->GetBalance() does not accept min depth parameter
// so we use our own method to get balance of utxos. // so we use our own method to get balance of utxos.
CAmount nBalance = getBalanceTaddr("", nMinDepth); CAmount nBalance = getBalanceTaddr("", nMinDepth);
@@ -3207,7 +3207,7 @@ UniValue z_getoperationresult(const UniValue& params, bool fHelp)
"\nResult:\n" "\nResult:\n"
"\" [object, ...]\" (array) A list of JSON objects\n" "\" [object, ...]\" (array) A list of JSON objects\n"
); );
// This call will remove finished operations // This call will remove finished operations
return z_getoperationstatus_IMPL(params, true); return z_getoperationstatus_IMPL(params, true);
} }
@@ -3227,7 +3227,7 @@ UniValue z_getoperationstatus(const UniValue& params, bool fHelp)
"\nResult:\n" "\nResult:\n"
"\" [object, ...]\" (array) A list of JSON objects\n" "\" [object, ...]\" (array) A list of JSON objects\n"
); );
// This call is idempotent so we don't want to remove finished operations // This call is idempotent so we don't want to remove finished operations
return z_getoperationstatus_IMPL(params, false); return z_getoperationstatus_IMPL(params, false);
} }
@@ -3252,7 +3252,7 @@ UniValue z_getoperationstatus_IMPL(const UniValue& params, bool fRemoveFinishedO
for (auto id : ids) { for (auto id : ids) {
if (useFilter && !filter.count(id)) if (useFilter && !filter.count(id))
continue; continue;
std::shared_ptr<AsyncRPCOperation> operation = q->getOperationForId(id); std::shared_ptr<AsyncRPCOperation> operation = q->getOperationForId(id);
if (!operation) { if (!operation) {
continue; continue;