Create placeholder transactions that have no meaning.
| 30 | struct TxPackageTest : TestChain100Setup { |
| 31 | // Create placeholder transactions that have no meaning. |
| 32 | inline CTransactionRef create_placeholder_tx(size_t num_inputs, size_t num_outputs) |
| 33 | { |
| 34 | CMutableTransaction mtx = CMutableTransaction(); |
| 35 | mtx.vin.resize(num_inputs); |
| 36 | mtx.vout.resize(num_outputs); |
| 37 | auto random_script = CScript() << ToByteVector(m_rng.rand256()) << ToByteVector(m_rng.rand256()); |
| 38 | for (size_t i{0}; i < num_inputs; ++i) { |
| 39 | mtx.vin[i].prevout.hash = Txid::FromUint256(m_rng.rand256()); |
| 40 | mtx.vin[i].prevout.n = 0; |
| 41 | mtx.vin[i].scriptSig = random_script; |
| 42 | } |
| 43 | for (size_t o{0}; o < num_outputs; ++o) { |
| 44 | mtx.vout[o].nValue = 1 * CENT; |
| 45 | mtx.vout[o].scriptPubKey = random_script; |
| 46 | } |
| 47 | return MakeTransactionRef(mtx); |
| 48 | } |
| 49 | }; // struct TxPackageTest |
| 50 | |
| 51 | BOOST_FIXTURE_TEST_SUITE(txpackage_tests, TxPackageTest) |
nothing calls this directly
no test coverage detected