MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / BuildSpendingTransaction

Function BuildSpendingTransaction

src/test/script_tests.cpp:141–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit)
142{
143 CMutableTransaction txSpend;
144 txSpend.nVersion = 1;
145 txSpend.nLockTime = 0;
146 txSpend.vin.resize(1);
147 txSpend.vout.resize(1);
148 txSpend.vin[0].scriptWitness = scriptWitness;
149 txSpend.vin[0].prevout.hash = txCredit.GetHash();
150 txSpend.vin[0].prevout.n = 0;
151 txSpend.vin[0].scriptSig = scriptSig;
152 txSpend.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;
153 txSpend.vout[0].scriptPubKey = CScript();
154 txSpend.vout[0].nValue = txCredit.vout[0].nValue;
155
156 return txSpend;
157}
158
159void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScriptWitness& scriptWitness, int flags, const std::string& message, int scriptError, CAmount nValue = 0)
160{

Callers 3

DoTestFunction · 0.70
TestBuilderMethod · 0.70
BOOST_AUTO_TEST_CASEFunction · 0.70

Calls 3

CScriptClass · 0.70
resizeMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected