Merge 48b8910d12 into merged_master (Bitcoin PR bitcoin/bitcoin#28508)

GetHash now manually implemented for CBlockHeader. SER_GETHASH removed,
so CProof now always serializes `solution`. CBlockHeader::GetHash copies
from Serialize, but only includes `challenge` of CProof, and no signblock witness

This needs to be tested with liquidv1 chain
This commit is contained in:
Byron Hambly 2025-08-04 15:55:53 +02:00
commit e826a411ec
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
28 changed files with 131 additions and 147 deletions

View file

@ -1512,7 +1512,7 @@ BOOST_AUTO_TEST_CASE(script_HasValidOps)
static CMutableTransaction TxFromHex(const std::string& str)
{
CMutableTransaction tx;
SpanReader{SER_DISK, SERIALIZE_TRANSACTION_NO_WITNESS, ParseHex(str)} >> tx;
SpanReader{SERIALIZE_TRANSACTION_NO_WITNESS, ParseHex(str)} >> tx;
return tx;
}
@ -1522,7 +1522,7 @@ static std::vector<CTxOut> TxOutsFromJSON(const UniValue& univalue)
std::vector<CTxOut> prevouts;
for (size_t i = 0; i < univalue.size(); ++i) {
CTxOut txout;
SpanReader{SER_DISK, 0, ParseHex(univalue[i].get_str())} >> txout;
SpanReader{0, ParseHex(univalue[i].get_str())} >> txout;
prevouts.push_back(std::move(txout));
}
return prevouts;
@ -1817,7 +1817,7 @@ BOOST_AUTO_TEST_CASE(bip341_keypath_test_vectors)
for (const auto& vec : vectors.getValues()) {
auto txhex = ParseHex(vec["given"]["rawUnsignedTx"].get_str());
CMutableTransaction tx;
SpanReader{SER_NETWORK, PROTOCOL_VERSION, txhex} >> tx;
SpanReader{PROTOCOL_VERSION, txhex} >> tx;
std::vector<CTxOut> utxos;
for (const auto& utxo_spent : vec["given"]["utxosSpent"].getValues()) {
auto script_bytes = ParseHex(utxo_spent["scriptPubKey"].get_str());