1
0

Group swap transactions in Qt history (fixes #6237)

- use tree structure of QTreeView
 - grouped items have a 'group_id' field
 - rename 'Normal' swap as 'Forward'
This commit is contained in:
ThomasV
2020-06-16 19:30:41 +02:00
parent f3c4b8698d
commit 4bda882695
6 changed files with 237 additions and 75 deletions

View File

@@ -177,6 +177,9 @@ class Satoshis(object):
def __ne__(self, other):
return not (self == other)
def __add__(self, other):
return Satoshis(self.value + other.value)
# note: this is not a NamedTuple as then its json encoding cannot be customized
class Fiat(object):
@@ -216,6 +219,10 @@ class Fiat(object):
def __ne__(self, other):
return not (self == other)
def __add__(self, other):
assert self.ccy == other.ccy
return Fiat(self.value + other.value, self.ccy)
class MyEncoder(json.JSONEncoder):
def default(self, obj):