refactor: store by OutputType in CoinsResult

Store COutputs by OutputType in CoinsResult.

The struct stores vectors of `COutput`s by `OutputType`
for more convenient access
This commit is contained in:
josibake
2022-03-11 16:30:04 +01:00
parent 948f5ba636
commit 2e67291ca3
5 changed files with 109 additions and 14 deletions

View File

@@ -591,7 +591,7 @@ BOOST_FIXTURE_TEST_CASE(ListCoinsTest, ListCoinsTestingSetup)
// Lock both coins. Confirm number of available coins drops to 0.
{
LOCK(wallet->cs_wallet);
BOOST_CHECK_EQUAL(AvailableCoinsListUnspent(*wallet).coins.size(), 2U);
BOOST_CHECK_EQUAL(AvailableCoinsListUnspent(*wallet).size(), 2U);
}
for (const auto& group : list) {
for (const auto& coin : group.second) {
@@ -601,7 +601,7 @@ BOOST_FIXTURE_TEST_CASE(ListCoinsTest, ListCoinsTestingSetup)
}
{
LOCK(wallet->cs_wallet);
BOOST_CHECK_EQUAL(AvailableCoinsListUnspent(*wallet).coins.size(), 0U);
BOOST_CHECK_EQUAL(AvailableCoinsListUnspent(*wallet).size(), 0U);
}
// Confirm ListCoins still returns same result as before, despite coins
// being locked.