v29.4-roots.4 · Commit 3: [PATCH 03/37] policy: restore conservative relay and network controls
test/functional/mempool_datacarrier.py
Before: test/functional/mempool_datacarrier.py · After: test/functional/mempool_datacarrier.py
File metadata
index 48e636caa22211534ae48f8222d4ccc28749a209..c35b7acf5c32ebb29ae20de63a14bc50936f74b1 100755
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.
test/functional/mempool_datacarrier.py
CHANGED
|
@@ -42,6 +42,7 @@ class DataCarrierTest(BitcoinTestFramework):
|
|
| 42 |
assert tx.rehash() in node.getrawmempool(True), f'{tx_hex} not in mempool'
|
| 43 |
else:
|
| 44 |
assert_raises_rpc_error(-26, "scriptpubkey", self.wallet.sendrawtransaction, from_node=node, tx_hex=tx_hex)
|
|
|
|
| 45 |
|
| 46 |
def run_test(self):
|
| 47 |
self.wallet = MiniWallet(self.nodes[0])
|
|
@@ -57,7 +58,10 @@ class DataCarrierTest(BitcoinTestFramework):
|
|
| 57 |
self.test_null_data_transaction(node=self.nodes[0], data=default_size_data, success=True)
|
| 58 |
|
| 59 |
self.log.info("Testing a null data transaction larger than allowed by the default -datacarriersize value.")
|
| 60 |
-
self.test_null_data_transaction(node=self.nodes[0], data=too_long_data, success=False)
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
self.log.info("Testing a null data transaction with -datacarrier=false.")
|
| 63 |
self.test_null_data_transaction(node=self.nodes[1], data=default_size_data, success=False)
|
|
|
|
| 42 |
assert tx.rehash() in node.getrawmempool(True), f'{tx_hex} not in mempool'
|
| 43 |
else:
|
| 44 |
assert_raises_rpc_error(-26, "scriptpubkey", self.wallet.sendrawtransaction, from_node=node, tx_hex=tx_hex)
|
| 45 |
+
return tx_hex
|
| 46 |
|
| 47 |
def run_test(self):
|
| 48 |
self.wallet = MiniWallet(self.nodes[0])
|
|
|
|
| 58 |
self.test_null_data_transaction(node=self.nodes[0], data=default_size_data, success=True)
|
| 59 |
|
| 60 |
self.log.info("Testing a null data transaction larger than allowed by the default -datacarriersize value.")
|
| 61 |
+
rejected_tx = self.test_null_data_transaction(node=self.nodes[0], data=too_long_data, success=False)
|
| 62 |
+
# Datacarrier limits are local relay policy. The same consensus-valid
|
| 63 |
+
# transaction must remain valid when supplied directly in a block.
|
| 64 |
+
self.generateblock(self.nodes[0], output="raw(42)", transactions=[rejected_tx], sync_fun=self.no_op)
|
| 65 |
|
| 66 |
self.log.info("Testing a null data transaction with -datacarrier=false.")
|
| 67 |
self.test_null_data_transaction(node=self.nodes[1], data=default_size_data, success=False)
|