Changeset View
Changeset View
Standalone View
Standalone View
src/test/sigopcount_tests.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | void BuildTxs(CMutableTransaction &spendingTx, CCoinsViewCache &coins, | ||||
creationTx.vin[0].prevout.SetNull(); | creationTx.vin[0].prevout.SetNull(); | ||||
creationTx.vin[0].scriptSig = CScript(); | creationTx.vin[0].scriptSig = CScript(); | ||||
creationTx.vout.resize(1); | creationTx.vout.resize(1); | ||||
creationTx.vout[0].nValue = 1; | creationTx.vout[0].nValue = 1; | ||||
creationTx.vout[0].scriptPubKey = scriptPubKey; | creationTx.vout[0].scriptPubKey = scriptPubKey; | ||||
spendingTx.nVersion = 1; | spendingTx.nVersion = 1; | ||||
spendingTx.vin.resize(1); | spendingTx.vin.resize(1); | ||||
spendingTx.vin[0].prevout.hash = creationTx.GetId(); | spendingTx.vin[0].prevout.unspentid = creationTx.GetUnspentid(); | ||||
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(); | ||||
AddCoins(coins, creationTx, 0); | AddCoins(coins, creationTx, 0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | BOOST_CHECK_EQUAL( | ||||
GetMaxBlockSigOpsCount(std::numeric_limits<uint32_t>::max()), | GetMaxBlockSigOpsCount(std::numeric_limits<uint32_t>::max()), | ||||
4295 * MAX_BLOCK_SIGOPS_PER_MB); | 4295 * MAX_BLOCK_SIGOPS_PER_MB); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(test_max_sigops_per_tx) { | BOOST_AUTO_TEST_CASE(test_max_sigops_per_tx) { | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
tx.nVersion = 1; | tx.nVersion = 1; | ||||
tx.vin.resize(1); | tx.vin.resize(1); | ||||
tx.vin[0].prevout.hash = GetRandHash(); | tx.vin[0].prevout.unspentid = unspentid_t(GetRandHash()); | ||||
tx.vin[0].prevout.n = 0; | tx.vin[0].prevout.n = 0; | ||||
tx.vin[0].scriptSig = CScript(); | tx.vin[0].scriptSig = CScript(); | ||||
tx.vout.resize(1); | tx.vout.resize(1); | ||||
tx.vout[0].nValue = 1; | tx.vout[0].nValue = 1; | ||||
tx.vout[0].scriptPubKey = CScript(); | tx.vout[0].scriptPubKey = CScript(); | ||||
{ | { | ||||
CValidationState state; | CValidationState state; | ||||
Show All 24 Lines |