test: Add util to mine invalid blocks

With the current utils it is only possible to mine valid blocks. This
commit adds new util methods to mine invalid blocks.
This commit is contained in:
MarcoFalke
2023-05-02 17:17:10 +02:00
parent 7b45d171f5
commit fa846ee074
4 changed files with 53 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ static void AssembleBlock(benchmark::Bench& bench)
std::array<CTransactionRef, NUM_BLOCKS - COINBASE_MATURITY + 1> txs;
for (size_t b{0}; b < NUM_BLOCKS; ++b) {
CMutableTransaction tx;
tx.vin.push_back(MineBlock(test_setup->m_node, P2WSH_OP_TRUE));
tx.vin.push_back(CTxIn{MineBlock(test_setup->m_node, P2WSH_OP_TRUE)});
tx.vin.back().scriptWitness = witness;
tx.vout.emplace_back(1337, P2WSH_OP_TRUE);
if (NUM_BLOCKS - b >= COINBASE_MATURITY)