5#include <chainparams.h>
24#include <validation.h>
44 "-testactivationheight=bip34@2",
53 const auto ActiveHeight = [&]() {
54 LOCK(chainman.GetMutex());
55 return chainman.ActiveHeight();
75 std::vector<std::pair<COutPoint, CTxOut>>
txos;
98 tx.vin.emplace_back(
txo.first);
99 tx.vout.emplace_back(
txo.second.nValue,
txo.second.scriptPubKey);
102 LOCK(chainman.GetMutex());
103 chainman.ActiveChainstate().ForceFlushStateToDisk(
wipe_cache);
114 assert(ActiveHeight() == 0);
141 assert(ActiveHeight() == 1);
int64_t CAmount
Amount in satoshis (Can be negative)
const CChainParams & Params()
Return the currently selected parameters.
#define Assert(val)
Identity function.
An outpoint - a combination of a transaction hash and an index n into its vout.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
const std::vector< CTxOut > vout
const Txid & GetHash() const LIFETIMEBOUND
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
T ConsumeIntegralInRange(T min, T max)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
static std::optional< CCoinsStats > ComputeUTXOStats(T hash_obj, const CCoinsViewDB &view, node::BlockManager &blockman, const std::function< void()> &interruption_point)
Calculate statistics about the unspent transaction output set.
void RegenerateCommitments(CBlock &block, ChainstateManager &chainman)
Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
A mutable version of CTransaction.
Testing setup that performs all steps up until right before ChainstateManager gets initialized.
void LoadVerifyActivateChainstate()
SeedRandomStateForTest(SeedRand::ZEROS)
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
std::shared_ptr< CBlock > PrepareBlock(const NodeContext &node, const node::BlockCreateOptions &assembler_options)
Prepare a block to be mined.
COutPoint MineBlock(const NodeContext &node, const node::BlockCreateOptions &assembler_options)
Returns the generated coin.
@ ZEROS
Seed with a compile time constant of zeros.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params &consensusParams)
FuzzedDataProvider & fuzzed_data_provider