Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 2: [PATCH 02/17] feat(policy): preserve Roots parsing and local transaction checks

test/functional/mempool_ephemeral_dust.py

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

File metadata
index 61dd4c7102dde419404e6ecff89518fbfe1dd744..a5fef6e71746fcf9c077984b2a1c81cf7c9c8d13 100755

Download original patch · Release notes

Diff rows 1–48 of 48. 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/mempool_ephemeral_dust.py CHANGED
@@ -28,6 +28,8 @@ class EphemeralDustTest(BitcoinTestFramework):
28
  def set_test_params(self):
29
  # Mempools should match via 1P1C p2p relay
30
  self.num_nodes = 2
 
 
31
 
32
  # Don't test trickling logic
33
  self.noban_tx_relay = True
@@ -200,8 +202,8 @@ class EphemeralDustTest(BitcoinTestFramework):
200
  self.log.info("Test that a single output of any satoshi amount is allowed, not checking spending")
201
 
202
  # We aren't checking spending, allow it in with no fee
203
- self.restart_node(0, extra_args=["-minrelaytxfee=0"])
204
- self.restart_node(1, extra_args=["-minrelaytxfee=0"])
205
  self.connect_nodes(0, 1)
206
 
207
  # 330 is dust threshold for taproot outputs
@@ -211,8 +213,8 @@ class EphemeralDustTest(BitcoinTestFramework):
211
  test_res = self.nodes[0].testmempoolaccept([dusty_tx["hex"]])
212
  assert test_res[0]["allowed"]
213
 
214
- self.restart_node(0, extra_args=[])
215
- self.restart_node(1, extra_args=[])
216
  self.connect_nodes(0, 1)
217
  assert_mempool_contents(self, self.nodes[0], expected=[])
218
 
@@ -407,8 +409,8 @@ class EphemeralDustTest(BitcoinTestFramework):
407
  self.log.info("Test that ephemeral dust works in non-TRUC contexts when there's no minrelay requirement")
408
 
409
  # Note: since minrelay is 0, it is not testing 1P1C relay
410
- self.restart_node(0, extra_args=["-minrelaytxfee=0"])
411
- self.restart_node(1, extra_args=["-minrelaytxfee=0"])
412
  self.connect_nodes(0, 1)
413
 
414
  assert_equal(self.nodes[0].getrawmempool(), [])
@@ -472,8 +474,8 @@ class EphemeralDustTest(BitcoinTestFramework):
472
 
473
  # Other topology tests (e.g., grandparents and parents both with dust) require relaxation of submitpackage topology
474
 
475
- self.restart_node(0, extra_args=[])
476
- self.restart_node(1, extra_args=[])
477
  self.connect_nodes(0, 1)
478
 
479
  assert_equal(self.nodes[0].getrawmempool(), [])
 
28
  def set_test_params(self):
29
  # Mempools should match via 1P1C p2p relay
30
  self.num_nodes = 2
31
+ # Exercise native dust packages with the Roots local send exception enabled.
32
+ self.extra_args = [["-permitephemeral=1"]] * self.num_nodes
33
 
34
  # Don't test trickling logic
35
  self.noban_tx_relay = True
 
202
  self.log.info("Test that a single output of any satoshi amount is allowed, not checking spending")
203
 
204
  # We aren't checking spending, allow it in with no fee
205
+ self.restart_node(0, extra_args=self.extra_args[0] + ["-minrelaytxfee=0"])
206
+ self.restart_node(1, extra_args=self.extra_args[0] + ["-minrelaytxfee=0"])
207
  self.connect_nodes(0, 1)
208
 
209
  # 330 is dust threshold for taproot outputs
 
213
  test_res = self.nodes[0].testmempoolaccept([dusty_tx["hex"]])
214
  assert test_res[0]["allowed"]
215
 
216
+ self.restart_node(0, extra_args=self.extra_args[0])
217
+ self.restart_node(1, extra_args=self.extra_args[1])
218
  self.connect_nodes(0, 1)
219
  assert_mempool_contents(self, self.nodes[0], expected=[])
220
 
 
409
  self.log.info("Test that ephemeral dust works in non-TRUC contexts when there's no minrelay requirement")
410
 
411
  # Note: since minrelay is 0, it is not testing 1P1C relay
412
+ self.restart_node(0, extra_args=self.extra_args[0] + ["-minrelaytxfee=0"])
413
+ self.restart_node(1, extra_args=self.extra_args[0] + ["-minrelaytxfee=0"])
414
  self.connect_nodes(0, 1)
415
 
416
  assert_equal(self.nodes[0].getrawmempool(), [])
 
474
 
475
  # Other topology tests (e.g., grandparents and parents both with dust) require relaxation of submitpackage topology
476
 
477
+ self.restart_node(0, extra_args=self.extra_args[0])
478
+ self.restart_node(1, extra_args=self.extra_args[1])
479
  self.connect_nodes(0, 1)
480
 
481
  assert_equal(self.nodes[0].getrawmempool(), [])