MCPcopy Create free account
hub / github.com/ElementsProject/elements / make_tx

Function make_tx

src/test/mempool_tests.cpp:576–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576inline CTransactionRef make_tx(std::vector<CAmount>&& output_values, std::vector<CTransactionRef>&& inputs=std::vector<CTransactionRef>(), std::vector<uint32_t>&& input_indices=std::vector<uint32_t>())
577{
578 CMutableTransaction tx = CMutableTransaction();
579 tx.vin.resize(inputs.size());
580 tx.vout.resize(output_values.size());
581 for (size_t i = 0; i < inputs.size(); ++i) {
582 tx.vin[i].prevout.hash = inputs[i]->GetHash();
583 tx.vin[i].prevout.n = input_indices.size() > i ? input_indices[i] : 0;
584 }
585 for (size_t i = 0; i < output_values.size(); ++i) {
586 tx.vout[i].scriptPubKey = CScript() << OP_11 << OP_EQUAL;
587 tx.vout[i].nValue = output_values[i];
588 }
589 return MakeTransactionRef(tx);
590}
591
592
593BOOST_AUTO_TEST_CASE(MempoolAncestryTests)

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 6

CMutableTransactionClass · 0.50
CScriptClass · 0.50
MakeTransactionRefFunction · 0.50
resizeMethod · 0.45
sizeMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected