unsigned.py 913 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python3
  2. #
  3. # mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet
  4. # Copyright (C)2013-2024 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. tx.unsigned: unsigned transaction class
  12. """
  13. from .completed import Completed
  14. from ..util import remove_dups
  15. class Unsigned(Completed):
  16. desc = 'unsigned transaction'
  17. ext = 'rawtx'
  18. automount = False
  19. def delete_attrs(self,desc,attr):
  20. for e in getattr(self,desc):
  21. if hasattr(e,attr):
  22. delattr(e,attr)
  23. def get_sids(self,desc):
  24. return remove_dups(
  25. (e.mmid.sid for e in getattr(self,desc) if e.mmid),
  26. quiet = True )
  27. class AutomountUnsigned(Unsigned):
  28. desc = 'unsigned automount transaction'
  29. ext = 'arawtx'
  30. automount = True