Display height, optimize

This commit is contained in:
Michał Sałaban 2018-02-05 18:15:29 +01:00
parent 6a5dc9ad6d
commit 4655de6f25
1 changed files with 6 additions and 5 deletions

View File

@ -10,6 +10,8 @@ class Payment(object):
local_address = None
note = ''
_reprstr = "{} @ {} {:.12f} id={}"
def __init__(self, **kwargs):
self.amount = kwargs.pop('amount', self.amount)
self.timestamp = kwargs.pop('timestamp', self.timestamp)
@ -21,17 +23,16 @@ class Payment(object):
raise ValueError("Excessive arguments for {}: {}".format(type(self), kwargs))
def __repr__(self):
return "{} {:.12f} id={}".format(self.transaction.hash, self.amount, self.payment_id)
return self._reprstr.format(
self.transaction.hash, self.transaction.height or 'pool', self.amount, self.payment_id)
class IncomingPayment(Payment):
def __repr__(self):
return "in: {} {:.12f} id={}".format(self.transaction.hash, self.amount, self.payment_id)
_reprstr = "in: {} @ {} {:.12f} id={}"
class OutgoingPayment(Payment):
def __repr__(self):
return "out: {} {:.12f} id={}".format(self.transaction.hash, self.amount, self.payment_id)
_reprstr = "out: {} @ {} {:.12f} id={}"
class Transaction(object):