diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-08-25 16:57:52 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-08-25 17:09:13 +0200 |
commit | 5555aa2d0ddcc478b95a431a57821199ef2c40ac (patch) | |
tree | bb5b5f22e117c19c79ed1b69e91d6f84691be849 /src/test/addrman_tests.cpp | |
parent | c9273f68f6a17b669890b0b2d38dbcc8b3c39d7b (diff) | |
download | bitcoin-5555aa2d0ddcc478b95a431a57821199ef2c40ac.tar.xz |
refactor: Use HashWriter over legacy CHashWriter
Diffstat (limited to 'src/test/addrman_tests.cpp')
-rw-r--r-- | src/test/addrman_tests.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp index c02322ec7d..329b89554d 100644 --- a/src/test/addrman_tests.cpp +++ b/src/test/addrman_tests.cpp @@ -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); |