Changeset View
Changeset View
Standalone View
Standalone View
src/test/sigopcount_tests.cpp
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | void BuildTxs(CMutableTransaction &spendingTx, CCoinsViewCache &coins, | ||||
spendingTx.vin.resize(1); | spendingTx.vin.resize(1); | ||||
spendingTx.vin[0].prevout.hash = creationTx.GetId(); | spendingTx.vin[0].prevout.hash = creationTx.GetId(); | ||||
spendingTx.vin[0].prevout.n = 0; | spendingTx.vin[0].prevout.n = 0; | ||||
spendingTx.vin[0].scriptSig = scriptSig; | spendingTx.vin[0].scriptSig = scriptSig; | ||||
spendingTx.vout.resize(1); | spendingTx.vout.resize(1); | ||||
spendingTx.vout[0].nValue = 1; | spendingTx.vout[0].nValue = 1; | ||||
spendingTx.vout[0].scriptPubKey = CScript(); | spendingTx.vout[0].scriptPubKey = CScript(); | ||||
coins.ModifyCoins(creationTx.GetId())->FromTx(creationTx, 0); | AddCoins(coins, creationTx, 0); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(GetTxSigOpCost) { | BOOST_AUTO_TEST_CASE(GetTxSigOpCost) { | ||||
// Transaction creates outputs | // Transaction creates outputs | ||||
CMutableTransaction creationTx; | CMutableTransaction creationTx; | ||||
// Transaction that spends outputs and whose sig op cost is going to be | // Transaction that spends outputs and whose sig op cost is going to be | ||||
// tested | // tested | ||||
CMutableTransaction spendingTx; | CMutableTransaction spendingTx; | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |