pylint: various
This commit is contained in:
parent
02ff2dd94a
commit
790a22d271
5 changed files with 11 additions and 11 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue