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

This commit is contained in:
The MMGen Project 2025-05-23 15:35:23 +00:00
commit 3662b859da
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 7 additions and 9 deletions

View file

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

View file

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