mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-28 23:08:52 +01:00
test: use script_util helpers for creating P2SH scripts
This commit is contained in:
@@ -19,16 +19,17 @@ from test_framework.messages import (
|
||||
tx_from_hex,
|
||||
)
|
||||
from test_framework.script import (
|
||||
hash160,
|
||||
CScript,
|
||||
OP_0,
|
||||
OP_2,
|
||||
OP_3,
|
||||
OP_CHECKMULTISIG,
|
||||
OP_EQUAL,
|
||||
OP_HASH160,
|
||||
OP_RETURN,
|
||||
)
|
||||
from test_framework.script_util import (
|
||||
script_to_p2sh_script,
|
||||
)
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
@@ -291,7 +292,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
|
||||
rawtxs=[tx.serialize().hex()],
|
||||
)
|
||||
tx = tx_from_hex(raw_tx_reference)
|
||||
output_p2sh_burn = CTxOut(nValue=540, scriptPubKey=CScript([OP_HASH160, hash160(b'burn'), OP_EQUAL]))
|
||||
output_p2sh_burn = CTxOut(nValue=540, scriptPubKey=script_to_p2sh_script(b'burn'))
|
||||
num_scripts = 100000 // len(output_p2sh_burn.serialize()) # Use enough outputs to make the tx too large for our policy
|
||||
tx.vout = [output_p2sh_burn] * num_scripts
|
||||
self.check_mempool_result(
|
||||
|
||||
Reference in New Issue
Block a user