![]() |
Bitcoin Core
22.99.0
P2P Digital Currency
|
#include <attributes.h>
#include <clientversion.h>
#include <coins.h>
#include <script/standard.h>
#include <streams.h>
#include <test/util/setup_common.h>
#include <txdb.h>
#include <uint256.h>
#include <undo.h>
#include <util/strencodings.h>
#include <map>
#include <vector>
#include <boost/test/unit_test.hpp>
Go to the source code of this file.
Classes | |
class | SingleEntryCacheTest |
Typedefs | |
typedef std::map< COutPoint, std::tuple< CTransaction, CTxUndo, Coin > > | UtxoData |
Functions | |
int | ApplyTxInUndo (Coin &&undo, CCoinsViewCache &view, const COutPoint &out) |
Restore the UTXO in a Coin at a given COutPoint. More... | |
void | UpdateCoins (const CTransaction &tx, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight) |
void | SimulationTest (CCoinsView *base, bool fake_best_block) |
BOOST_AUTO_TEST_CASE (coins_cache_simulation_test) | |
UtxoData::iterator | FindRandomFrom (const std::set< COutPoint > &utxoSet) |
BOOST_AUTO_TEST_CASE (updatecoins_simulation_test) | |
BOOST_AUTO_TEST_CASE (ccoins_serialization) | |
static void | SetCoinsValue (CAmount value, Coin &coin) |
static size_t | InsertCoinsMapEntry (CCoinsMap &map, CAmount value, char flags) |
void | GetCoinsMapEntry (const CCoinsMap &map, CAmount &value, char &flags) |
void | WriteCoinsViewEntry (CCoinsView &view, CAmount value, char flags) |
static void | CheckAccessCoin (CAmount base_value, CAmount cache_value, CAmount expected_value, char cache_flags, char expected_flags) |
BOOST_AUTO_TEST_CASE (ccoins_access) | |
static void | CheckSpendCoins (CAmount base_value, CAmount cache_value, CAmount expected_value, char cache_flags, char expected_flags) |
BOOST_AUTO_TEST_CASE (ccoins_spend) | |
static void | CheckAddCoinBase (CAmount base_value, CAmount cache_value, CAmount modify_value, CAmount expected_value, char cache_flags, char expected_flags, bool coinbase) |
template<typename... Args> | |
static void | CheckAddCoin (Args &&... args) |
BOOST_AUTO_TEST_CASE (ccoins_add) | |
void | CheckWriteCoins (CAmount parent_value, CAmount child_value, CAmount expected_value, char parent_flags, char child_flags, char expected_flags) |
BOOST_AUTO_TEST_CASE (ccoins_write) | |
Variables | |
static const unsigned int | NUM_SIMULATION_ITERATIONS = 40000 |
UtxoData | utxoData |
const static COutPoint | OUTPOINT |
const static CAmount | SPENT = -1 |
const static CAmount | ABSENT = -2 |
const static CAmount | FAIL = -3 |
const static CAmount | VALUE1 = 100 |
const static CAmount | VALUE2 = 200 |
const static CAmount | VALUE3 = 300 |
const static char | DIRTY = CCoinsCacheEntry::DIRTY |
const static char | FRESH = CCoinsCacheEntry::FRESH |
const static char | NO_ENTRY = -1 |
const static auto | FLAGS = {char(0), FRESH, DIRTY, char(DIRTY | FRESH)} |
const static auto | CLEAN_FLAGS = {char(0), FRESH} |
const static auto | ABSENT_FLAGS = {NO_ENTRY} |
typedef std::map<COutPoint, std::tuple<CTransaction,CTxUndo,Coin> > UtxoData |
Definition at line 277 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 1735 of file validation.cpp.
BOOST_AUTO_TEST_CASE | ( | ccoins_access | ) |
BOOST_AUTO_TEST_CASE | ( | ccoins_add | ) |
BOOST_AUTO_TEST_CASE | ( | ccoins_serialization | ) |
BOOST_AUTO_TEST_CASE | ( | ccoins_spend | ) |
BOOST_AUTO_TEST_CASE | ( | ccoins_write | ) |
BOOST_AUTO_TEST_CASE | ( | coins_cache_simulation_test | ) |
BOOST_AUTO_TEST_CASE | ( | updatecoins_simulation_test | ) |
|
static |
Definition at line 631 of file coins_tests.cpp.
|
static |
Definition at line 760 of file coins_tests.cpp.
|
static |
Definition at line 733 of file coins_tests.cpp.
|
static |
Definition at line 682 of file coins_tests.cpp.
void CheckWriteCoins | ( | CAmount | parent_value, |
CAmount | child_value, | ||
CAmount | expected_value, | ||
char | parent_flags, | ||
char | child_flags, | ||
char | expected_flags | ||
) |
Definition at line 796 of file coins_tests.cpp.
UtxoData::iterator FindRandomFrom | ( | const std::set< COutPoint > & | utxoSet | ) |
Definition at line 280 of file coins_tests.cpp.
Definition at line 593 of file coins_tests.cpp.
Definition at line 578 of file coins_tests.cpp.
Definition at line 566 of file coins_tests.cpp.
void SimulationTest | ( | CCoinsView * | base, |
bool | fake_best_block | ||
) |
Definition at line 118 of file coins_tests.cpp.
void UpdateCoins | ( | const CTransaction & | tx, |
CCoinsViewCache & | inputs, | ||
CTxUndo & | txundo, | ||
int | nHeight | ||
) |
Definition at line 1575 of file validation.cpp.
void WriteCoinsViewEntry | ( | CCoinsView & | view, |
CAmount | value, | ||
char | flags | ||
) |
Definition at line 610 of file coins_tests.cpp.
|
static |
Definition at line 553 of file coins_tests.cpp.
|
static |
Definition at line 564 of file coins_tests.cpp.
|
static |
Definition at line 563 of file coins_tests.cpp.
|
static |
Definition at line 558 of file coins_tests.cpp.
|
static |
Definition at line 554 of file coins_tests.cpp.
Definition at line 562 of file coins_tests.cpp.
|
static |
Definition at line 559 of file coins_tests.cpp.
|
static |
Definition at line 560 of file coins_tests.cpp.
|
static |
Definition at line 102 of file coins_tests.cpp.
|
static |
Definition at line 551 of file coins_tests.cpp.
|
static |
Definition at line 552 of file coins_tests.cpp.
UtxoData utxoData |
Definition at line 278 of file coins_tests.cpp.
|
static |
Definition at line 555 of file coins_tests.cpp.
|
static |
Definition at line 556 of file coins_tests.cpp.
|
static |
Definition at line 557 of file coins_tests.cpp.