mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-02 01:40:12 +02:00
Remove CHashWriter type
The type is only ever set, but never read via GetType(), so remove it. Also, remove SerializeHash to avoid silent merge conflicts and use the already existing GetHash() boilerplate consistently.
This commit is contained in:
@@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(siphash)
|
||||
(uint64_t(x+4)<<32)|(uint64_t(x+5)<<40)|(uint64_t(x+6)<<48)|(uint64_t(x+7)<<56));
|
||||
}
|
||||
|
||||
CHashWriter ss(SER_DISK, CLIENT_VERSION);
|
||||
CHashWriter ss{CLIENT_VERSION};
|
||||
CMutableTransaction tx;
|
||||
// Note these tests were originally written with tx.nVersion=1
|
||||
// and the test would be affected by default tx version bumps if not fixed.
|
||||
|
||||
@@ -176,7 +176,7 @@ BOOST_AUTO_TEST_CASE(vector_bool)
|
||||
std::vector<bool> vec2{1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1};
|
||||
|
||||
BOOST_CHECK(vec1 == std::vector<uint8_t>(vec2.begin(), vec2.end()));
|
||||
BOOST_CHECK(SerializeHash(vec1) == SerializeHash(vec2));
|
||||
BOOST_CHECK((HashWriter{} << vec1).GetHash() == (HashWriter{} << vec2).GetHash());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(noncanonical)
|
||||
|
||||
@@ -78,7 +78,7 @@ uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, un
|
||||
}
|
||||
|
||||
// Serialize and hash
|
||||
CHashWriter ss(SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);
|
||||
CHashWriter ss{SERIALIZE_TRANSACTION_NO_WITNESS};
|
||||
ss << txTmp << nHashType;
|
||||
return ss.GetHash();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user