Browse Source

proto.btc.tx: rel fee display cleanup

The MMGen Project 5 months ago
parent
commit
09856a52cb
3 changed files with 5 additions and 5 deletions
  1. 3 3
      mmgen/proto/btc/tx/base.py
  2. 1 1
      mmgen/proto/btc/tx/info.py
  3. 1 1
      mmgen/tx/new.py

+ 3 - 3
mmgen/proto/btc/tx/base.py

@@ -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):

+ 1 - 1
mmgen/proto/btc/tx/info.py

@@ -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 ))
 		)

+ 1 - 1
mmgen/tx/new.py

@@ -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):