diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 46d2bb4642fa4..5b9acdbc0418a 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -95,7 +95,7 @@ static void AssembleBlock(benchmark::State& state) tx.vin.push_back(MineBlock(SCRIPT_PUB)); tx.witness.vtxinwit.resize(1); tx.witness.vtxinwit.back().scriptWitness = witness; - tx.vout.emplace_back(1337, SCRIPT_PUB); + tx.vout.emplace_back(CTxOut(CAsset(), 1337, SCRIPT_PUB)); if (NUM_BLOCKS - b >= COINBASE_MATURITY) txs.at(b) = MakeTransactionRef(tx); } diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp index 79689f6e0bb7f..5daaead5498e4 100644 --- a/src/bench/checkqueue.cpp +++ b/src/bench/checkqueue.cpp @@ -45,11 +45,12 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::State& state) // Make insecure_rand here so that each iteration is identical. FastRandomContext insecure_rand(true); CCheckQueueControl control(&queue); - std::vector> vBatches(BATCHES); + std::vector> vBatches(BATCHES); for (auto& vChecks : vBatches) { vChecks.reserve(BATCH_SIZE); - for (size_t x = 0; x < BATCH_SIZE; ++x) - vChecks.emplace_back(insecure_rand); + for (size_t x = 0; x < BATCH_SIZE; ++x) { + vChecks.emplace_back(new PrevectorJob(insecure_rand)); + } control.Add(vChecks); } // control waits for completion by RAII, but diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp index 0a6f5d85eaeec..884705a9aae5b 100644 --- a/src/bench/coin_selection.cpp +++ b/src/bench/coin_selection.cpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include @@ -47,12 +49,23 @@ static void CoinSelection(benchmark::State& state) const CoinSelectionParams coin_selection_params(true, 34, 148, CFeeRate(0), 0); while (state.KeepRunning()) { std::set setCoinsRet; - CAmount nValueRet; + CAmountMap mapValueRet; bool bnb_used; - bool success = wallet.SelectCoinsMinConf(1003 * COIN, filter_standard, groups, setCoinsRet, nValueRet, coin_selection_params, bnb_used); + CAmountMap mapValue; + mapValue[::policyAsset] = 1003 * COIN; + bool success = wallet.SelectCoinsMinConf(mapValue, filter_standard, groups, setCoinsRet, mapValueRet, coin_selection_params, bnb_used); assert(success); - assert(nValueRet == 1003 * COIN); + assert(mapValueRet[::policyAsset] == 1003 * COIN); assert(setCoinsRet.size() == 2); + +/* std::set > setCoinsRet; + CAmountMap nValueRet; + CAmountMap mapValue; + mapValue[CAsset()] = 1003 * COIN; + bool success = wallet.SelectCoinsMinConf(mapValue, 1, 6, 0, vCoins, setCoinsRet, nValueRet); + assert(success); + assert(nValueRet[CAsset()] == 1003 * COIN); + assert(setCoinsRet.size() == 2);*/ } } diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp index 07810507fab56..cf8ef6b0d5adf 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -97,10 +97,12 @@ static void VerifyScriptBench(benchmark::State& state) #if defined(HAVE_CONSENSUS_LIB) CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); stream << txSpend; + CDataStream streamVal(SER_NETWORK, PROTOCOL_VERSION); + streamVal << txCredit.vout[0].nValue; int csuccess = bitcoinconsensus_verify_script_with_amount( txCredit.vout[0].scriptPubKey.data(), txCredit.vout[0].scriptPubKey.size(), - txCredit.vout[0].nValue, + (const unsigned char*)&streamVal[0], streamVal.size(), (const unsigned char*)stream.data(), stream.size(), 0, flags, nullptr); assert(csuccess == 1); #endif