proto.btc.tx: rel fee display cleanup
This commit is contained in:
parent
8ddd94c125
commit
09856a52cb
3 changed files with 5 additions and 5 deletions
|
|
@ -254,12 +254,12 @@ class Base(TxBase.Base):
|
|||
|
||||
return int(ret * (self.cfg.vsize_adj or 1))
|
||||
|
||||
# convert absolute CoinAmt fee to sat/byte using estimated size
|
||||
# convert absolute CoinAmt fee to sat/byte for display using estimated size
|
||||
def fee_abs2rel(self, abs_fee, to_unit='satoshi'):
|
||||
return int(
|
||||
return str(int(
|
||||
abs_fee /
|
||||
getattr(self.proto.coin_amt, to_unit) /
|
||||
self.estimate_size())
|
||||
self.estimate_size()))
|
||||
|
||||
@property
|
||||
def deserialized(self):
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class TxInfo(TxInfo):
|
|||
def format_rel_fee(self):
|
||||
tx = self.tx
|
||||
return ' ({} {}, {} of spend amount)'.format(
|
||||
pink(str(tx.fee_abs2rel(tx.fee))),
|
||||
pink(tx.fee_abs2rel(tx.fee)),
|
||||
tx.rel_fee_disp,
|
||||
pink('{:0.6f}%'.format( tx.fee / tx.send_amt * 100 ))
|
||||
)
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class New(Base):
|
|||
c = ('', '≈')[self.fee_is_approximate],
|
||||
d = abs_fee.hl(),
|
||||
e = self.coin,
|
||||
f = pink(str(self.fee_abs2rel(abs_fee))),
|
||||
f = pink(self.fee_abs2rel(abs_fee)),
|
||||
g = self.rel_fee_disp)
|
||||
from ..ui import keypress_confirm
|
||||
if self.cfg.yes or keypress_confirm(self.cfg, prompt+'OK?', default_yes=True):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue