aboutsummaryrefslogtreecommitdiff
path: root/test/functional/data/invalid_txs.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-06-27 23:52:38 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-07-05 20:40:47 +0200
commit285a65ccfde2e811cfe01e916b998c02ee534a97 (patch)
tree969a94f117d2a7ef637d2a06b4ef97c940d9b544 /test/functional/data/invalid_txs.py
parentb57b633b942da162045b1fe7743a8abdfeaf60e2 (diff)
downloadbitcoin-285a65ccfde2e811cfe01e916b998c02ee534a97.tar.xz
test: use script_util helpers for creating P2SH scripts
Diffstat (limited to 'test/functional/data/invalid_txs.py')
-rw-r--r--test/functional/data/invalid_txs.py35
1 files changed, 20 insertions, 15 deletions
diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py
index fab921ef19..c5dc96f9fb 100644
--- a/test/functional/data/invalid_txs.py
+++ b/test/functional/data/invalid_txs.py
@@ -29,27 +29,32 @@ from test_framework.messages import (
CTxOut,
MAX_MONEY,
)
-from test_framework import script as sc
from test_framework.blocktools import create_tx_with_script, MAX_BLOCK_SIGOPS
from test_framework.script import (
CScript,
+ OP_0,
+ OP_2DIV,
+ OP_2MUL,
+ OP_AND,
OP_CAT,
- OP_SUBSTR,
- OP_LEFT,
- OP_RIGHT,
+ OP_CHECKSIG,
+ OP_DIV,
OP_INVERT,
- OP_AND,
+ OP_LEFT,
+ OP_LSHIFT,
+ OP_MOD,
+ OP_MUL,
OP_OR,
+ OP_RIGHT,
+ OP_RSHIFT,
+ OP_SUBSTR,
+ OP_TRUE,
OP_XOR,
- OP_2MUL,
- OP_2DIV,
- OP_MUL,
- OP_DIV,
- OP_MOD,
- OP_LSHIFT,
- OP_RSHIFT
)
-basic_p2sh = sc.CScript([sc.OP_HASH160, sc.hash160(sc.CScript([sc.OP_0])), sc.OP_EQUAL])
+from test_framework.script_util import (
+ script_to_p2sh_script,
+)
+basic_p2sh = script_to_p2sh_script(CScript([OP_0]))
class BadTxTemplate:
@@ -116,7 +121,7 @@ class SizeTooSmall(BadTxTemplate):
def get_tx(self):
tx = CTransaction()
tx.vin.append(self.valid_txin)
- tx.vout.append(CTxOut(0, sc.CScript([sc.OP_TRUE])))
+ tx.vout.append(CTxOut(0, CScript([OP_TRUE])))
tx.calc_sha256()
return tx
@@ -217,7 +222,7 @@ class TooManySigops(BadTxTemplate):
expect_disconnect = False
def get_tx(self):
- lotsa_checksigs = sc.CScript([sc.OP_CHECKSIG] * (MAX_BLOCK_SIGOPS))
+ lotsa_checksigs = CScript([OP_CHECKSIG] * (MAX_BLOCK_SIGOPS))
return create_tx_with_script(
self.spend_tx, 0,
script_pub_key=lotsa_checksigs,