v31.1-roots.1 · Commit 11: [PATCH 11/17] fix(test): bound policy oracles and retain CI diagnostics
src/test/fuzz/tx_pool.cpp
Before: src/test/fuzz/tx_pool.cpp · After: src/test/fuzz/tx_pool.cpp
File metadata
index 5f85fa8e74791715ab165d91742dbb200a07e720..20bb4aa0df2269043047996fd88bc7bd3a959afd 100644
Download original patch · Release notes
Diff rows 1–18 of 18. 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/fuzz/tx_pool.cpp
CHANGED
|
@@ -12,6 +12,7 @@
|
|
| 12 |
#include <test/fuzz/util.h>
|
| 13 |
#include <test/fuzz/util/mempool.h>
|
| 14 |
#include <test/util/mining.h>
|
|
|
|
| 15 |
#include <test/util/script.h>
|
| 16 |
#include <test/util/setup_common.h>
|
| 17 |
#include <test/util/txmempool.h>
|
|
@@ -571,9 +572,9 @@ FUZZ_TARGET(dynamic_dust_fee)
|
|
| 571 |
if (product < 0 && product % size != 0) --per_kvb;
|
| 572 |
per_kvb = std::max(minimum, std::min(maximum, per_kvb));
|
| 573 |
const CFeeRate estimate{fee, size};
|
| 574 |
-
Assert(estimate.GetFeePerK() == static_cast<CAmount>(per_kvb));
|
| 575 |
const Wide scaled{std::max(Wide{0}, per_kvb) * multiplier / 1000};
|
| 576 |
-
Assert(ScaleDustFee(estimate, multiplier).GetFeePerK() == static_cast<CAmount>(std::min(maximum, scaled)));
|
| 577 |
}
|
| 578 |
|
| 579 |
FUZZ_TARGET(carrier_policy_weight)
|
|
|
|
| 12 |
#include <test/fuzz/util.h>
|
| 13 |
#include <test/fuzz/util/mempool.h>
|
| 14 |
#include <test/util/mining.h>
|
| 15 |
+
#include <test/util/roots_policy_oracles.h>
|
| 16 |
#include <test/util/script.h>
|
| 17 |
#include <test/util/setup_common.h>
|
| 18 |
#include <test/util/txmempool.h>
|
|
|
|
| 572 |
if (product < 0 && product % size != 0) --per_kvb;
|
| 573 |
per_kvb = std::max(minimum, std::min(maximum, per_kvb));
|
| 574 |
const CFeeRate estimate{fee, size};
|
| 575 |
+
Assert(estimate.GetFeePerK() == roots_test::BoundedSignedReference(per_kvb));
|
| 576 |
const Wide scaled{std::max(Wide{0}, per_kvb) * multiplier / 1000};
|
| 577 |
+
Assert(ScaleDustFee(estimate, multiplier).GetFeePerK() == roots_test::BoundedSignedReference(scaled));
|
| 578 |
}
|
| 579 |
|
| 580 |
FUZZ_TARGET(carrier_policy_weight)
|