Oh I see. This is due to passing the input even though it is not needed. What do you think about passing None
in this case?
0diff --git a/test/functional/feature_nulldummy.py b/test/functional/feature_nulldummy.py
1index e860a7fc36..90e0887b08 100755
2--- a/test/functional/feature_nulldummy.py
3+++ b/test/functional/feature_nulldummy.py
4@@ -60,19 +60,13 @@ class NULLDUMMYTest(BitcoinTestFramework):
5 '-par=1', # Use only one script thread to get the exact reject reason for testing
6 ]]
7
8- def create_transaction(self, *, txid, inAmount=None, spk=None, rs=None, ws=None, addr, amount, privkey):
9+ def create_transaction(self, *, txid, prev_utxo_details=None, addr, amount, privkey):
10 input = {"txid": txid, "vout": 0}
11- if inAmount is not None:
12- input["amount"] = inAmount
13- if spk is not None:
14- input["scriptPubKey"] = spk
15- if rs is not None:
16- input["redeemScript"] = rs
17- if ws is not None:
18- input["witnessScript"] = ws
19 output = {addr: amount}
20 rawtx = self.nodes[0].createrawtransaction([input], output)
21- signedtx = self.nodes[0].signrawtransactionwithkey(rawtx, [privkey], [input])
22+ # Details only needed for scripthash or witness spends
23+ input = None if not prev_utxo_details else [{**input,**prev_utxo_details}]
24+ signedtx = self.nodes[0].signrawtransactionwithkey(rawtx, [privkey], input)
25 return tx_from_hex(signedtx["hex"])
26
27 def run_test(self):
28@@ -101,24 +95,22 @@ class NULLDUMMYTest(BitcoinTestFramework):
29
30 self.log.info(f"Test 1: NULLDUMMY compliant base transactions should be accepted to mempool and mined before activation [{COINBASE_MATURITY + 3}]")
31 test1txs = [self.create_transaction(txid=coinbase_txid[0], addr=self.ms_address, amount=49,
32- spk=self.nodes[0].getrawtransaction(coinbase_txid[0], True, block_hash[0])["vout"][0]["scriptPubKey"]["hex"],
33 privkey=self.nodes[0].PRIV_KEYS[0][1])]
34 txid1 = self.nodes[0].sendrawtransaction(test1txs[0].serialize_with_witness().hex(), 0)
35 spk = test1txs[0].vout[0].scriptPubKey.hex()
36- test1txs.append(self.create_transaction(txid=txid1, spk=spk,
37- rs=cms["redeemScript"],
38+ test1txs.append(self.create_transaction(txid=txid1, prev_utxo_details={"scriptPubKey":spk,
39+ "redeemScript":cms["redeemScript"]},
40 addr=self.ms_address, amount=48,
41 privkey=self.privkey))
42 txid2 = self.nodes[0].sendrawtransaction(test1txs[1].serialize_with_witness().hex(), 0)
43 test1txs.append(self.create_transaction(txid=coinbase_txid[1],
44- spk=self.nodes[0].getrawtransaction(coinbase_txid[1], True, block_hash[1])["vout"][0]["scriptPubKey"]["hex"],
45 addr=self.wit_ms_address, amount=49,
46 privkey=self.nodes[0].PRIV_KEYS[0][1]))
47 txid3 = self.nodes[0].sendrawtransaction(test1txs[2].serialize_with_witness().hex(), 0)
48 self.block_submit(self.nodes[0], test1txs, accept=True)
49
50 self.log.info("Test 2: Non-NULLDUMMY base multisig transaction should not be accepted to mempool before activation")
51- test2tx = self.create_transaction(txid=txid2, spk=spk, rs=cms["redeemScript"],
52+ test2tx = self.create_transaction(txid=txid2, prev_utxo_details={"scriptPubKey":spk, "redeemScript":cms["redeemScript"]},
53 addr=self.ms_address, amount=47,
54 privkey=self.privkey)
55 invalidate_nulldummy_tx(test2tx)
56@@ -128,7 +120,7 @@ class NULLDUMMYTest(BitcoinTestFramework):
57 self.block_submit(self.nodes[0], [test2tx], accept=True)
58
59 self.log.info("Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation")
60- test4tx = self.create_transaction(txid=test2tx.hash, spk=spk, rs=cms["redeemScript"],
61+ test4tx = self.create_transaction(txid=test2tx.hash, prev_utxo_details={"scriptPubKey":spk, "redeemScript":cms["redeemScript"]},
62 addr=self.address, amount=46,
63 privkey=self.privkey)
64 test6txs = [CTransaction(test4tx)]
65@@ -137,8 +129,8 @@ class NULLDUMMYTest(BitcoinTestFramework):
66 self.block_submit(self.nodes[0], [test4tx], accept=False)
67
68 self.log.info("Test 5: Non-NULLDUMMY P2WSH multisig transaction invalid after activation")
69- test5tx = self.create_transaction(txid=txid3, spk=test1txs[2].vout[0].scriptPubKey.hex(),
70- inAmount=49, ws=wms["redeemScript"],
71+ test5tx = self.create_transaction(txid=txid3, prev_utxo_details={"scriptPubKey":test1txs[2].vout[0].scriptPubKey.hex(),
72+ "amount":49, "witnessScript":wms["redeemScript"]},
73 addr=self.wit_address, amount=48,
74 privkey=self.privkey)
75 test6txs.append(CTransaction(test5tx))