* Builds a creationTx from scriptPubKey and a spendingTx from scriptSig * and witness such that spendingTx spends output zero of creationTx. * Also inserts creationTx's output into the coins view. */
| 85 | * Also inserts creationTx's output into the coins view. |
| 86 | */ |
| 87 | static void BuildTxs(CMutableTransaction& spendingTx, CCoinsViewCache& coins, CMutableTransaction& creationTx, const CScript& scriptPubKey, const CScript& scriptSig, const CScriptWitness& witness) |
| 88 | { |
| 89 | creationTx.version = 1; |
| 90 | creationTx.vin.resize(1); |
| 91 | creationTx.vin[0].prevout.SetNull(); |
| 92 | creationTx.vin[0].scriptSig = CScript(); |
| 93 | creationTx.vout.resize(1); |
| 94 | creationTx.vout[0].nValue = 1; |
| 95 | creationTx.vout[0].scriptPubKey = scriptPubKey; |
| 96 | |
| 97 | spendingTx.version = 1; |
| 98 | spendingTx.vin.resize(1); |
| 99 | spendingTx.vin[0].prevout.hash = creationTx.GetHash(); |
| 100 | spendingTx.vin[0].prevout.n = 0; |
| 101 | spendingTx.vin[0].scriptSig = scriptSig; |
| 102 | spendingTx.vin[0].scriptWitness = witness; |
| 103 | spendingTx.vout.resize(1); |
| 104 | spendingTx.vout[0].nValue = 1; |
| 105 | spendingTx.vout[0].scriptPubKey = CScript(); |
| 106 | |
| 107 | AddCoins(coins, CTransaction(creationTx), 0); |
| 108 | } |
| 109 | |
| 110 | BOOST_AUTO_TEST_CASE(GetTxSigOpCost) |
| 111 | { |
no test coverage detected