v30.3-roots.1 · Commit 52: [PATCH 52/68] test: use explicit fee estimator bypass policy
src/test/policyestimator_tests.cpp
Before: src/test/policyestimator_tests.cpp · After: src/test/policyestimator_tests.cpp
File metadata
index bbdd815fe453662df2a0211abff2ff0dba890153..81bb32914dac46738f72aef6e27c78eb3a89882d 100644
Download original patch · Release notes
Diff rows 1–46 of 46. 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/policyestimator_tests.cpp
CHANGED
|
@@ -17,6 +17,22 @@
|
|
| 17 |
|
| 18 |
BOOST_FIXTURE_TEST_SUITE(policyestimator_tests, ChainTestingSetup)
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
| 21 |
{
|
| 22 |
CBlockPolicyEstimator feeEst{FeeestPath(*m_node.args), DEFAULT_ACCEPT_STALE_FEE_ESTIMATES};
|
|
@@ -71,7 +87,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|
| 71 |
feeV[j],
|
| 72 |
virtual_size,
|
| 73 |
entry.nHeight,
|
| 74 |
-
/*mempool_limit_bypassed=*/false,
|
| 75 |
/*submitted_in_package=*/false,
|
| 76 |
/*chainstate_is_current=*/true,
|
| 77 |
/*has_no_mempool_parents=*/true)};
|
|
@@ -171,7 +187,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|
| 171 |
feeV[j],
|
| 172 |
virtual_size,
|
| 173 |
entry.nHeight,
|
| 174 |
-
/*mempool_limit_bypassed=*/false,
|
| 175 |
/*submitted_in_package=*/false,
|
| 176 |
/*chainstate_is_current=*/true,
|
| 177 |
/*has_no_mempool_parents=*/true)};
|
|
@@ -234,7 +250,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|
| 234 |
feeV[j],
|
| 235 |
virtual_size,
|
| 236 |
entry.nHeight,
|
| 237 |
-
/*mempool_limit_bypassed=*/false,
|
| 238 |
/*submitted_in_package=*/false,
|
| 239 |
/*chainstate_is_current=*/true,
|
| 240 |
/*has_no_mempool_parents=*/true)};
|
|
|
|
| 17 |
|
| 18 |
BOOST_FIXTURE_TEST_SUITE(policyestimator_tests, ChainTestingSetup)
|
| 19 |
|
| 20 |
+
BOOST_AUTO_TEST_CASE(BypassedPolicyIsNotEstimated)
|
| 21 |
+
{
|
| 22 |
+
CBlockPolicyEstimator estimator{FeeestPath(*m_node.args), DEFAULT_ACCEPT_STALE_FEE_ESTIMATES};
|
| 23 |
+
CMutableTransaction tx;
|
| 24 |
+
tx.vin.resize(1);
|
| 25 |
+
tx.vout.emplace_back(COIN, CScript{});
|
| 26 |
+
for (const auto& ignored : {empty_ignore_rejects, ignore_rejects_type{"mempool full"}}) {
|
| 27 |
+
const auto txref{MakeTransactionRef(tx)};
|
| 28 |
+
const NewMempoolTransactionInfo info{txref, 1000, GetVirtualTransactionSize(*txref), 0,
|
| 29 |
+
ignored, false, true, true};
|
| 30 |
+
estimator.processTransaction(info);
|
| 31 |
+
BOOST_CHECK_EQUAL(estimator.removeTx(txref->GetHash()), ignored.empty());
|
| 32 |
+
++tx.vin[0].prevout.n;
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
| 37 |
{
|
| 38 |
CBlockPolicyEstimator feeEst{FeeestPath(*m_node.args), DEFAULT_ACCEPT_STALE_FEE_ESTIMATES};
|
|
|
|
| 87 |
feeV[j],
|
| 88 |
virtual_size,
|
| 89 |
entry.nHeight,
|
| 90 |
+
empty_ignore_rejects,
|
| 91 |
/*submitted_in_package=*/false,
|
| 92 |
/*chainstate_is_current=*/true,
|
| 93 |
/*has_no_mempool_parents=*/true)};
|
|
|
|
| 187 |
feeV[j],
|
| 188 |
virtual_size,
|
| 189 |
entry.nHeight,
|
| 190 |
+
empty_ignore_rejects,
|
| 191 |
/*submitted_in_package=*/false,
|
| 192 |
/*chainstate_is_current=*/true,
|
| 193 |
/*has_no_mempool_parents=*/true)};
|
|
|
|
| 250 |
feeV[j],
|
| 251 |
virtual_size,
|
| 252 |
entry.nHeight,
|
| 253 |
+
empty_ignore_rejects,
|
| 254 |
/*submitted_in_package=*/false,
|
| 255 |
/*chainstate_is_current=*/true,
|
| 256 |
/*has_no_mempool_parents=*/true)};
|