Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 7: [PATCH 07/17] feat(rpc): preserve Roots operator interfaces on v31

test/functional/feature_policy_args.py

Before: test/functional/feature_policy_args.py · After: test/functional/feature_policy_args.py

File metadata
index a7afa797b1b3e7a350f97008586c39037f9a58f4..8823439a0e994a6265c8500613399edd848ba50d 100755

Download original patch · Release notes

Diff rows 1–36 of 36. 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.

test/functional/feature_policy_args.py CHANGED
@@ -132,14 +132,13 @@ class PolicyArgsTest(BitcoinTestFramework):
132
  check_start(["-bytespersigop=20junk", "-datacarriersize=83junk", "-datacarrier=1junk", "-permitbaremultisig=2", "-mempoolfullrbf=1junk"])
133
  check_start(config="bytespersigop=20junk\ndatacarriersize=83junk\ndatacarrier=1junk\npermitbaremultisig=2\nmempoolfullrbf=1junk\n")
134
 
135
- # Only malformed dynamic modes are startup-tested. Valid non-off grammar
136
- # is unit-tested without constructing a mempool: production scheduler
137
- # wiring is an existing separate runtime gap, not a successful startup.
138
  config_path.write_text(base_config, encoding="utf-8")
139
  node.assert_start_raises_init_error(extra_args=["-dustdynamic=target:2junk"], expected_msg="Invalid mode for dustdynamic: failed to parse target block count", match=ErrorMatch.PARTIAL_REGEX)
140
  rejected_startups += 1
141
 
142
- self.log.info("JSON settings use the same effective grammar; confrw integration belongs L12")
143
  settings_path = node.chain_path / "settings.json"
144
  for value in [True, False]:
145
  settings_path.write_text(json.dumps({"subdustfeepenalty": value}), encoding="utf-8")
@@ -155,6 +154,19 @@ class PolicyArgsTest(BitcoinTestFramework):
155
  check_start(["-subdustfeepenalty=1"])
156
  settings_path.write_text("{}", encoding="utf-8")
157
  config_path.write_text(base_config, encoding="utf-8")
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  self.log.info("Policy startup cases: %d passed starts, %d expected diagnostic rejections", passed_startups, rejected_startups)
159
 
160
 
 
132
  check_start(["-bytespersigop=20junk", "-datacarriersize=83junk", "-datacarrier=1junk", "-permitbaremultisig=2", "-mempoolfullrbf=1junk"])
133
  check_start(config="bytespersigop=20junk\ndatacarriersize=83junk\ndatacarrier=1junk\npermitbaremultisig=2\nmempoolfullrbf=1junk\n")
134
 
135
+ # Valid dynamic-mode runtime behavior is covered by mempool_dynamic_dust.
136
+ # This parser test checks malformed effective input at startup.
 
137
  config_path.write_text(base_config, encoding="utf-8")
138
  node.assert_start_raises_init_error(extra_args=["-dustdynamic=target:2junk"], expected_msg="Invalid mode for dustdynamic: failed to parse target block count", match=ErrorMatch.PARTIAL_REGEX)
139
  rejected_startups += 1
140
 
141
+ self.log.info("JSON settings use the same effective grammar")
142
  settings_path = node.chain_path / "settings.json"
143
  for value in [True, False]:
144
  settings_path.write_text(json.dumps({"subdustfeepenalty": value}), encoding="utf-8")
 
154
  check_start(["-subdustfeepenalty=1"])
155
  settings_path.write_text("{}", encoding="utf-8")
156
  config_path.write_text(base_config, encoding="utf-8")
157
+ self.log.info("Read/write config preserves first-value selection and strict effective parsing")
158
+ rw_path = node.chain_path / "bitcoin_rw.conf"
159
+ rw_path.write_text("subdustfeepenalty=1\nsubdustfeepenalty=junk\n", encoding="utf-8")
160
+ check_start(config="subdustfeepenalty=junk\n")
161
+ rw_path.write_text("subdustfeepenalty=junk\n", encoding="utf-8")
162
+ check_start(["-subdustfeepenalty=1"])
163
+ node.assert_start_raises_init_error(extra_args=[], expected_msg="Invalid -subdustfeepenalty value: 'junk'", match=ErrorMatch.PARTIAL_REGEX)
164
+ rejected_startups += 1
165
+ rw_path.write_text("nosubdustfeepenalty=junk\n", encoding="utf-8")
166
+ node.assert_start_raises_init_error(extra_args=["-subdustfeepenalty=1"], expected_msg="Invalid -nosubdustfeepenalty value: 'junk'", match=ErrorMatch.PARTIAL_REGEX)
167
+ rejected_startups += 1
168
+ rw_path.unlink()
169
+
170
  self.log.info("Policy startup cases: %d passed starts, %d expected diagnostic rejections", passed_startups, rejected_startups)
171
 
172