diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2024-03-18 23:28:10 +0100 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2024-08-04 14:24:43 +0200 |
commit | bf0efb4fc72d3c49a2c498c944e55466dfa046dc (patch) | |
tree | 907cf166e48d76d70f603e3519bfbc7c21722897 /src/test | |
parent | 72e5d1be1f4491565249d43e836ee42cfd858866 (diff) |
scripted-diff: Modernize naming of nChainTx and nTxCount
-BEGIN VERIFY SCRIPT-
sed -i 's/nChainTx/m_chain_tx_count/g' $(git grep -l 'nChainTx' ./src)
sed -i 's/nTxCount/tx_count/g' $(git grep -l 'nTxCount' ./src)
-END VERIFY SCRIPT-
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/blockchain_tests.cpp | 4 | ||||
-rw-r--r-- | src/test/fuzz/utxo_snapshot.cpp | 4 | ||||
-rw-r--r-- | src/test/pmt_tests.cpp | 4 | ||||
-rw-r--r-- | src/test/util/chainstate.h | 2 | ||||
-rw-r--r-- | src/test/validation_chainstatemanager_tests.cpp | 4 | ||||
-rw-r--r-- | src/test/validation_tests.cpp | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/src/test/blockchain_tests.cpp b/src/test/blockchain_tests.cpp index b7203e4bd4..4ecc15041c 100644 --- a/src/test/blockchain_tests.cpp +++ b/src/test/blockchain_tests.cpp @@ -113,8 +113,8 @@ BOOST_FIXTURE_TEST_CASE(get_prune_height, TestChain100Setup) BOOST_AUTO_TEST_CASE(num_chain_tx_max) { CBlockIndex block_index{}; - block_index.nChainTx = std::numeric_limits<uint64_t>::max(); - BOOST_CHECK_EQUAL(block_index.nChainTx, std::numeric_limits<uint64_t>::max()); + block_index.m_chain_tx_count = std::numeric_limits<uint64_t>::max(); + BOOST_CHECK_EQUAL(block_index.m_chain_tx_count, std::numeric_limits<uint64_t>::max()); } BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/fuzz/utxo_snapshot.cpp b/src/test/fuzz/utxo_snapshot.cpp index 60d9d39b73..d82f166765 100644 --- a/src/test/fuzz/utxo_snapshot.cpp +++ b/src/test/fuzz/utxo_snapshot.cpp @@ -113,9 +113,9 @@ FUZZ_TARGET(utxo_snapshot, .init = initialize_chain) if (index->nHeight == chainman.GetSnapshotBaseHeight()) { auto params{chainman.GetParams().AssumeutxoForHeight(index->nHeight)}; Assert(params.has_value()); - Assert(params.value().nChainTx == index->nChainTx); + Assert(params.value().m_chain_tx_count == index->m_chain_tx_count); } else { - Assert(index->nChainTx == 0); + Assert(index->m_chain_tx_count == 0); } } Assert(g_chain->size() == coinscache.GetCacheSize()); diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp index edecf70c6f..5b7ccc8e7a 100644 --- a/src/test/pmt_tests.cpp +++ b/src/test/pmt_tests.cpp @@ -29,10 +29,10 @@ BOOST_FIXTURE_TEST_SUITE(pmt_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(pmt_test1) { - static const unsigned int nTxCounts[] = {1, 4, 7, 17, 56, 100, 127, 256, 312, 513, 1000, 4095}; + static const unsigned int tx_counts[] = {1, 4, 7, 17, 56, 100, 127, 256, 312, 513, 1000, 4095}; for (int i = 0; i < 12; i++) { - unsigned int nTx = nTxCounts[i]; + unsigned int nTx = tx_counts[i]; // build a block with some dummy transactions CBlock block; diff --git a/src/test/util/chainstate.h b/src/test/util/chainstate.h index a4636365ca..e604b44c16 100644 --- a/src/test/util/chainstate.h +++ b/src/test/util/chainstate.h @@ -99,7 +99,7 @@ CreateAndActivateUTXOSnapshot( assert(pindex->IsValid(BlockStatus::BLOCK_VALID_TREE)); pindex->nStatus = BlockStatus::BLOCK_VALID_TREE; pindex->nTx = 0; - pindex->nChainTx = 0; + pindex->m_chain_tx_count = 0; pindex->nSequenceId = 0; pindex = pindex->pprev; } diff --git a/src/test/validation_chainstatemanager_tests.cpp b/src/test/validation_chainstatemanager_tests.cpp index f93e3cdfb1..cf819f8751 100644 --- a/src/test/validation_chainstatemanager_tests.cpp +++ b/src/test/validation_chainstatemanager_tests.cpp @@ -285,7 +285,7 @@ struct SnapshotTestSetup : TestChain100Setup { const auto& au_data = ::Params().AssumeutxoForHeight(snapshot_height); const CBlockIndex* tip = WITH_LOCK(chainman.GetMutex(), return chainman.ActiveTip()); - BOOST_CHECK_EQUAL(tip->nChainTx, au_data->nChainTx); + BOOST_CHECK_EQUAL(tip->m_chain_tx_count, au_data->m_chain_tx_count); // To be checked against later when we try loading a subsequent snapshot. uint256 loaded_snapshot_blockhash{*chainman.SnapshotBlockhash()}; @@ -465,7 +465,7 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_loadblockindex, TestChain100Setup) if (i < last_assumed_valid_idx && i >= assumed_valid_start_idx) { index->nStatus = BlockStatus::BLOCK_VALID_TREE; index->nTx = 0; - index->nChainTx = 0; + index->m_chain_tx_count = 0; } ++num_indexes; diff --git a/src/test/validation_tests.cpp b/src/test/validation_tests.cpp index 93a884be6d..546d2f7b4d 100644 --- a/src/test/validation_tests.cpp +++ b/src/test/validation_tests.cpp @@ -143,11 +143,11 @@ BOOST_AUTO_TEST_CASE(test_assumeutxo) const auto out110 = *params->AssumeutxoForHeight(110); BOOST_CHECK_EQUAL(out110.hash_serialized.ToString(), "6657b736d4fe4db0cbc796789e812d5dba7f5c143764b1b6905612f1830609d1"); - BOOST_CHECK_EQUAL(out110.nChainTx, 111U); + BOOST_CHECK_EQUAL(out110.m_chain_tx_count, 111U); const auto out110_2 = *params->AssumeutxoForBlockhash(uint256S("0x696e92821f65549c7ee134edceeeeaaa4105647a3c4fd9f298c0aec0ab50425c")); BOOST_CHECK_EQUAL(out110_2.hash_serialized.ToString(), "6657b736d4fe4db0cbc796789e812d5dba7f5c143764b1b6905612f1830609d1"); - BOOST_CHECK_EQUAL(out110_2.nChainTx, 111U); + BOOST_CHECK_EQUAL(out110_2.m_chain_tx_count, 111U); } BOOST_AUTO_TEST_CASE(block_malleation) |