From c6f2d8b6fc0df58a5f758849e8adaf9f2936123d Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 10 Oct 2018 21:39:36 -0400 Subject: [PATCH] fix pylint --- torba/basetransaction.py | 2 +- torba/hash.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/torba/basetransaction.py b/torba/basetransaction.py index 0a4609d73..a5fa2fce1 100644 --- a/torba/basetransaction.py +++ b/torba/basetransaction.py @@ -150,7 +150,7 @@ class BaseInput(InputOutput): @classmethod def deserialize_from(cls, stream): - tx_ref = TXRefImmutable.from_hash(stream.read(32)) + tx_ref = TXRefImmutable.from_hash(stream.read(32), -1) position = stream.read_uint32() script = stream.read_string() sequence = stream.read_uint32() diff --git a/torba/hash.py b/torba/hash.py index bd641b03f..049cde243 100644 --- a/torba/hash.py +++ b/torba/hash.py @@ -49,7 +49,11 @@ class TXRef: class TXRefImmutable(TXRef): - __slots__ = '_height', + __slots__ = ('_height',) + + def __init__(self): + super().__init__() + self._height = -1 @classmethod def from_hash(cls, tx_hash: bytes, height: int) -> 'TXRefImmutable':