Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 3: [PATCH 03/17] feat(policy): preserve cluster accounting and repair dynamic dust

src/test/policy_args_tests.cpp

Before: src/test/policy_args_tests.cpp · After: src/test/policy_args_tests.cpp

File metadata
index ee01e859e56684e025eafb8e4ddc2fa2e8f272f6..c1aecb486e2bae62461a9834d03608794f23be88 100644

Download original patch · Release notes

Diff rows 1–22 of 22. 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/policy_args_tests.cpp CHANGED
@@ -17,6 +17,7 @@
17
 
18
  #include <cstdint>
19
  #include <string>
 
20
  #include <utility>
21
  #include <vector>
22
 
@@ -208,6 +209,15 @@ BOOST_AUTO_TEST_CASE(dynamic_dust_grammar_without_runtime_claim)
208
  const auto position = ParseDustDynamicOpt("1.0000*mempool:01", 1008);
209
  BOOST_REQUIRE(position);
210
  BOOST_CHECK_EQUAL(position->first, 1);
 
 
 
 
 
 
 
 
 
211
  for (const std::string value : {"", "target:1", "target:2junk", "mempool:+1", "mempool:0", "mempool:2147483648", "0*mempool:1", "1.0001*mempool:1", "junk"}) {
212
  ArgsManager args;
213
  args.ForceSetArg("-dustdynamic", value);
 
17
 
18
  #include <cstdint>
19
  #include <string>
20
+ #include <tuple>
21
  #include <utility>
22
  #include <vector>
23
 
 
209
  const auto position = ParseDustDynamicOpt("1.0000*mempool:01", 1008);
210
  BOOST_REQUIRE(position);
211
  BOOST_CHECK_EQUAL(position->first, 1);
212
+ for (const auto& [value, expected_target, expected_multiplier] : std::vector<std::tuple<std::string, int32_t, int>>{
213
+ {"off", 0, 3000}, {"0", 0, 3000}, {"1e0*target:2", -2, 1000}, {"2147483.647*mempool:2147483647", INT32_MAX, INT32_MAX}}) {
214
+ ArgsManager args;
215
+ args.ForceSetArg("-dustdynamic", value);
216
+ kernel::MemPoolOptions options;
217
+ BOOST_REQUIRE(ApplyArgsManOptions(args, Params(), options));
218
+ BOOST_CHECK_EQUAL(options.dust_relay_target, expected_target);
219
+ BOOST_CHECK_EQUAL(options.dust_relay_multiplier, expected_multiplier);
220
+ }
221
  for (const std::string value : {"", "target:1", "target:2junk", "mempool:+1", "mempool:0", "mempool:2147483648", "0*mempool:1", "1.0001*mempool:1", "junk"}) {
222
  ArgsManager args;
223
  args.ForceSetArg("-dustdynamic", value);