v31.1-roots.1 · Commit 7: [PATCH 07/17] feat(rpc): preserve Roots operator interfaces on v31
src/test/mempool_tests.cpp
Before: src/test/mempool_tests.cpp · After: src/test/mempool_tests.cpp
File metadata
index 070e9b1c493e3c17fff363e6955b52b3818132bf..94e2f74ffd2b646df2f87118f0e367147c5383ad 100644
Download original patch · Release notes
Diff rows 1–28 of 28. 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
|
@@ -4,6 +4,7 @@
|
|
| 4 |
|
| 5 |
#include <common/system.h>
|
| 6 |
#include <policy/policy.h>
|
|
|
|
| 7 |
#include <test/util/txmempool.h>
|
| 8 |
#include <txmempool.h>
|
| 9 |
#include <util/time.h>
|
|
@@ -11,6 +12,7 @@
|
|
| 11 |
#include <test/util/setup_common.h>
|
| 12 |
|
| 13 |
#include <boost/test/unit_test.hpp>
|
|
|
|
| 14 |
#include <limits>
|
| 15 |
#include <vector>
|
| 16 |
#include <thread>
|
|
@@ -83,6 +85,14 @@ BOOST_AUTO_TEST_CASE(DynamicDustPublication)
|
|
| 83 |
for (int i = 0; i < 10000; ++i) {
|
| 84 |
const auto fee = pool.GetStandardnessOptions().dust_relay_feerate.GetFeePerK();
|
| 85 |
if (fee != 3000 && fee != 90000) valid = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
}};
|
| 88 |
for (int i = 0; i < 10000; ++i) pool.UpdateDynamicDustFee(i % 2 ? estimate : std::nullopt);
|
|
|
|
| 4 |
|
| 5 |
#include <common/system.h>
|
| 6 |
#include <policy/policy.h>
|
| 7 |
+
#include <rpc/mempool.h>
|
| 8 |
#include <test/util/txmempool.h>
|
| 9 |
#include <txmempool.h>
|
| 10 |
#include <util/time.h>
|
|
|
|
| 12 |
#include <test/util/setup_common.h>
|
| 13 |
|
| 14 |
#include <boost/test/unit_test.hpp>
|
| 15 |
+
#include <univalue.h>
|
| 16 |
#include <limits>
|
| 17 |
#include <vector>
|
| 18 |
#include <thread>
|
|
|
|
| 85 |
for (int i = 0; i < 10000; ++i) {
|
| 86 |
const auto fee = pool.GetStandardnessOptions().dust_relay_feerate.GetFeePerK();
|
| 87 |
if (fee != 3000 && fee != 90000) valid = false;
|
| 88 |
+
if (i < 1000) {
|
| 89 |
+
// Exercise the reporting snapshot while the live rate is published.
|
| 90 |
+
// Each returned JSON value must own its data after the pool lock ends.
|
| 91 |
+
const auto report{MempoolInfoToJSON(pool)};
|
| 92 |
+
const auto reported_fee{report["policy"]["dust_relay_fee"].getValStr()};
|
| 93 |
+
if (reported_fee != "0.00003000" && reported_fee != "0.00090000") valid = false;
|
| 94 |
+
if (report["policy"]["require_standard"].get_bool() != options.require_standard) valid = false;
|
| 95 |
+
}
|
| 96 |
}
|
| 97 |
}};
|
| 98 |
for (int i = 0; i < 10000; ++i) pool.UpdateDynamicDustFee(i % 2 ? estimate : std::nullopt);
|