Skip to content

Commit cb9d830

Browse files
committed
test: Use proper MAX_SCRIPT_ELEMENT_SIZE
1 parent 402ee70 commit cb9d830

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/p2p_segwit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ def test_max_witness_program_length(self):
11161116
MAX_PROGRAM_LENGTH = 10000
11171117

11181118
# This program is 19 max pushes (9937 bytes), then 64 more opcode-bytes.
1119-
long_witness_program = CScript([b'a' * 520] * 19 + [OP_DROP] * 63 + [OP_TRUE])
1119+
long_witness_program = CScript([b'a' * MAX_SCRIPT_ELEMENT_SIZE] * 19 + [OP_DROP] * 63 + [OP_TRUE])
11201120
assert len(long_witness_program) == MAX_PROGRAM_LENGTH + 1
11211121
long_witness_hash = sha256(long_witness_program)
11221122
long_script_pubkey = CScript([OP_0, long_witness_hash])
@@ -1140,7 +1140,7 @@ def test_max_witness_program_length(self):
11401140
test_witness_block(self.nodes[0], self.test_node, block, accepted=False)
11411141

11421142
# Try again with one less byte in the witness program
1143-
witness_program = CScript([b'a' * 520] * 19 + [OP_DROP] * 62 + [OP_TRUE])
1143+
witness_program = CScript([b'a' * MAX_SCRIPT_ELEMENT_SIZE] * 19 + [OP_DROP] * 62 + [OP_TRUE])
11441144
assert len(witness_program) == MAX_PROGRAM_LENGTH
11451145
witness_hash = sha256(witness_program)
11461146
script_pubkey = CScript([OP_0, witness_hash])

0 commit comments

Comments
 (0)