refactor: Convert remaining instances from uint256 to Txid

These remaining miscellaneous changes were identified by commenting out
the `operator const uint256&` conversion and the `Compare(const uint256&)`
method from `transaction_identifier.h`.
This commit is contained in:
marcofleon
2025-07-31 17:05:00 +01:00
parent d2ecd6815d
commit 9c24cda72e
25 changed files with 117 additions and 69 deletions

View File

@@ -19,7 +19,7 @@ uint256 ComputeMerkleRootFromPath(const CBlock& block, uint32_t position, const
throw std::out_of_range("Position out of range");
}
uint256 current_hash = block.vtx[position]->GetHash();
uint256 current_hash = block.vtx[position]->GetHash().ToUint256();
for (const uint256& sibling : merkle_path) {
if (position % 2 == 0) {
@@ -47,7 +47,7 @@ FUZZ_TARGET(merkle)
tx_hashes.reserve(num_txs);
for (size_t i = 0; i < num_txs; ++i) {
tx_hashes.push_back(block->vtx[i]->GetHash());
tx_hashes.push_back(block->vtx[i]->GetHash().ToUint256());
}
// Test ComputeMerkleRoot

View File

@@ -139,7 +139,7 @@ CBlock ConsumeBlock(FuzzedDataProvider& fuzzed_data_provider, const uint256& pre
tx.vout[0].nValue = 0;
tx.vin[0].scriptSig.resize(2);
block.vtx.push_back(MakeTransactionRef(tx));
block.hashMerkleRoot = block.vtx[0]->GetHash();
block.hashMerkleRoot = block.vtx[0]->GetHash().ToUint256();
return block;
}