mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-25 21:39:05 +01:00
test: use script_util helpers for creating P2SH scripts
This commit is contained in:
@@ -37,17 +37,17 @@ from test_framework.script import (
|
||||
OP_CHECKSIGVERIFY,
|
||||
OP_ELSE,
|
||||
OP_ENDIF,
|
||||
OP_EQUAL,
|
||||
OP_DROP,
|
||||
OP_FALSE,
|
||||
OP_HASH160,
|
||||
OP_IF,
|
||||
OP_INVALIDOPCODE,
|
||||
OP_RETURN,
|
||||
OP_TRUE,
|
||||
SIGHASH_ALL,
|
||||
LegacySignatureHash,
|
||||
hash160,
|
||||
)
|
||||
from test_framework.script_util import (
|
||||
script_to_p2sh_script,
|
||||
)
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal
|
||||
@@ -469,8 +469,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||
|
||||
# Build the redeem script, hash it, use hash to create the p2sh script
|
||||
redeem_script = CScript([self.coinbase_pubkey] + [OP_2DUP, OP_CHECKSIGVERIFY] * 5 + [OP_CHECKSIG])
|
||||
redeem_script_hash = hash160(redeem_script)
|
||||
p2sh_script = CScript([OP_HASH160, redeem_script_hash, OP_EQUAL])
|
||||
p2sh_script = script_to_p2sh_script(redeem_script)
|
||||
|
||||
# Create a transaction that spends one satoshi to the p2sh_script, the rest to OP_TRUE
|
||||
# This must be signed because it is spending a coinbase
|
||||
|
||||
Reference in New Issue
Block a user