Browse Source

Updated help messages, used Kevacoin addresses.

issue_19
kevacoin 4 years ago
parent
commit
d3e8507182
  1. 36
      src/qt/test/uritests.cpp
  2. 12
      src/rpc/misc.cpp
  3. 44
      src/wallet/rpcwallet.cpp

36
src/qt/test/uritests.cpp

@ -13,54 +13,54 @@ void URITests::uriTests() @@ -13,54 +13,54 @@ void URITests::uriTests()
{
SendCoinsRecipient rv;
QUrl uri;
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?req-dontexist="));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?req-dontexist="));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?dontexist="));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?dontexist="));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2"));
QVERIFY(rv.address == QString("VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn"));
QVERIFY(rv.label == QString());
QVERIFY(rv.amount == 0);
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?label=Wikipedia Example Address"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?label=Wikipedia Example Address"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2"));
QVERIFY(rv.address == QString("VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn"));
QVERIFY(rv.label == QString("Wikipedia Example Address"));
QVERIFY(rv.amount == 0);
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?amount=0.001"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?amount=0.001"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2"));
QVERIFY(rv.address == QString("VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn"));
QVERIFY(rv.label == QString());
QVERIFY(rv.amount == 100000);
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?amount=1.001"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?amount=1.001"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2"));
QVERIFY(rv.address == QString("VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn"));
QVERIFY(rv.label == QString());
QVERIFY(rv.amount == 100100000);
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?amount=100&label=Wikipedia Example"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?amount=100&label=Wikipedia Example"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2"));
QVERIFY(rv.address == QString("VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn"));
QVERIFY(rv.amount == 10000000000LL);
QVERIFY(rv.label == QString("Wikipedia Example"));
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?message=Wikipedia Example Address"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?message=Wikipedia Example Address"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2"));
QVERIFY(rv.address == QString("VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn"));
QVERIFY(rv.label == QString());
QVERIFY(GUIUtil::parseBitcoinURI("kevacoin://LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?message=Wikipedia Example Address", &rv));
QVERIFY(rv.address == QString("LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2"));
QVERIFY(GUIUtil::parseBitcoinURI("kevacoin://VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?message=Wikipedia Example Address", &rv));
QVERIFY(rv.address == QString("VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn"));
QVERIFY(rv.label == QString());
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?req-message=Wikipedia Example Address"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?req-message=Wikipedia Example Address"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?amount=1,000&label=Wikipedia Example"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?amount=1,000&label=Wikipedia Example"));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
uri.setUrl(QString("kevacoin:LEr4HnaeFWYhBmGxCfP2po1NPRueIk8kM2?amount=1,000.0&label=Wikipedia Example"));
uri.setUrl(QString("kevacoin:VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn?amount=1,000.0&label=Wikipedia Example"));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
}

12
src/rpc/misc.cpp

@ -190,8 +190,8 @@ UniValue validateaddress(const JSONRPCRequest& request) @@ -190,8 +190,8 @@ UniValue validateaddress(const JSONRPCRequest& request)
" \"hdmasterkeyid\" : \"<hash160>\" (string, optional) The Hash160 of the HD master pubkey\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("validateaddress", "\"LER4HnAEFwYHbmGxCfP2po1nPrUeiK8KM2\"")
+ HelpExampleRpc("validateaddress", "\"LER4HnAEFwYHbmGxCfP2po1nPrUeiK8KM2\"")
+ HelpExampleCli("validateaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\"")
+ HelpExampleRpc("validateaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\"")
);
#ifdef ENABLE_WALLET
@ -336,11 +336,11 @@ UniValue verifymessage(const JSONRPCRequest& request) @@ -336,11 +336,11 @@ UniValue verifymessage(const JSONRPCRequest& request)
"\nUnlock the wallet for 30 seconds\n"
+ HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
"\nCreate the signature\n"
+ HelpExampleCli("signmessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"my message\"") +
+ HelpExampleCli("signmessage", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" \"my message\"") +
"\nVerify the signature\n"
+ HelpExampleCli("verifymessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"signature\" \"my message\"") +
+ HelpExampleCli("verifymessage", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" \"signature\" \"my message\"") +
"\nAs json rpc\n"
+ HelpExampleRpc("verifymessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\", \"signature\", \"my message\"")
+ HelpExampleRpc("verifymessage", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\", \"signature\", \"my message\"")
);
LOCK(cs_main);
@ -391,7 +391,7 @@ UniValue signmessagewithprivkey(const JSONRPCRequest& request) @@ -391,7 +391,7 @@ UniValue signmessagewithprivkey(const JSONRPCRequest& request)
"\nCreate the signature\n"
+ HelpExampleCli("signmessagewithprivkey", "\"privkey\" \"my message\"") +
"\nVerify the signature\n"
+ HelpExampleCli("verifymessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"signature\" \"my message\"") +
+ HelpExampleCli("verifymessage", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" \"signature\" \"my message\"") +
"\nAs json rpc\n"
+ HelpExampleRpc("signmessagewithprivkey", "\"privkey\", \"my message\"")
);

44
src/wallet/rpcwallet.cpp

@ -299,8 +299,8 @@ UniValue setaccount(const JSONRPCRequest& request) @@ -299,8 +299,8 @@ UniValue setaccount(const JSONRPCRequest& request)
"1. \"address\" (string, required) The kevacoin address to be associated with an account.\n"
"2. \"account\" (string, required) The account to assign the address to.\n"
"\nExamples:\n"
+ HelpExampleCli("setaccount", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"tabby\"")
+ HelpExampleRpc("setaccount", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\", \"tabby\"")
+ HelpExampleCli("setaccount", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" \"tabby\"")
+ HelpExampleRpc("setaccount", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\", \"tabby\"")
);
LOCK2(cs_main, pwallet->cs_wallet);
@ -348,8 +348,8 @@ UniValue getaccount(const JSONRPCRequest& request) @@ -348,8 +348,8 @@ UniValue getaccount(const JSONRPCRequest& request)
"\nResult:\n"
"\"accountname\" (string) the account address\n"
"\nExamples:\n"
+ HelpExampleCli("getaccount", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\"")
+ HelpExampleRpc("getaccount", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\"")
+ HelpExampleCli("getaccount", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\"")
+ HelpExampleRpc("getaccount", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\"")
);
LOCK2(cs_main, pwallet->cs_wallet);
@ -529,10 +529,10 @@ UniValue sendtoaddress(const JSONRPCRequest& request) @@ -529,10 +529,10 @@ UniValue sendtoaddress(const JSONRPCRequest& request)
"\nResult:\n"
"\"txid\" (string) The transaction id.\n"
"\nExamples:\n"
+ HelpExampleCli("sendtoaddress", "\"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\" 0.1")
+ HelpExampleCli("sendtoaddress", "\"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\" 0.1 \"donation\" \"seans outpost\"")
+ HelpExampleCli("sendtoaddress", "\"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\" 0.1 \"\" \"\" true")
+ HelpExampleRpc("sendtoaddress", "\"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\", 0.1, \"donation\", \"seans outpost\"")
+ HelpExampleCli("sendtoaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 0.1")
+ HelpExampleCli("sendtoaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 0.1 \"donation\" \"seans outpost\"")
+ HelpExampleCli("sendtoaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 0.1 \"\" \"\" true")
+ HelpExampleRpc("sendtoaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\", 0.1, \"donation\", \"seans outpost\"")
);
ObserveSafeMode();
@ -668,11 +668,11 @@ UniValue signmessage(const JSONRPCRequest& request) @@ -668,11 +668,11 @@ UniValue signmessage(const JSONRPCRequest& request)
"\nUnlock the wallet for 30 seconds\n"
+ HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
"\nCreate the signature\n"
+ HelpExampleCli("signmessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"my message\"") +
+ HelpExampleCli("signmessage", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" \"my message\"") +
"\nVerify the signature\n"
+ HelpExampleCli("verifymessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"signature\" \"my message\"") +
+ HelpExampleCli("verifymessage", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" \"signature\" \"my message\"") +
"\nAs json rpc\n"
+ HelpExampleRpc("signmessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\", \"my message\"")
+ HelpExampleRpc("signmessage", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\", \"my message\"")
);
LOCK2(cs_main, pwallet->cs_wallet);
@ -726,13 +726,13 @@ UniValue getreceivedbyaddress(const JSONRPCRequest& request) @@ -726,13 +726,13 @@ UniValue getreceivedbyaddress(const JSONRPCRequest& request)
"amount (numeric) The total amount in " + CURRENCY_UNIT + " received at this address.\n"
"\nExamples:\n"
"\nThe amount from transactions with at least 1 confirmation\n"
+ HelpExampleCli("getreceivedbyaddress", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\"") +
+ HelpExampleCli("getreceivedbyaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\"") +
"\nThe amount including unconfirmed transactions, zero confirmations\n"
+ HelpExampleCli("getreceivedbyaddress", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" 0") +
+ HelpExampleCli("getreceivedbyaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 0") +
"\nThe amount with at least 6 confirmations\n"
+ HelpExampleCli("getreceivedbyaddress", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" 6") +
+ HelpExampleCli("getreceivedbyaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 6") +
"\nAs a json rpc call\n"
+ HelpExampleRpc("getreceivedbyaddress", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\", 6")
+ HelpExampleRpc("getreceivedbyaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\", 6")
);
ObserveSafeMode();
@ -1024,11 +1024,11 @@ UniValue sendfrom(const JSONRPCRequest& request) @@ -1024,11 +1024,11 @@ UniValue sendfrom(const JSONRPCRequest& request)
"\"txid\" (string) The transaction id.\n"
"\nExamples:\n"
"\nSend 0.01 " + CURRENCY_UNIT + " from the default account to the address, must have at least 1 confirmation\n"
+ HelpExampleCli("sendfrom", "\"\" \"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\" 0.01") +
+ HelpExampleCli("sendfrom", "\"\" \"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 0.01") +
"\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\n"
+ HelpExampleCli("sendfrom", "\"tabby\" \"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\" 0.01 6 \"donation\" \"seans outpost\"") +
+ HelpExampleCli("sendfrom", "\"tabby\" \"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 0.01 6 \"donation\" \"seans outpost\"") +
"\nAs a json rpc call\n"
+ HelpExampleRpc("sendfrom", "\"tabby\", \"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\", 0.01, 6, \"donation\", \"seans outpost\"")
+ HelpExampleRpc("sendfrom", "\"tabby\", \"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\", 0.01, 6, \"donation\", \"seans outpost\"")
);
ObserveSafeMode();
@ -1116,7 +1116,7 @@ UniValue sendmany(const JSONRPCRequest& request) @@ -1116,7 +1116,7 @@ UniValue sendmany(const JSONRPCRequest& request)
"\nSend two amounts to two different addresses setting the confirmation and comment:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"VPV6zKqt3gBufa1V4jdPc9WMuHz6GYufTS\\\":0.01,\\\"VCGLU9RdqoQaFo19SziUzeke9pcDBomU2X\\\":0.02}\" 6 \"testing\"") +
"\nSend two amounts to two different addresses, subtract fee from amount:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"VPV6zKqt3gBufa1V4jdPc9WMuHz6GYufTS\\\":0.01,\\\"VCGLU9RdqoQaFo19SziUzeke9pcDBomU2X\\\":0.02}\" 1 \"\" \"[\\\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\\\",\\\"LbhhnrHHVFP1eUjP1tdNIYeEVsNHfN9FCw\\\"]\"") +
+ HelpExampleCli("sendmany", "\"\" \"{\\\"VPV6zKqt3gBufa1V4jdPc9WMuHz6GYufTS\\\":0.01,\\\"VCGLU9RdqoQaFo19SziUzeke9pcDBomU2X\\\":0.02}\" 1 \"\" \"[\\\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\\\",\\\"LbhhnrHHVFP1eUjP1tdNIYeEVsNHfN9FCw\\\"]\"") +
"\nAs a json rpc call\n"
+ HelpExampleRpc("sendmany", "\"\", {\"VPV6zKqt3gBufa1V4jdPc9WMuHz6GYufTS\":0.01,\"VCGLU9RdqoQaFo19SziUzeke9pcDBomU2X\":0.02}, 6, \"testing\"")
);
@ -1377,9 +1377,9 @@ UniValue addmultisigaddress(const JSONRPCRequest& request) @@ -1377,9 +1377,9 @@ UniValue addmultisigaddress(const JSONRPCRequest& request)
"\nExamples:\n"
"\nAdd a multisig address from 2 addresses\n"
+ HelpExampleCli("addmultisigaddress", "2 \"[\\\"LEr4hnAefwYhBmGxcFP2Po1NPrUEIk8KM2\\\",\\\"LYKr1oaPSqShthukmLDhdZsqUJgzVnQiAQ\\\"]\"") +
+ HelpExampleCli("addmultisigaddress", "2 \"[\\\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\\\",\\\"LYKr1oaPSqShthukmLDhdZsqUJgzVnQiAQ\\\"]\"") +
"\nAs json rpc call\n"
+ HelpExampleRpc("addmultisigaddress", "2, \"[\\\"LEr4hnAefwYhBmGxcFP2Po1NPrUEIk8KM2\\\",\\\"LYKr1oaPSqShthukmLDhdZsqUJgzVnQiAQ\\\"]\"")
+ HelpExampleRpc("addmultisigaddress", "2, \"[\\\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\\\",\\\"LYKr1oaPSqShthukmLDhdZsqUJgzVnQiAQ\\\"]\"")
;
throw std::runtime_error(msg);
}
@ -2634,7 +2634,7 @@ UniValue walletlock(const JSONRPCRequest& request) @@ -2634,7 +2634,7 @@ UniValue walletlock(const JSONRPCRequest& request)
"\nSet the passphrase for 2 minutes to perform a transaction\n"
+ HelpExampleCli("walletpassphrase", "\"my pass phrase\" 120") +
"\nPerform a send (requires passphrase set)\n"
+ HelpExampleCli("sendtoaddress", "\"LEr4HnaefWYHbMGXcFp2Po1NPRUeIk8km2\" 1.0") +
+ HelpExampleCli("sendtoaddress", "\"VTRMKQcFgd4LQyoBT28GNBrt9f6AaEUVJn\" 1.0") +
"\nClear the passphrase since we are done before 2 minutes is up\n"
+ HelpExampleCli("walletlock", "") +
"\nAs json rpc call\n"

Loading…
Cancel
Save