Changeset View
Changeset View
Standalone View
Standalone View
test/functional/data/invalid_txs.py
Show All 14 Lines | |||||
Invalid tx cases not covered here can be found by running: | Invalid tx cases not covered here can be found by running: | ||||
$ diff \ | $ diff \ | ||||
<(grep -IREho "bad-txns[a-zA-Z-]+" src | sort -u) \ | <(grep -IREho "bad-txns[a-zA-Z-]+" src | sort -u) \ | ||||
<(grep -IEho "bad-txns[a-zA-Z-]+" test/functional/data/invalid_txs.py | sort -u) | <(grep -IEho "bad-txns[a-zA-Z-]+" test/functional/data/invalid_txs.py | sort -u) | ||||
""" | """ | ||||
import abc | import abc | ||||
from typing import Optional | from typing import Optional | ||||
from test_framework import script as sc | |||||
from test_framework.blocktools import create_tx_with_script | |||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
MAX_MONEY, | |||||
COutPoint, | COutPoint, | ||||
CTransaction, | CTransaction, | ||||
CTxIn, | CTxIn, | ||||
CTxOut, | CTxOut, | ||||
MAX_MONEY, | |||||
) | ) | ||||
from test_framework import script as sc | |||||
from test_framework.blocktools import create_tx_with_script | |||||
from test_framework.txtools import pad_tx | |||||
from test_framework.script import ( | from test_framework.script import ( | ||||
CScript, | |||||
OP_INVERT, | |||||
OP_2MUL, | |||||
OP_2DIV, | OP_2DIV, | ||||
OP_MUL, | OP_2MUL, | ||||
OP_INVERT, | |||||
OP_LSHIFT, | OP_LSHIFT, | ||||
OP_RSHIFT | OP_MUL, | ||||
OP_RSHIFT, | |||||
CScript, | |||||
) | ) | ||||
from test_framework.txtools import pad_tx | |||||
basic_p2sh = sc.CScript( | basic_p2sh = sc.CScript( | ||||
[sc.OP_HASH160, sc.hash160(sc.CScript([sc.OP_0])), sc.OP_EQUAL]) | [sc.OP_HASH160, sc.hash160(sc.CScript([sc.OP_0])), sc.OP_EQUAL]) | ||||
class BadTxTemplate: | class BadTxTemplate: | ||||
"""Allows simple construction of a certain kind of invalid tx. Base class to be subclassed.""" | """Allows simple construction of a certain kind of invalid tx. Base class to be subclassed.""" | ||||
__metaclass__ = abc.ABCMeta | __metaclass__ = abc.ABCMeta | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |