Browse Source

proto.eth.tw.view: remove `age_disp()`

The MMGen Project 6 months ago
parent
commit
3662b859da
2 changed files with 7 additions and 9 deletions
  1. 0 3
      mmgen/proto/eth/tw/view.py
  2. 7 6
      mmgen/tw/view.py

+ 0 - 3
mmgen/proto/eth/tw/view.py

@@ -16,9 +16,6 @@ from ....tw.view import TwView
 
 class EthereumTwView(TwView):
 
-	def age_disp(self, o, age_fmt): # TODO
-		pass
-
 	def get_disp_prec(self, wide):
 		return self.proto.coin_amt.max_prec if wide else 8
 

+ 7 - 6
mmgen/tw/view.py

@@ -226,12 +226,13 @@ class TwView(MMGenObject, metaclass=AsyncInit):
 		self._age_fmt = val
 
 	def age_disp(self, o, age_fmt):
-		if age_fmt == 'confs':
-			return o.confs or '-'
-		elif age_fmt == 'block':
-			return self.rpc.blockcount + 1 - o.confs if o.confs else '-'
-		else:
-			return self.date_formatter[age_fmt](self.rpc, o.date)
+		if self.has_age:
+			if age_fmt == 'confs':
+				return o.confs or '-'
+			elif age_fmt == 'block':
+				return self.rpc.blockcount + 1 - o.confs if o.confs else '-'
+			else:
+				return self.date_formatter[age_fmt](self.rpc, o.date)
 
 	def get_disp_prec(self, wide):
 		return self.proto.coin_amt.max_prec