Merge #13638: tests: Use MAX_SCRIPT_ELEMENT_SIZE from script.py

b9f4b211df tests: Use MAX_SCRIPT_ELEMENT_SIZE from script.py (Daniel Kraft)

Pull request description:

  `p2p_segwit.py` and `test_framework/script.py` both define a constant for `MAX_SCRIPT_ELEMENT_SIZE` (=520 bytes), which is redundant.  This change uses the constant defined in the `script.py` module for `p2p_segwit.py`.

Tree-SHA512: 2bc295ff26d9b052d4e05b85c27e748175884d6689a92c19337fc4db8bf439e3abe3edc91af1aaf46d8dc42ed96a85ad17110546d2274a0d9cda3abd6b878a31
This commit is contained in:
Wladimir J. van der Laan 2018-07-17 17:30:35 +02:00
commit 6fcdb5ebdd
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D
1 changed files with 1 additions and 2 deletions

View File

@ -47,6 +47,7 @@ from test_framework.script import (
CScript,
CScriptNum,
CScriptOp,
MAX_SCRIPT_ELEMENT_SIZE,
OP_0,
OP_1,
OP_16,
@ -1129,8 +1130,6 @@ class SegWitTest(BitcoinTestFramework):
def test_max_witness_push_length(self):
"""Test that witness stack can only allow up to 520 byte pushes."""
MAX_SCRIPT_ELEMENT_SIZE = 520
block = self.build_next_block()
witness_program = CScript([OP_DROP, OP_TRUE])