mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
refactor: Use HashWriter over legacy CHashWriter
This commit is contained in:
@@ -440,8 +440,8 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket_legacy)
|
||||
|
||||
AddrInfo info1 = AddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
uint256 nKey1 = (HashWriter{} << 1).GetHash();
|
||||
uint256 nKey2 = (HashWriter{} << 2).GetHash();
|
||||
|
||||
BOOST_CHECK_EQUAL(info1.GetTriedBucket(nKey1, EMPTY_NETGROUPMAN), 40);
|
||||
|
||||
@@ -490,8 +490,8 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket_legacy)
|
||||
|
||||
AddrInfo info1 = AddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
uint256 nKey1 = (HashWriter{} << 1).GetHash();
|
||||
uint256 nKey2 = (HashWriter{} << 2).GetHash();
|
||||
|
||||
// Test: Make sure the buckets are what we expect
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, EMPTY_NETGROUPMAN), 786);
|
||||
@@ -568,8 +568,8 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket)
|
||||
|
||||
AddrInfo info1 = AddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
uint256 nKey1 = (HashWriter{} << 1).GetHash();
|
||||
uint256 nKey2 = (HashWriter{} << 2).GetHash();
|
||||
|
||||
BOOST_CHECK_EQUAL(info1.GetTriedBucket(nKey1, ngm_asmap), 236);
|
||||
|
||||
@@ -621,8 +621,8 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
|
||||
|
||||
AddrInfo info1 = AddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
uint256 nKey1 = (HashWriter{} << 1).GetHash();
|
||||
uint256 nKey2 = (HashWriter{} << 2).GetHash();
|
||||
|
||||
// Test: Make sure the buckets are what we expect
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, ngm_asmap), 795);
|
||||
|
||||
Reference in New Issue
Block a user