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

Function BuildSpendingTransaction

src/test/util/transaction_utils.cpp:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit)
26{
27 CMutableTransaction txSpend;
28 txSpend.nVersion = 1;
29 txSpend.nLockTime = 0;
30 txSpend.vin.resize(1);
31 txSpend.vout.resize(1);
32 txSpend.witness.vtxinwit.resize(1);
33 txSpend.witness.vtxinwit[0].scriptWitness = scriptWitness;
34 txSpend.vin[0].prevout.hash = txCredit.GetHash();
35 txSpend.vin[0].prevout.n = 0;
36 txSpend.vin[0].scriptSig = scriptSig;
37 txSpend.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;
38 txSpend.vout[0].scriptPubKey = CScript();
39 txSpend.vout[0].nValue = txCredit.vout[0].nValue;
40
41 return txSpend;
42}
43
44std::vector<CMutableTransaction> SetupDummyInputs(FillableSigningProvider& keystoreRet, CCoinsViewCache& coinsRet, const std::array<CAmount,4>& nValues)
45{

Callers 4

DoTestFunction · 0.85
TestBuilderMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
VerifyScriptBenchFunction · 0.85

Calls 3

CScriptClass · 0.70
resizeMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected