| 12345678910111213141516171819202122232425262728293031323334 |
- #!/usr/bin/env python3
- #
- # MMGen Wallet, a terminal-based cryptocurrency wallet
- # Copyright (C)2013-2025 The MMGen Project <mmgen@tuta.io>
- # Licensed under the GNU General Public License, Version 3:
- # https://www.gnu.org/licenses
- # Public project repositories:
- # https://github.com/mmgen/mmgen-wallet
- # https://gitlab.com/mmgen/mmgen-wallet
- """
- tx.util: transaction utilities
- """
- def get_autosign_obj(cfg):
- from ..cfg import Config
- from ..autosign import Autosign
- return Autosign(
- Config({
- '_clone': cfg,
- 'mountpoint': cfg.autosign_mountpoint,
- 'coins': cfg.coin,
- # used only in online environment (xmrwallet, txcreate, txsend, txbump):
- 'online': not cfg.offline}))
- def mount_removable_device(cfg):
- asi = get_autosign_obj(cfg)
- if not asi.device_inserted:
- from ..util import die
- die(1, 'Removable device not present!')
- import atexit
- atexit.register(lambda: asi.do_umount())
- asi.do_mount()
- return asi
|