view.py 711 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. #
  3. # MMGen Wallet, a terminal-based cryptocurrency wallet
  4. # Copyright (C)2013-2026 The MMGen Project <mmgen@tuta.io>
  5. # Licensed under the GNU General Public License, Version 3:
  6. # https://www.gnu.org/licenses
  7. # Public project repositories:
  8. # https://github.com/mmgen/mmgen-wallet
  9. # https://gitlab.com/mmgen/mmgen-wallet
  10. """
  11. proto.eth.tw.view: Ethereum base protocol base class for tracking wallet view classes
  12. """
  13. class EthereumTwView:
  14. def get_disp_prec(self, wide):
  15. return self.proto.coin_amt.max_prec if wide else 8
  16. def gen_subheader(self, cw, color):
  17. if self.disp_prec == 8:
  18. yield 'Balances truncated to 8 decimal points'
  19. yield from super().gen_subheader(cw, color)