Browse Source

a few minor fixes and cleanups

The MMGen Project 2 years ago
parent
commit
1ba9733199

+ 1 - 1
mmgen/cfgfile.py

@@ -23,6 +23,7 @@ cfgfile: API for the MMGen runtime configuration file and related files
 import os,re
 from collections import namedtuple
 
+from .cfg import gc
 from .util import msg,ymsg,suf,fmt,fmt_list,oneshot_warning,strip_comment,capfirst
 
 def mmgen_cfg_file(cfg,id_str):
@@ -188,7 +189,6 @@ class CfgFileSampleSys(cfg_file_sample):
 		else:
 			# self.fn is used for error msgs only, so file need not exist on filesystem
 			self.fn = os.path.join(os.path.dirname(__file__),'data',self.fn_base)
-			from .cfg import gc
 			self.data = gc.get_mmgen_data_file(self.fn_base).splitlines()
 
 	def make_metadata(self):

+ 0 - 1
mmgen/main_autosign.py

@@ -122,7 +122,6 @@ This command is currently available only on Linux-based platforms.
 
 cfg = Config(
 	opts_data = opts_data,
-	add_opts = ['outdir','passwd_file'], # in _set_ok, so must be set
 	init_opts = {
 		'quiet': True,
 		'out_fmt': 'wallet',

+ 1 - 1
mmgen/main_tool.py

@@ -373,7 +373,7 @@ if gc.prog_name == 'mmgen-tool':
 		die(1,f'{cmd!r}: no such command')
 
 	cfg = Config(
-		opts_data,
+		opts_data   = opts_data,
 		parsed_opts = po,
 		need_proto  = cls.need_proto,
 		init_opts   = {'rpc_backend':'aiohttp'} if cmd == 'twimport' else None,

+ 1 - 1
mmgen/opts.py

@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 """
-opts: MMGen-specific options processing after generic processing by share.Opts
+opts: MMGen-specific command-line options processing after generic processing by share.Opts
 """
 import sys,os
 

+ 1 - 0
mmgen/proto/eth/params.py

@@ -47,6 +47,7 @@ class mainnet(CoinProtocol.DummyWIF,CoinProtocol.Secp256k1):
 		62:   'morden',           # ethereum classic testnet
 		17:   'developmentchain', # parity dev chain
 		1337: 'developmentchain', # geth dev chain
+		711:  'ethereum',         # geth mainnet (empty chain)
 	}
 
 	@property

+ 3 - 3
mmgen/proto/eth/rpc.py

@@ -16,18 +16,18 @@ import re
 
 from ...base_obj import AsyncInit
 from ...obj import Int
-from ...util import die,oneshot_warning_group
+from ...util import die,fmt,oneshot_warning_group
 from ...rpc import RPCClient
 
 class daemon_warning(oneshot_warning_group):
 
 	class geth:
 		color = 'yellow'
-		message = 'Geth has not been tested on mainnet.  You may experience problems.'
+		message = 'Geth has not been tested on mainnet. You may experience problems.'
 
 	class erigon:
 		color = 'red'
-		message = 'Erigon support is EXPERIMENTAL.  Use at your own risk!!!'
+		message = 'Erigon support is EXPERIMENTAL. Use at your own risk!!!'
 
 class CallSigs:
 	pass

+ 1 - 1
test/unit_tests.py

@@ -91,7 +91,7 @@ class UnitTestHelpers(object):
 		exc_w = max(len(e[1]) for e in data)
 		m_exc = '{!r}: incorrect exception type (expected {!r})'
 		m_err = '{!r}: incorrect error msg (should match {!r}'
-		m_noraise = "\nillegal action 'bad {}' failed to raise exception {!r}"
+		m_noraise = "\nillegal action 'bad {}' failed to raise an exception (expected {!r})"
 		for (desc,exc_chk,emsg_chk,func) in data:
 			try:
 				cfg._util.vmsg_r('  bad {:{w}}'.format( desc+':', w=desc_w+1 ))

+ 1 - 1
test/unit_tests_d/ut_flags.py

@@ -59,7 +59,7 @@ class unit_test(object):
 				('flag (1)',             'ClassFlagsError', 'unrecognized flag', bad1 ),
 				('opt (1)',              'ClassFlagsError', 'unrecognized opt',  bad2 ),
 				('avail_opts (1)',       'ClassFlagsError', 'underscore',        bad3 ),
-				('avail_opts (1)',       'ClassFlagsError', 'reserved name',     bad4 ),
+				('avail_opts (2)',       'ClassFlagsError', 'reserved name',     bad4 ),
 				('class invocation (1)', 'AssertionError',  'list or tuple',     bad5 ),
 				('class invocation (2)', 'ClassFlagsError', 'unrecognized opt',  bad6 ),
 				('flag (2)',             'ClassFlagsError', 'not set',           bad7 ),