From 790a22d271522e72ab890154dfa75e27f967e85d Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 20 Sep 2024 09:36:06 +0000 Subject: [PATCH] pylint: various --- mmgen/altcoin/util.py | 2 +- mmgen/proto/btc/tx/completed.py | 4 ++-- mmgen/rpc.py | 8 ++++---- mmgen/tx/completed.py | 4 ++-- mmgen/wallet/base.py | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mmgen/altcoin/util.py b/mmgen/altcoin/util.py index a60a6bc3..219da4bf 100755 --- a/mmgen/altcoin/util.py +++ b/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, diff --git a/mmgen/proto/btc/tx/completed.py b/mmgen/proto/btc/tx/completed.py index b5835ca6..0c3bc70c 100755 --- a/mmgen/proto/btc/tx/completed.py +++ b/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' diff --git a/mmgen/rpc.py b/mmgen/rpc.py index 44bbf1cf..0974c267 100755 --- a/mmgen/rpc.py +++ b/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: diff --git a/mmgen/tx/completed.py b/mmgen/tx/completed.py index 4c415ac3..24bed5b2 100755 --- a/mmgen/tx/completed.py +++ b/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() """ diff --git a/mmgen/wallet/base.py b/mmgen/wallet/base.py index 93a179ea..45559f24 100755 --- a/mmgen/wallet/base.py +++ b/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):