1
0

util.Satoshis: note that sometimes this actually has 'msat' precision

This commit is contained in:
SomberNight
2020-02-17 16:52:25 +01:00
parent a6302b3a12
commit 0723355a0f
2 changed files with 5 additions and 2 deletions

View File

@@ -208,13 +208,15 @@ class Satoshis(object):
def __new__(cls, value):
self = super(Satoshis, cls).__new__(cls)
# note: 'value' sometimes has msat precision
self.value = value
return self
def __repr__(self):
return 'Satoshis(%d)'%self.value
return f'Satoshis({self.value})'
def __str__(self):
# note: precision is truncated to satoshis here
return format_satoshis(self.value)
def __eq__(self, other):