test: add `bad-txns-prevout-null` test case to invalid_txs.py

This reject reason is triggered for non-coinbase transactions with
a coinbase-like outpoint, i.e. hash=0, n=0xffffffff.

Note that the invalid tx templates are currently used in the
functional tests feature_block.py and p2p_invalid_tx.py.
pull/826/head
Sebastian Falbesoner 3 years ago
parent 2711559845
commit aa0a5bb70d

@ -151,6 +151,19 @@ class DuplicateInput(BadTxTemplate):
return tx return tx
class PrevoutNullInput(BadTxTemplate):
reject_reason = 'bad-txns-prevout-null'
expect_disconnect = True
def get_tx(self):
tx = CTransaction()
tx.vin.append(self.valid_txin)
tx.vin.append(CTxIn(COutPoint(hash=0, n=0xffffffff)))
tx.vout.append(CTxOut(1, basic_p2sh))
tx.calc_sha256()
return tx
class NonexistentInput(BadTxTemplate): class NonexistentInput(BadTxTemplate):
reject_reason = None # Added as an orphan tx. reject_reason = None # Added as an orphan tx.
expect_disconnect = False expect_disconnect = False

Loading…
Cancel
Save