diff options
author | Justin Turner Arthur <justinarthur@gmail.com> | 2018-09-23 21:34:42 -0500 |
---|---|---|
committer | Justin Turner Arthur <justinarthur@gmail.com> | 2018-09-26 21:50:42 -0500 |
commit | 3a4449e9ad945313c6637283757de8d539cf790f (patch) | |
tree | 3c1ea34e4c1230efbd3267c0716cae47848b686a /test/functional/test_framework/script.py | |
parent | 1d0ce94a54be17b139a052b8e7b4605fe9ac1ecd (diff) | |
download | bitcoin-3a4449e9ad945313c6637283757de8d539cf790f.tar.xz |
Strictly enforce instance attrs in critical functional test classes.
Additionally, removed redundant parentheses and added PEP-8 compliant
spacing around those classes.
Diffstat (limited to 'test/functional/test_framework/script.py')
-rw-r--r-- | test/functional/test_framework/script.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py index 375d6334f7..2fe44010ba 100644 --- a/test/functional/test_framework/script.py +++ b/test/functional/test_framework/script.py @@ -26,7 +26,7 @@ def hash160(s): _opcode_instances = [] class CScriptOp(int): """A single script opcode""" - __slots__ = [] + __slots__ = () @staticmethod def encode_op_pushdata(d): @@ -361,8 +361,11 @@ class CScriptTruncatedPushDataError(CScriptInvalidError): self.data = data super(CScriptTruncatedPushDataError, self).__init__(msg) + # This is used, eg, for blockchain heights in coinbase scripts (bip34) -class CScriptNum(): +class CScriptNum: + __slots__ = ("value",) + def __init__(self, d=0): self.value = d @@ -393,6 +396,8 @@ class CScript(bytes): iter(script) however does iterate by opcode. """ + __slots__ = () + @classmethod def __coerce_instance(cls, other): # Coerce other into bytes |