Browse Source

minor fixes and cleanups

The MMGen Project 2 months ago
parent
commit
4c2df87e54
3 changed files with 3 additions and 6 deletions
  1. 1 4
      mmgen/cfg.py
  2. 1 1
      mmgen/crypto.py
  3. 1 1
      test/modtest_d/amt.py

+ 1 - 4
mmgen/cfg.py

@@ -113,10 +113,7 @@ class GlobalConstants(Lockable):
 		#    https://importlib-resources.readthedocs.io/en/latest/migration.html
 		#    https://importlib-resources.readthedocs.io/en/latest/migration.html
 		#    https://setuptools.readthedocs.io/en/latest/pkg_resources.html
 		#    https://setuptools.readthedocs.io/en/latest/pkg_resources.html
 
 
-		try:
-			from importlib.resources import files # Python 3.9 and above
-		except ImportError:
-			from importlib_resources import files
+		from importlib.resources import files
 		return files(package).joinpath('data', filename).read_text()
 		return files(package).joinpath('data', filename).read_text()
 
 
 	@property
 	@property

+ 1 - 1
mmgen/crypto.py

@@ -40,7 +40,7 @@ class Crypto:
 	mmenc_nonce_len = 32
 	mmenc_nonce_len = 32
 
 
 	# Scrypt params: 'id_num': [N, r, p] (N is an exponent of two)
 	# Scrypt params: 'id_num': [N, r, p] (N is an exponent of two)
-	# NB: hashlib.scrypt in Python (>=v3.6) supports max N value of 14.  This means that
+	# NB: scrypt() in Python hashlib supports max N value of 14.  This means that
 	# for hash presets > 3 the standalone scrypt library must be used!
 	# for hash presets > 3 the standalone scrypt library must be used!
 	_hp = namedtuple('scrypt_preset', ['N', 'r', 'p'])
 	_hp = namedtuple('scrypt_preset', ['N', 'r', 'p'])
 	hash_presets = {
 	hash_presets = {

+ 1 - 1
test/modtest_d/amt.py

@@ -21,7 +21,7 @@ def test_to_unit(data):
 	for proto, amt, unit, chk in data:
 	for proto, amt, unit, chk in data:
 		amt = protos[proto].coin_amt(amt)
 		amt = protos[proto].coin_amt(amt)
 		res = amt.to_unit(unit)
 		res = amt.to_unit(unit)
-		vmsg(f'  {proto.upper()} {amt.fmt(8)} => {res:<14} {unit}')
+		vmsg(f'  {proto.upper()} {amt.fmt(4):<24} => {res:<21} {unit}')
 		if '.' in chk:
 		if '.' in chk:
 			assert res == Decimal(chk), f'{res} != {Decimal(chk)}'
 			assert res == Decimal(chk), f'{res} != {Decimal(chk)}'
 		else:
 		else: