Changeset View
Changeset View
Standalone View
Standalone View
src/test/sigopcount_tests.cpp
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | static void BuildTxs(CMutableTransaction &spendingTx, CCoinsViewCache &coins, | ||||
spendingTx.vin[0].scriptSig = scriptSig; | spendingTx.vin[0].scriptSig = scriptSig; | ||||
spendingTx.vout.resize(1); | spendingTx.vout.resize(1); | ||||
spendingTx.vout[0].nValue = SATOSHI; | spendingTx.vout[0].nValue = SATOSHI; | ||||
spendingTx.vout[0].scriptPubKey = CScript(); | spendingTx.vout[0].scriptPubKey = CScript(); | ||||
AddCoins(coins, CTransaction(creationTx), 0); | AddCoins(coins, CTransaction(creationTx), 0); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(GetTxSigOpCost) { | BOOST_AUTO_TEST_CASE(GetTxSigOpCount) { | ||||
// 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 count is going to be | ||||
// tested | // tested | ||||
CMutableTransaction spendingTx; | CMutableTransaction spendingTx; | ||||
// Create utxo set | // Create utxo set | ||||
CCoinsView coinsDummy; | CCoinsView coinsDummy; | ||||
CCoinsViewCache coins(&coinsDummy); | CCoinsViewCache coins(&coinsDummy); | ||||
// Create key | // Create key | ||||
CKey key; | CKey key; | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |