mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-19 14:45:08 +01:00
test: Use proper MAX_SCRIPT_ELEMENT_SIZE
This commit is contained in:
parent
402ee706d8
commit
cb9d830a00
@ -1116,7 +1116,7 @@ class SegWitTest(BitcoinTestFramework):
|
||||
MAX_PROGRAM_LENGTH = 10000
|
||||
|
||||
# This program is 19 max pushes (9937 bytes), then 64 more opcode-bytes.
|
||||
long_witness_program = CScript([b'a' * 520] * 19 + [OP_DROP] * 63 + [OP_TRUE])
|
||||
long_witness_program = CScript([b'a' * MAX_SCRIPT_ELEMENT_SIZE] * 19 + [OP_DROP] * 63 + [OP_TRUE])
|
||||
assert len(long_witness_program) == MAX_PROGRAM_LENGTH + 1
|
||||
long_witness_hash = sha256(long_witness_program)
|
||||
long_script_pubkey = CScript([OP_0, long_witness_hash])
|
||||
@ -1140,7 +1140,7 @@ class SegWitTest(BitcoinTestFramework):
|
||||
test_witness_block(self.nodes[0], self.test_node, block, accepted=False)
|
||||
|
||||
# Try again with one less byte in the witness program
|
||||
witness_program = CScript([b'a' * 520] * 19 + [OP_DROP] * 62 + [OP_TRUE])
|
||||
witness_program = CScript([b'a' * MAX_SCRIPT_ELEMENT_SIZE] * 19 + [OP_DROP] * 62 + [OP_TRUE])
|
||||
assert len(witness_program) == MAX_PROGRAM_LENGTH
|
||||
witness_hash = sha256(witness_program)
|
||||
script_pubkey = CScript([OP_0, witness_hash])
|
||||
|
Loading…
Reference in New Issue
Block a user