aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2020-12-29 11:19:06 +1000
committerAnthony Towns <aj@erisian.com.au>2021-06-30 08:19:12 +1000
commit0cfd6c6a8f929d5567ac41f95c21548f115efee5 (patch)
treefd396692805022b432022c45da6bb2a18b2fa54b /src/test
parent8ee3e0bed5bf2cd3c7a68ca6ba6c65f7b9a72cca (diff)
downloadbitcoin-0cfd6c6a8f929d5567ac41f95c21548f115efee5.tar.xz
[refactor] versionbits: make VersionBitsCache a full class
Moves the VersionBits* functions to be methods of the cache class, and makes the cache and its lock private to the class.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/versionbits_tests.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp
index 49c61f5f2f..946b35f3b9 100644
--- a/src/test/versionbits_tests.cpp
+++ b/src/test/versionbits_tests.cpp
@@ -288,7 +288,7 @@ static void check_computeblockversion(const Consensus::Params& params, Consensus
// Check min_activation_height is on a retarget boundary
BOOST_REQUIRE_EQUAL(min_activation_height % params.nMinerConfirmationWindow, 0U);
- const uint32_t bitmask{VersionBitsMask(params, dep)};
+ const uint32_t bitmask{g_versionbitscache.Mask(params, dep)};
BOOST_CHECK_EQUAL(bitmask, uint32_t{1} << bit);
// In the first chain, test that the bit is set by CBV until it has failed.
@@ -426,7 +426,7 @@ BOOST_AUTO_TEST_CASE(versionbits_computeblockversion)
// not take precedence over STARTED/LOCKED_IN. So all softforks on
// the same bit might overlap, even when non-overlapping start-end
// times are picked.
- const uint32_t dep_mask{VersionBitsMask(chainParams->GetConsensus(), dep)};
+ const uint32_t dep_mask{g_versionbitscache.Mask(chainParams->GetConsensus(), dep)};
BOOST_CHECK(!(chain_all_vbits & dep_mask));
chain_all_vbits |= dep_mask;
check_computeblockversion(chainParams->GetConsensus(), dep);