![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
#include <addresstype.h>#include <clientversion.h>#include <coins.h>#include <streams.h>#include <test/util/common.h>#include <test/util/poolresourcetester.h>#include <test/util/random.h>#include <test/util/setup_common.h>#include <txdb.h>#include <uint256.h>#include <undo.h>#include <util/strencodings.h>#include <map>#include <string>#include <variant>#include <vector>#include <boost/test/unit_test.hpp>Go to the source code of this file.
Classes | |
| struct | CacheTest |
| struct | UpdateTest |
| struct | CoinEntry |
| class | SingleEntryCacheTest |
| struct | FlushTest |
Typedefs | |
| using | MaybeCoin = std::optional<CoinEntry> |
| using | CoinOrError = std::variant<MaybeCoin, std::string> |
Functions | |
| int | ApplyTxInUndo (Coin &&undo, CCoinsViewCache &view, const COutPoint &out) |
| Restore the UTXO in a Coin at a given COutPoint. | |
| void | UpdateCoins (const CTransaction &tx, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight) |
| BOOST_FIXTURE_TEST_CASE (coins_cache_base_simulation_test, CacheTest) | |
| BOOST_FIXTURE_TEST_CASE (coins_cache_dbbase_simulation_test, CacheTest) | |
| BOOST_FIXTURE_TEST_CASE (updatecoins_simulation_test, UpdateTest) | |
| BOOST_AUTO_TEST_CASE (ccoins_serialization) | |
| static void | SetCoinsValue (const CAmount value, Coin &coin) |
| static size_t | InsertCoinsMapEntry (CCoinsMap &map, CoinsCachePair &sentinel, const CoinEntry &cache_coin) |
| static MaybeCoin | GetCoinsMapEntry (const CCoinsMap &map, const COutPoint &outp=OUTPOINT) |
| static void | WriteCoinsViewEntry (CCoinsView &view, const MaybeCoin &cache_coin) |
| static void | CheckAccessCoin (const CAmount base_value, const MaybeCoin &cache_coin, const MaybeCoin &expected) |
| BOOST_AUTO_TEST_CASE (ccoins_access) | |
| static void | CheckSpendCoins (const CAmount base_value, const MaybeCoin &cache_coin, const MaybeCoin &expected) |
| BOOST_AUTO_TEST_CASE (ccoins_spend) | |
| static void | CheckAddCoin (const CAmount base_value, const MaybeCoin &cache_coin, const CAmount modify_value, const CoinOrError &expected, const bool coinbase) |
| BOOST_AUTO_TEST_CASE (ccoins_add) | |
| static void | CheckWriteCoins (const MaybeCoin &parent, const MaybeCoin &child, const CoinOrError &expected) |
| BOOST_AUTO_TEST_CASE (ccoins_write) | |
| BOOST_FIXTURE_TEST_CASE (ccoins_flush_behavior, FlushTest) | |
| BOOST_AUTO_TEST_CASE (coins_resource_is_used) | |
| BOOST_AUTO_TEST_CASE (ccoins_addcoin_exception_keeps_usage_balanced) | |
| BOOST_AUTO_TEST_CASE (ccoins_emplace_duplicate_keeps_usage_balanced) | |
| BOOST_AUTO_TEST_CASE (ccoins_reset_guard) | |
| BOOST_AUTO_TEST_CASE (ccoins_peekcoin) | |
Variables | |
| static const unsigned int | NUM_SIMULATION_ITERATIONS = 40000 |
| static const COutPoint | OUTPOINT |
| constexpr CAmount | SPENT {-1} |
| constexpr CAmount | ABSENT {-2} |
| constexpr CAmount | VALUE1 {100} |
| constexpr CAmount | VALUE2 {200} |
| constexpr CAmount | VALUE3 {300} |
| constexpr MaybeCoin | MISSING {std::nullopt} |
| constexpr MaybeCoin | SPENT_DIRTY {{SPENT, CoinEntry::State::DIRTY}} |
| constexpr MaybeCoin | SPENT_DIRTY_FRESH {{SPENT, CoinEntry::State::DIRTY_FRESH}} |
| constexpr MaybeCoin | SPENT_FRESH {{SPENT, CoinEntry::State::FRESH}} |
| constexpr MaybeCoin | SPENT_CLEAN {{SPENT, CoinEntry::State::CLEAN}} |
| constexpr MaybeCoin | VALUE1_DIRTY {{VALUE1, CoinEntry::State::DIRTY}} |
| constexpr MaybeCoin | VALUE1_DIRTY_FRESH {{VALUE1, CoinEntry::State::DIRTY_FRESH}} |
| constexpr MaybeCoin | VALUE1_FRESH {{VALUE1, CoinEntry::State::FRESH}} |
| constexpr MaybeCoin | VALUE1_CLEAN {{VALUE1, CoinEntry::State::CLEAN}} |
| constexpr MaybeCoin | VALUE2_DIRTY {{VALUE2, CoinEntry::State::DIRTY}} |
| constexpr MaybeCoin | VALUE2_DIRTY_FRESH {{VALUE2, CoinEntry::State::DIRTY_FRESH}} |
| constexpr MaybeCoin | VALUE2_FRESH {{VALUE2, CoinEntry::State::FRESH}} |
| constexpr MaybeCoin | VALUE2_CLEAN {{VALUE2, CoinEntry::State::CLEAN}} |
| constexpr MaybeCoin | VALUE3_DIRTY {{VALUE3, CoinEntry::State::DIRTY}} |
| constexpr MaybeCoin | VALUE3_DIRTY_FRESH {{VALUE3, CoinEntry::State::DIRTY_FRESH}} |
| constexpr auto | EX_OVERWRITE_UNSPENT {"Attempted to overwrite an unspent coin (when possible_overwrite is false)"} |
| constexpr auto | EX_FRESH_MISAPPLIED {"FRESH flag misapplied to coin that exists in parent cache"} |
| using CoinOrError = std::variant<MaybeCoin, std::string> |
Definition at line 600 of file coins_tests.cpp.
Definition at line 599 of file coins_tests.cpp.
| int ApplyTxInUndo | ( | Coin && | undo, |
| CCoinsViewCache & | view, | ||
| const COutPoint & | out ) |
Restore the UTXO in a Coin at a given COutPoint.
| undo | The Coin to be restored. |
| view | The coins view to which to apply the changes. |
| out | The out point that corresponds to the tx input. |
Definition at line 2146 of file validation.cpp.
| BOOST_AUTO_TEST_CASE | ( | ccoins_access | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_add | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_addcoin_exception_keeps_usage_balanced | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_emplace_duplicate_keeps_usage_balanced | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_peekcoin | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_reset_guard | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_serialization | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_spend | ) |
| BOOST_AUTO_TEST_CASE | ( | ccoins_write | ) |
| BOOST_AUTO_TEST_CASE | ( | coins_resource_is_used | ) |
| BOOST_FIXTURE_TEST_CASE | ( | ccoins_flush_behavior | , |
| FlushTest | ) |
Definition at line 1049 of file coins_tests.cpp.
| BOOST_FIXTURE_TEST_CASE | ( | coins_cache_base_simulation_test | , |
| CacheTest | ) |
| BOOST_FIXTURE_TEST_CASE | ( | coins_cache_dbbase_simulation_test | , |
| CacheTest | ) |
| BOOST_FIXTURE_TEST_CASE | ( | updatecoins_simulation_test | , |
| UpdateTest | ) |
|
static |
Definition at line 685 of file coins_tests.cpp.
|
static |
Definition at line 746 of file coins_tests.cpp.
|
static |
Definition at line 716 of file coins_tests.cpp.
|
static |
Definition at line 792 of file coins_tests.cpp.
Definition at line 644 of file coins_tests.cpp.
|
static |
Definition at line 633 of file coins_tests.cpp.
Definition at line 621 of file coins_tests.cpp.
| void UpdateCoins | ( | const CTransaction & | tx, |
| CCoinsViewCache & | inputs, | ||
| CTxUndo & | txundo, | ||
| int | nHeight ) |
Definition at line 1996 of file validation.cpp.
|
static |
Definition at line 654 of file coins_tests.cpp.
|
constexpr |
Definition at line 571 of file coins_tests.cpp.
|
constexpr |
Definition at line 619 of file coins_tests.cpp.
|
constexpr |
Definition at line 618 of file coins_tests.cpp.
|
constexpr |
Definition at line 602 of file coins_tests.cpp.
|
static |
Definition at line 104 of file coins_tests.cpp.
|
static |
Definition at line 569 of file coins_tests.cpp.
|
constexpr |
Definition at line 570 of file coins_tests.cpp.
Definition at line 606 of file coins_tests.cpp.
Definition at line 603 of file coins_tests.cpp.
Definition at line 604 of file coins_tests.cpp.
Definition at line 605 of file coins_tests.cpp.
|
constexpr |
Definition at line 572 of file coins_tests.cpp.
Definition at line 610 of file coins_tests.cpp.
Definition at line 607 of file coins_tests.cpp.
Definition at line 608 of file coins_tests.cpp.
Definition at line 609 of file coins_tests.cpp.
|
constexpr |
Definition at line 573 of file coins_tests.cpp.
Definition at line 614 of file coins_tests.cpp.
Definition at line 611 of file coins_tests.cpp.
Definition at line 612 of file coins_tests.cpp.
Definition at line 613 of file coins_tests.cpp.
|
constexpr |
Definition at line 574 of file coins_tests.cpp.
Definition at line 615 of file coins_tests.cpp.
Definition at line 616 of file coins_tests.cpp.