1
0

connect fee edits together

This commit is contained in:
SomberNight
2017-12-18 22:26:29 +01:00
committed by ThomasV
parent 96c86dac27
commit 3ba864bbca
4 changed files with 130 additions and 45 deletions

View File

@@ -81,7 +81,6 @@ class BTCAmountEdit(AmountEdit):
def _base_unit(self):
p = self.decimal_point()
assert p in [2, 5, 8]
if p == 8:
return 'BTC'
if p == 5:
@@ -104,6 +103,18 @@ class BTCAmountEdit(AmountEdit):
else:
self.setText(format_satoshis_plain(amount, self.decimal_point()))
class BTCkBEdit(BTCAmountEdit):
class FeerateEdit(BTCAmountEdit):
def _base_unit(self):
return BTCAmountEdit._base_unit(self) + '/kB'
p = self.decimal_point()
if p == 2:
return 'mBTC/kB'
if p == 0:
return 'sat/byte'
raise Exception('Unknown base unit')
def get_amount(self):
sat_per_byte_amount = BTCAmountEdit.get_amount(self)
if sat_per_byte_amount is None:
return None
return 1000 * sat_per_byte_amount