|
|
|
@ -80,11 +80,15 @@ BOOST_AUTO_TEST_CASE(rpc_wallet)
|
|
|
|
|
walletdb.WriteAccount(strAccount, account);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
CPubKey setaccountDemoPubkey = pwalletMain->GenerateNewKey();
|
|
|
|
|
CBitcoinAddress setaccountDemoAddress = CBitcoinAddress(CTxDestination(setaccountDemoPubkey.GetID()));
|
|
|
|
|
|
|
|
|
|
/*********************************
|
|
|
|
|
* setaccount
|
|
|
|
|
*********************************/
|
|
|
|
|
BOOST_CHECK_NO_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ nullaccount"));
|
|
|
|
|
BOOST_CHECK_NO_THROW(CallRPC("setaccount " + setaccountDemoAddress.ToString() + " nullaccount"));
|
|
|
|
|
/* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ is not owned by the test wallet. */
|
|
|
|
|
BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ nullaccount"), runtime_error);
|
|
|
|
|
BOOST_CHECK_THROW(CallRPC("setaccount"), runtime_error);
|
|
|
|
|
/* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X (33 chars) is an illegal address (should be 34 chars) */
|
|
|
|
|
BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X nullaccount"), runtime_error);
|
|
|
|
|