MCPcopy Create free account
hub / github.com/LUX-Core/lux / BuildSpendingTransaction

Function BuildSpendingTransaction

src/test/script_tests.cpp:151–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CMutableTransaction& txCredit)
152{
153 CMutableTransaction txSpend;
154 txSpend.nVersion = 1;
155 txSpend.nLockTime = 0;
156 txSpend.vin.resize(1);
157 txSpend.vout.resize(1);
158 txSpend.wit.vtxinwit[0].scriptWitness = scriptWitness;
159 txSpend.vin[0].prevout.hash = txCredit.GetHash();
160 txSpend.vin[0].prevout.n = 0;
161 txSpend.vin[0].scriptSig = scriptSig;
162 txSpend.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;
163 txSpend.vout[0].scriptPubKey = CScript();
164 txSpend.vout[0].nValue = txCredit.vout[0].nValue;
165
166 return txSpend;
167}
168
169void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScriptWitness& scriptWitness, int flags, const std::string& message, int scriptError, CAmount nValue = 0)
170{

Callers 3

DoTestFunction · 0.85
TestBuilderMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

CScriptClass · 0.50
resizeMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected