v30.3-roots.1 · Commit 10: [PATCH 10/68] fix: harden Roots priority and wallet policy boundaries
src/test/mempool_tests.cpp
Before: src/test/mempool_tests.cpp · After: src/test/mempool_tests.cpp
File metadata
index 099cc8ea6a9560cab430fac079384aff96ee47ea..1d9ef4949e40927c5d126cd8b3e3a01299a31c9d 100644
Download original patch · Release notes
Diff rows 1–21 of 21. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/test/mempool_tests.cpp
CHANGED
|
@@ -47,6 +47,21 @@ public:
|
|
| 47 |
using CTxMemPool::GetMinFee;
|
| 48 |
};
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
|
| 51 |
{
|
| 52 |
// Test CTxMemPool::remove functionality
|
|
|
|
| 47 |
using CTxMemPool::GetMinFee;
|
| 48 |
};
|
| 49 |
|
| 50 |
+
BOOST_AUTO_TEST_CASE(MempoolEntryMaxHeightTest)
|
| 51 |
+
{
|
| 52 |
+
CMutableTransaction mtx;
|
| 53 |
+
mtx.vin.resize(1);
|
| 54 |
+
mtx.vout.emplace_back(1, CScript{});
|
| 55 |
+
const auto tx{MakeTransactionRef(mtx)};
|
| 56 |
+
const auto max_height{std::numeric_limits<unsigned int>::max()};
|
| 57 |
+
const CoinAgeCache coin_age_cache{.inputs_coin_age = 100.0, .in_chain_input_value = 1};
|
| 58 |
+
const CTxMemPoolEntry entry{tx, /*fee=*/0, /*time=*/0, max_height, /*entry_sequence=*/0,
|
| 59 |
+
coin_age_cache, /*spends_coinbase=*/false, /*extra_weight=*/0,
|
| 60 |
+
/*sigops_cost=*/0, {}};
|
| 61 |
+
|
| 62 |
+
BOOST_CHECK_EQUAL(entry.GetPriority(max_height), entry.GetStartingPriority());
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
|
| 66 |
{
|
| 67 |
// Test CTxMemPool::remove functionality
|