test/start-coin-daemons.py: import daemon module after opts.init()

This commit is contained in:
The MMGen Project 2021-08-04 11:34:28 +00:00
commit 25b0a0c995
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 9 additions and 4 deletions

View file

@ -42,6 +42,11 @@ def help_notes_func(proto,k):
def coind_exec():
return coind_exec()
def coin_daemon_network_ids():
from .daemon import CoinDaemon
from .util import fmt_list
return fmt_list(CoinDaemon.get_network_ids(),fmt='bare')
def rel_fee_desc():
from .tx import MMGenTX
return MMGenTX.Base().rel_fee_desc

View file

@ -3,9 +3,6 @@
import sys
from include.tests_header import repo_root
from mmgen.common import *
from mmgen.daemon import *
network_ids = CoinDaemon.get_network_ids()
action = g.prog_name.split('-')[0]
@ -33,12 +30,14 @@ Valid network IDs: {nid}, all, or no_xmr
},
'code': {
'options': lambda s: s.format(a=action.capitalize(),pn=g.prog_name),
'notes': lambda s: s.format(nid=', '.join(network_ids))
'notes': lambda s,help_notes: s.format(nid=help_notes('coin_daemon_network_ids'))
}
}
cmd_args = opts.init(opts_data)
from mmgen.daemon import *
def run(network_id=None,proto=None,daemon_id=None):
d = CoinDaemon(
network_id = network_id,
@ -70,6 +69,7 @@ if 'all' in cmd_args or 'no_xmr' in cmd_args:
run(proto=init_proto(coin=coin,network=network),daemon_id=daemon_id)
else:
ids = cmd_args
network_ids = CoinDaemon.get_network_ids()
if not ids:
opts.usage()
for i in ids: