Skip to content

Commit

Permalink
test: add bad-txns-prevout-null test to mempool_accept.py
Browse files Browse the repository at this point in the history
  • Loading branch information
theStack committed Jul 5, 2021
1 parent aa0a5bb commit 1f44958
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/functional/mempool_accept.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BIP125_SEQUENCE_NUMBER,
COIN,
COutPoint,
CTxIn,
CTxOut,
MAX_BLOCK_BASE_SIZE,
MAX_MONEY,
Expand Down Expand Up @@ -247,6 +248,14 @@ def run_test(self):
rawtxs=[tx.serialize().hex()],
)

self.log.info('A non-coinbase transaction with coinbase-like outpoint')
tx = tx_from_hex(raw_tx_reference)
tx.vin.append(CTxIn(COutPoint(hash=0, n=0xffffffff)))
self.check_mempool_result(
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-prevout-null'}],
rawtxs=[tx.serialize().hex()],
)

self.log.info('A coinbase transaction')
# Pick the input of the first tx we signed, so it has to be a coinbase tx
raw_tx_coinbase_spent = node.getrawtransaction(txid=node.decoderawtransaction(hexstring=raw_tx_in_block)['vin'][0]['txid'])
Expand Down

0 comments on commit 1f44958

Please sign in to comment.