connect fee edits together
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user