From 018d4f3a9e34d4ac8f025404958326c5af136a31 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 26 Feb 2021 13:51:26 +0000 Subject: [PATCH] minor changes/fixes --- data_files/mmgen.cfg | 5 ++++- mmgen/globalvars.py | 4 ++-- mmgen/rpc.py | 4 ++-- test/start-coin-daemons.py | 8 +++++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/data_files/mmgen.cfg b/data_files/mmgen.cfg index 4ee3015f..9c07ac63 100644 --- a/data_files/mmgen.cfg +++ b/data_files/mmgen.cfg @@ -90,9 +90,12 @@ # Ignore Bitcoin Cash Node version: # bch_ignore_daemon_version -# Ignore OpenEthereum version: +# Ignore OpenEthereum version for ETH: # eth_ignore_daemon_version +# Ignore OpenEthereum version for ETC: +# etc_ignore_daemon_version + ##################### ## Altcoin options ## ##################### diff --git a/mmgen/globalvars.py b/mmgen/globalvars.py index af0ead1b..c7a4fdc9 100755 --- a/mmgen/globalvars.py +++ b/mmgen/globalvars.py @@ -189,8 +189,8 @@ class GlobalContext(Lockable): 'monero_wallet_rpc_host','monero_wallet_rpc_user','monero_wallet_rpc_password', 'daemon_data_dir','force_256_color','regtest','subseeds','mnemonic_entry_modes', 'btc_max_tx_fee','ltc_max_tx_fee','bch_max_tx_fee','eth_max_tx_fee', - 'btc_ignore_daemon_version','bch_ignore_daemon_version', - 'ltc_ignore_daemon_version','eth_ignore_daemon_version', + 'btc_ignore_daemon_version','bch_ignore_daemon_version','ltc_ignore_daemon_version', + 'eth_ignore_daemon_version','etc_ignore_daemon_version', 'eth_mainnet_chain_name','eth_testnet_chain_name', 'max_tx_file_size','max_input_size' ) diff --git a/mmgen/rpc.py b/mmgen/rpc.py index 3a8db5b2..9993f240 100755 --- a/mmgen/rpc.py +++ b/mmgen/rpc.py @@ -618,7 +618,7 @@ def handle_unsupported_daemon_version(rpc,proto,ignore_daemon_version,warning_sh rpc.daemon.coind_version_str, ),indent=' ').rstrip()) -async def rpc_init(proto,backend=None,ignore_daemon_version=False): +async def rpc_init(proto,backend=None,daemon=None,ignore_daemon_version=False): if not 'rpc' in proto.mmcaps: die(1,f'Coin daemon operations not supported for {proto.name} protocol!') @@ -629,7 +629,7 @@ async def rpc_init(proto,backend=None,ignore_daemon_version=False): 'Ethereum': EthereumRPCClient, }[proto.base_proto]( proto = proto, - daemon = CoinDaemon(proto=proto,test_suite=g.test_suite), + daemon = daemon or CoinDaemon(proto=proto,test_suite=g.test_suite), backend = backend or opt.rpc_backend ) if rpc.daemon_version > rpc.daemon.coind_version: diff --git a/test/start-coin-daemons.py b/test/start-coin-daemons.py index c6fbd88e..cd3af673 100755 --- a/test/start-coin-daemons.py +++ b/test/start-coin-daemons.py @@ -57,7 +57,11 @@ else: opts.usage() for i in ids: if i not in CoinDaemon.network_ids: - die(1,'{!r}: invalid network ID'.format(i)) + die(1,f'{i!r}: invalid network ID') + if i.endswith('_rt'): + die(1,'For regtest, use the plain coin symbol and the --regtest-user option') + if opt.regtest_user and i not in MMGenRegtest.coins: + die(1,f'For regtest, coin symbol must be one of {MMGenRegtest.coins}') if 'eth' in ids and 'etc' in ids: msg('Cannot run ETH and ETC simultaneously, so skipping ETC') @@ -68,8 +72,6 @@ for network_id in ids: if opt.regtest_user: d = MMGenRegtest(network_id).test_daemon(opt.regtest_user) else: - if network_id.endswith('_rt'): - continue d = CoinDaemon(network_id,test_suite=True,flags=['no_daemonize'] if opt.no_daemonize else None) d.debug = opt.debug d.wait = not opt.no_wait