MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / CheckAddCoinBase

Function CheckAddCoinBase

src/test/coins_tests.cpp:710–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708}
709
710static void CheckAddCoinBase(CAmount base_value, CAmount cache_value, CAmount modify_value, CAmount expected_value, char cache_flags, char expected_flags, bool coinbase)
711{
712 SingleEntryCacheTest test(base_value, cache_value, cache_flags);
713
714 CAmount result_value;
715 char result_flags;
716 try {
717 CTxOut output;
718 output.nValue = modify_value;
719 test.cache.AddCoin(OUTPOINT, Coin(std::move(output), 1, coinbase), coinbase);
720 test.cache.SelfTest();
721 GetCoinsMapEntry(test.cache.map(), result_value, result_flags);
722 } catch (std::logic_error& e) {
723 result_value = FAIL;
724 result_flags = NO_ENTRY;
725 }
726
727 BOOST_CHECK_EQUAL(result_value, expected_value);
728 BOOST_CHECK_EQUAL(result_flags, expected_flags);
729}
730
731// Simple wrapper for CheckAddCoinBase function above that loops through
732// different possible base_values, making sure each one gives the same results.

Callers 1

CheckAddCoinFunction · 0.85

Calls 4

GetCoinsMapEntryFunction · 0.85
AddCoinMethod · 0.80
SelfTestMethod · 0.80
CoinClass · 0.50

Tested by

no test coverage detected