14#include <test/util/mining.h>
15#include <test/util/script.h>
16#include <test/util/setup_common.h>
17#include <test/util/wallet.h>
27 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
28 const Config &config = test_setup->m_node.chainman->GetConfig();
34 constexpr size_t NUM_BLOCKS{200};
36 for (
size_t b = 0; b < NUM_BLOCKS; ++b) {
38 tx.
vin.push_back(MineBlock(config, test_setup->m_node, P2SH_OP_TRUE));
39 tx.
vin.back().scriptSig = scriptSig;
44 << std::vector<uint8_t>(100));
53 for (
const auto &txr : txs) {
55 test_setup->m_node.chainman->ProcessTransaction(txr);
60 bench.
run([&] { PrepareBlock(config, test_setup->m_node, P2SH_OP_TRUE); });
65 auto testing_setup{MakeNoLogFileContext<TestChain100Setup>()};
66 testing_setup->PopulateMempool(det_rand, 1000,
68 const Config &config = testing_setup->m_node.chainman->GetConfig();
73 PrepareBlock(config, testing_setup->m_node, P2SH_OP_TRUE,
80 auto testing_setup = MakeNoLogFileContext<AvalancheTestChain100Setup>();
81 testing_setup->PopulateMempool(det_rand, 1000,
83 const Config &config = testing_setup->m_node.chainman->GetConfig();
89 PrepareBlock(config, testing_setup->m_node, P2SH_OP_TRUE,
static constexpr Amount SATOSHI
static void AssembleBlock(benchmark::Bench &bench)
static void BlockAssemblerAddPackageTxns(benchmark::Bench &bench)
const CScript redeemScript
static void BlockAssemblerAddPackageTxnsPreconsensus(benchmark::Bench &bench)
A mutable version of CTransaction.
std::vector< CTxOut > vout
A reference to a CScript: the Hash160 of its serialization (see script.h)
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule).
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
static CTransactionRef MakeTransactionRef()
std::shared_ptr< const CTransaction > CTransactionRef
std::vector< uint8_t > ToByteVector(const T &in)
static constexpr Amount zero() noexcept
Validation result for a transaction evaluated by MemPoolAccept (single or package).
const ResultType m_result_type
Result type.
@ VALID
Fully validated, valid.