mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-26 14:00:29 +01:00
Strictly enforce instance attrs in critical functional test classes.
Additionally, removed redundant parentheses and added PEP-8 compliant spacing around those classes.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user