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. The two line-number columns refer to before and after.
src/test/policyestimator_tests.cpp
CHANGED
|
@@ -17,6 +17,22 @@
|
|
|
17
17
|
|
|
18
18
|
BOOST_FIXTURE_TEST_SUITE(policyestimator_tests, ChainTestingSetup)
|
|
19
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
|
+
|
|
20
36
|
BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|
21
37
|
{
|
|
22
38
|
CBlockPolicyEstimator feeEst{FeeestPath(*m_node.args), DEFAULT_ACCEPT_STALE_FEE_ESTIMATES};
|
|
@@ -71,7 +87,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|
|
71
87
|
feeV[j],
|
|
72
88
|
virtual_size,
|
|
73
89
|
entry.nHeight,
|
|
74
|
-
/*mempool_limit_bypassed=*/false,
|
|
90
|
+
empty_ignore_rejects,
|
|
75
91
|
/*submitted_in_package=*/false,
|
|
76
92
|
/*chainstate_is_current=*/true,
|
|
77
93
|
/*has_no_mempool_parents=*/true)};
|
|
@@ -171,7 +187,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|
|
171
187
|
feeV[j],
|
|
172
188
|
virtual_size,
|
|
173
189
|
entry.nHeight,
|
|
174
|
-
/*mempool_limit_bypassed=*/false,
|
|
190
|
+
empty_ignore_rejects,
|
|
175
191
|
/*submitted_in_package=*/false,
|
|
176
192
|
/*chainstate_is_current=*/true,
|
|
177
193
|
/*has_no_mempool_parents=*/true)};
|
|
@@ -234,7 +250,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|
|
234
250
|
feeV[j],
|
|
235
251
|
virtual_size,
|
|
236
252
|
entry.nHeight,
|
|
237
|
-
/*mempool_limit_bypassed=*/false,
|
|
253
|
+
empty_ignore_rejects,
|
|
238
254
|
/*submitted_in_package=*/false,
|
|
239
255
|
/*chainstate_is_current=*/true,
|
|
240
256
|
/*has_no_mempool_parents=*/true)};
|