From 3662b859da4d3053671922cc4ad1941f2804677a Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 23 May 2025 15:35:23 +0000 Subject: [PATCH] proto.eth.tw.view: remove `age_disp()` --- mmgen/proto/eth/tw/view.py | 3 --- mmgen/tw/view.py | 13 +++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/mmgen/proto/eth/tw/view.py b/mmgen/proto/eth/tw/view.py index 10cb3239..f68bb85c 100755 --- a/mmgen/proto/eth/tw/view.py +++ b/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 diff --git a/mmgen/tw/view.py b/mmgen/tw/view.py index a794d24e..1ed31a6b 100755 --- a/mmgen/tw/view.py +++ b/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