diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-07-05 22:49:52 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-07-05 23:00:41 +0200 |
commit | aa0a5bb70d77739d43d5a9ceae78fb0c6fafd435 (patch) | |
tree | 23451658efbf00f20138133afec337b7cd7fe86b /test/functional/data | |
parent | 271155984574a5bba9619d8f6da9bb0606d93f8c (diff) |
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.
Diffstat (limited to 'test/functional/data')
-rw-r--r-- | test/functional/data/invalid_txs.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py index fab921ef19..95c7370995 100644 --- a/test/functional/data/invalid_txs.py +++ b/test/functional/data/invalid_txs.py @@ -151,6 +151,19 @@ class DuplicateInput(BadTxTemplate): 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): reject_reason = None # Added as an orphan tx. expect_disconnect = False |