Fix comments.
This commit is contained in:
@@ -19,7 +19,7 @@ TEST(wallet_zkeys_tests, store_and_load_zkeys) {
|
|||||||
|
|
||||||
CWallet wallet;
|
CWallet wallet;
|
||||||
|
|
||||||
// wallet should by empty
|
// wallet should be empty
|
||||||
std::set<libzcash::PaymentAddress> addrs;
|
std::set<libzcash::PaymentAddress> addrs;
|
||||||
wallet.GetPaymentAddresses(addrs);
|
wallet.GetPaymentAddresses(addrs);
|
||||||
ASSERT_EQ(0, addrs.size());
|
ASSERT_EQ(0, addrs.size());
|
||||||
@@ -86,7 +86,7 @@ TEST(wallet_zkeys_tests, write_zkey_direct_to_db) {
|
|||||||
// No default CPubKey set
|
// No default CPubKey set
|
||||||
ASSERT_TRUE(fFirstRun);
|
ASSERT_TRUE(fFirstRun);
|
||||||
|
|
||||||
// wallet should by empty
|
// wallet should be empty
|
||||||
std::set<libzcash::PaymentAddress> addrs;
|
std::set<libzcash::PaymentAddress> addrs;
|
||||||
wallet.GetPaymentAddresses(addrs);
|
wallet.GetPaymentAddresses(addrs);
|
||||||
ASSERT_EQ(0, addrs.size());
|
ASSERT_EQ(0, addrs.size());
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ BOOST_AUTO_TEST_CASE(rpc_wallet_z_exportwallet)
|
|||||||
{
|
{
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
|
|
||||||
// wallet should by empty
|
// wallet should be empty
|
||||||
std::set<libzcash::PaymentAddress> addrs;
|
std::set<libzcash::PaymentAddress> addrs;
|
||||||
pwalletMain->GetPaymentAddresses(addrs);
|
pwalletMain->GetPaymentAddresses(addrs);
|
||||||
BOOST_CHECK(addrs.size()==0);
|
BOOST_CHECK(addrs.size()==0);
|
||||||
@@ -297,9 +297,6 @@ BOOST_AUTO_TEST_CASE(rpc_wallet_z_importwallet)
|
|||||||
auto testPaymentAddress = testSpendingKey.address();
|
auto testPaymentAddress = testSpendingKey.address();
|
||||||
std::string testAddr = CZCPaymentAddress(testPaymentAddress).ToString();
|
std::string testAddr = CZCPaymentAddress(testPaymentAddress).ToString();
|
||||||
std::string testKey = CZCSpendingKey(testSpendingKey).ToString();
|
std::string testKey = CZCSpendingKey(testSpendingKey).ToString();
|
||||||
|
|
||||||
// std::cout << "testAddr = " << testAddr << std::endl;
|
|
||||||
// std::cout << "testKey = " << testKey << std::endl;
|
|
||||||
|
|
||||||
// create test data using the random key
|
// create test data using the random key
|
||||||
std::string format_str = "# Wallet dump created by Zcash v0.11.2.0.z8-9155cc6-dirty (2016-08-11 11:37:00 -0700)\n"
|
std::string format_str = "# Wallet dump created by Zcash v0.11.2.0.z8-9155cc6-dirty (2016-08-11 11:37:00 -0700)\n"
|
||||||
@@ -315,8 +312,6 @@ BOOST_AUTO_TEST_CASE(rpc_wallet_z_importwallet)
|
|||||||
|
|
||||||
boost::format formatobject(format_str);
|
boost::format formatobject(format_str);
|
||||||
std::string testWalletDump = (formatobject % testKey % testAddr).str();
|
std::string testWalletDump = (formatobject % testKey % testAddr).str();
|
||||||
|
|
||||||
// std::cout << "testWalletDump =\n" << testWalletDump << std::endl;
|
|
||||||
|
|
||||||
// write test data to file
|
// write test data to file
|
||||||
boost::filesystem::path temp = boost::filesystem::temp_directory_path() /
|
boost::filesystem::path temp = boost::filesystem::temp_directory_path() /
|
||||||
@@ -343,19 +338,16 @@ BOOST_AUTO_TEST_CASE(rpc_wallet_z_importwallet)
|
|||||||
auto addr = address.Get();
|
auto addr = address.Get();
|
||||||
BOOST_CHECK(pwalletMain->HaveSpendingKey(addr));
|
BOOST_CHECK(pwalletMain->HaveSpendingKey(addr));
|
||||||
|
|
||||||
// Verify the spending keys is the same as the test data
|
// Verify the spending key is the same as the test data
|
||||||
libzcash::SpendingKey k;
|
libzcash::SpendingKey k;
|
||||||
BOOST_CHECK(pwalletMain->GetSpendingKey(addr, k));
|
BOOST_CHECK(pwalletMain->GetSpendingKey(addr, k));
|
||||||
CZCSpendingKey spendingkey(k);
|
CZCSpendingKey spendingkey(k);
|
||||||
BOOST_CHECK_EQUAL(testKey, spendingkey.ToString());
|
BOOST_CHECK_EQUAL(testKey, spendingkey.ToString());
|
||||||
|
|
||||||
// std::cout << "address = " << address.ToString() << std::endl;
|
|
||||||
// std::cout << "spendingkey = " << spendingkey.ToString() << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This test covers RPC command z_listaddresses, z_importkey, z_exportkey
|
* This test covers RPC commands z_listaddresses, z_importkey, z_exportkey
|
||||||
*/
|
*/
|
||||||
BOOST_AUTO_TEST_CASE(rpc_wallet_z_importexport)
|
BOOST_AUTO_TEST_CASE(rpc_wallet_z_importexport)
|
||||||
{
|
{
|
||||||
@@ -412,7 +404,7 @@ BOOST_AUTO_TEST_CASE(rpc_wallet_z_importexport)
|
|||||||
arr = retValue.get_array();
|
arr = retValue.get_array();
|
||||||
BOOST_CHECK(arr.size() == numAddrs);
|
BOOST_CHECK(arr.size() == numAddrs);
|
||||||
|
|
||||||
// Create a set form them
|
// Create a set from them
|
||||||
std::unordered_set<std::string> listaddrs;
|
std::unordered_set<std::string> listaddrs;
|
||||||
for (Value element : arr) {
|
for (Value element : arr) {
|
||||||
listaddrs.insert(element.get_str());
|
listaddrs.insert(element.get_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user