From 832af6a09843a50f7ac3eda24b7e2860502d955d Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Mon, 3 Nov 2025 09:54:58 +0200 Subject: [PATCH] fixme: src/script/bitcoinconsensus.cpp this is working with a default asset in script_tests.cpp, but if we need this consensus lib for elements then it must be fixed to use multi assets correctly --- src/script/bitcoinconsensus.cpp | 2 +- src/test/script_tests.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp index b7f3c7af9d..de7851f789 100644 --- a/src/script/bitcoinconsensus.cpp +++ b/src/script/bitcoinconsensus.cpp @@ -97,7 +97,7 @@ static int verify_script(const unsigned char *hash_genesis_block, for (size_t i = 0; i < spentOutputsLen; i++) { CScript spk = CScript(spentOutputs[i].scriptPubKey, spentOutputs[i].scriptPubKey + spentOutputs[i].scriptPubKeySize); const CAmount& value = spentOutputs[i].value; - CTxOut tx_out = CTxOut(CAsset(), value, spk); // ELEMENTS FIXME + CTxOut tx_out = CTxOut(CAsset(), value, spk); // ELEMENTS: if we need the consensus lib working then it must work with multi assets spent_outputs.push_back(tx_out); } } diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index d6b8481477..cf6d7ad6a6 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1789,7 +1789,7 @@ static void AssetTest(const UniValue& test) #if defined(HAVE_CONSENSUS_LIB) CConfidentialValue value(prevouts[idx].nValue); int lib_ret = bitcoinconsensus_verify_script_with_spent_outputs(nullptr, prevouts[idx].scriptPubKey.data(), prevouts[idx].scriptPubKey.size(), value.vchCommitment.data(), value.vchCommitment.size(), UCharCast(stream.data()), stream.size(), utxos.data(), utxos.size(), idx, flags, nullptr); - // BOOST_CHECK(lib_ret == 1); // ELEMENTS FIXME + BOOST_CHECK(lib_ret == 1); #endif } } @@ -1874,7 +1874,7 @@ BOOST_AUTO_TEST_CASE(script_assets_test) file.close(); } -// ELEMENTS: TODO: Some of these test vectors need updating +// ELEMENTS FIXME: Some of these test vectors need updating BOOST_AUTO_TEST_CASE(bip341_keypath_test_vectors) { UniValue tests; @@ -1897,7 +1897,7 @@ BOOST_AUTO_TEST_CASE(bip341_keypath_test_vectors) PrecomputedTransactionData txdata; txdata.Init(tx, std::vector{utxos}, true); // ELEMENTS: add a txout witness for each output - for (u_int i = 0; i < (u_int)utxos.size(); i++) { + for (size_t i = 0; i < utxos.size(); ++i) { tx.witness.vtxoutwit.emplace_back(); }