|
|
|
@ -317,7 +317,11 @@ BOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)
|
|
|
|
|
|
|
|
|
|
// Confirm ListCoins initially returns 1 coin grouped under coinbaseKey
|
|
|
|
|
// address.
|
|
|
|
|
auto list = wallet->ListCoins();
|
|
|
|
|
std::map<CTxDestination, std::vector<COutput>> list;
|
|
|
|
|
{
|
|
|
|
|
LOCK2(cs_main, wallet->cs_wallet);
|
|
|
|
|
list = wallet->ListCoins();
|
|
|
|
|
}
|
|
|
|
|
BOOST_CHECK_EQUAL(list.size(), 1U);
|
|
|
|
|
BOOST_CHECK_EQUAL(boost::get<CKeyID>(list.begin()->first).ToString(), coinbaseAddress);
|
|
|
|
|
BOOST_CHECK_EQUAL(list.begin()->second.size(), 1U);
|
|
|
|
@ -330,7 +334,10 @@ BOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)
|
|
|
|
|
// coinbaseKey pubkey, even though the change address has a different
|
|
|
|
|
// pubkey.
|
|
|
|
|
AddTx(CRecipient{GetScriptForRawPubKey({}), 1 * COIN, false /* subtract fee */});
|
|
|
|
|
{
|
|
|
|
|
LOCK2(cs_main, wallet->cs_wallet);
|
|
|
|
|
list = wallet->ListCoins();
|
|
|
|
|
}
|
|
|
|
|
BOOST_CHECK_EQUAL(list.size(), 1U);
|
|
|
|
|
BOOST_CHECK_EQUAL(boost::get<CKeyID>(list.begin()->first).ToString(), coinbaseAddress);
|
|
|
|
|
BOOST_CHECK_EQUAL(list.begin()->second.size(), 2U);
|
|
|
|
@ -356,7 +363,10 @@ BOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)
|
|
|
|
|
}
|
|
|
|
|
// Confirm ListCoins still returns same result as before, despite coins
|
|
|
|
|
// being locked.
|
|
|
|
|
{
|
|
|
|
|
LOCK2(cs_main, wallet->cs_wallet);
|
|
|
|
|
list = wallet->ListCoins();
|
|
|
|
|
}
|
|
|
|
|
BOOST_CHECK_EQUAL(list.size(), 1U);
|
|
|
|
|
BOOST_CHECK_EQUAL(boost::get<CKeyID>(list.begin()->first).ToString(), coinbaseAddress);
|
|
|
|
|
BOOST_CHECK_EQUAL(list.begin()->second.size(), 2U);
|
|
|
|
|