mmgen-txcreate autosign: check for signed transactions too

This commit is contained in:
The MMGen Project 2024-03-31 13:10:16 +00:00
commit f8dd81efe9
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 7 additions and 1 deletions

View file

@ -103,6 +103,8 @@ class Signable:
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:

View file

@ -1 +1 @@
14.1.dev24
14.1.dev25

View file

@ -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)'),
@ -155,6 +156,9 @@ class CmdTestAutosignAutomount(CmdTestAutosignThreaded, CmdTestRegtestBDBWallet)
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':