Browse Source

pylint: various

The MMGen Project 5 months ago
parent
commit
790a22d271
5 changed files with 11 additions and 11 deletions
  1. 1 1
      mmgen/altcoin/util.py
  2. 2 2
      mmgen/proto/btc/tx/completed.py
  3. 4 4
      mmgen/rpc.py
  4. 2 2
      mmgen/tx/completed.py
  5. 2 2
      mmgen/wallet/base.py

+ 1 - 1
mmgen/altcoin/util.py

@@ -35,7 +35,7 @@ def decrypt_keystore(data,passwd,mac_algo=None,mac_params={}):
 	# Derive encryption key from password:
 	if kdf == 'scrypt':
 		if not mac_algo:
-			die(1,f'the ‘mac_algo’ parameter is required for scrypt kdf')
+			die(1, 'the ‘mac_algo’ parameter is required for scrypt kdf')
 		from hashlib import scrypt
 		hashed_pw = scrypt(
 			password = passwd,

+ 2 - 2
mmgen/proto/btc/tx/completed.py

@@ -28,8 +28,8 @@ class Completed(Base,TxBase.Completed):
 		if not (has_ss or has_witness):
 			return False
 		fs = "Hex TX has {} scriptSig but input is of type '{}'!"
-		for n in range(len(txins)):
-			ti,mmti = txins[n],self.inputs[n]
+		for n, ti in enumerate(txins):
+			mmti = self.inputs[n]
 			if ti['scriptSig'] == '' or ( len(ti['scriptSig']) == 46 and # native P2WPKH or P2SH-P2WPKH
 					ti['scriptSig'][:6] == '16' + self.proto.witness_vernum_hex + '14' ):
 				assert 'witness' in ti, 'missing witness'

+ 4 - 4
mmgen/rpc.py

@@ -74,11 +74,11 @@ class IPPort(HiliteStr,InitErrors):
 			return cls.init_fail(e,s)
 
 class json_encoder(json.JSONEncoder):
-	def default(self,obj):
-		if isinstance(obj,Decimal):
-			return str(obj)
+	def default(self, o):
+		if isinstance(o, Decimal):
+			return str(o)
 		else:
-			return json.JSONEncoder.default(self,obj)
+			return json.JSONEncoder.default(self, o)
 
 class RPCBackends:
 

+ 2 - 2
mmgen/tx/completed.py

@@ -49,8 +49,8 @@ class Completed(Base):
 		from .file import MMGenTxFile
 		return MMGenTxFile(self)
 
-	@classmethod
-	def ext_to_cls(cls,ext,proto):
+	@staticmethod
+	def ext_to_cls(ext, proto):
 		"""
 		see twctl:import_token()
 		"""

+ 2 - 2
mmgen/wallet/base.py

@@ -102,8 +102,8 @@ class wallet(MMGenObject,metaclass=WalletMeta):
 				break
 			msg('Trying again...')
 
-	@classmethod
-	def ext_to_cls(cls,ext,proto):
+	@staticmethod
+	def ext_to_cls(ext, proto):
 		return get_wallet_cls(ext=ext)
 
 	def get_fmt_data(self):