status.py 726 B

1234567891011121314151617181920212223242526272829
  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.rune.tx.status: THORChain transaction status class
  12. """
  13. from ....util import msg, gmsg
  14. from ....tx import status as TxBase
  15. class Status(TxBase.Status):
  16. async def display(self, *, idx=''):
  17. try:
  18. self.tx.rpc.get_tx_info(self.tx.coin_txid)
  19. except Exception as e:
  20. msg(f'{type(e).__name__}: {e}')
  21. return 2
  22. gmsg('Transaction is in blockchain')
  23. return 0