Skip to content

Commit

Permalink
mmgen-txcreate autosign: check for signed transactions too
Browse files Browse the repository at this point in the history
  • Loading branch information
mmgen committed Mar 31, 2024
1 parent 60003ea commit f8dd81e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mmgen/autosign.py
Expand Up @@ -103,6 +103,8 @@ def die_wrong_num_txs(self, tx_type, msg=None, desc=None, show_dir=False):
def check_create_ok(self):
if len(self.unsigned):
self.die_wrong_num_txs('unsigned', msg='Cannot create transaction')
if len(self.unsent):
die('AutosignTXError', 'Cannot create transaction: you have an unsent transaction')

def get_unsubmitted(self, tx_type='unsubmitted'):
if len(self.unsubmitted) == 1:
Expand Down
2 changes: 1 addition & 1 deletion mmgen/data/version
@@ -1 +1 @@
14.1.dev24
14.1.dev25
4 changes: 4 additions & 0 deletions test/cmdtest_py_d/ct_automount.py
Expand Up @@ -46,6 +46,7 @@ class CmdTestAutosignAutomount(CmdTestAutosignThreaded, CmdTestRegtestBDBWallet)
('autosign_start_thread', 'starting autosign wait loop'),
('alice_txstatus1', 'getting transaction status (unsigned)'),
('alice_txstatus2', 'getting transaction status (unsent)'),
('alice_txcreate_bad_have_unsent', 'creating the transaction again (error)'),
('alice_txsend1', 'sending a transaction, editing comment'),
('alice_txstatus3', 'getting transaction status (in mempool)'),
('alice_txsend_bad_no_unsent', 'sending the transaction again (error)'),
Expand Down Expand Up @@ -155,6 +156,9 @@ def alice_txsend_abort4(self):
def alice_txcreate_bad_have_unsigned(self):
return self._alice_txcreate(chg_addr='C:5', exit_val=2, expect='already present')

def alice_txcreate_bad_have_unsent(self):
return self._alice_txcreate(chg_addr='C:5', exit_val=2, expect='unsent transaction')

def copy_wallet(self):
self.spawn('', msg_only=True)
if cfg.coin == 'BTC':
Expand Down

0 comments on commit f8dd81e

Please sign in to comment.