From a4cb7e3c7209a8805ea0678a384fece5fbb88f12 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 11 Oct 2023 12:58:49 +0000 Subject: [PATCH] pylint throughout (excluding tests) - unused variables --- mmgen/addrfile.py | 2 +- mmgen/altcoin.py | 1 - mmgen/crypto.py | 4 ++-- mmgen/daemon.py | 2 +- mmgen/main_txbump.py | 2 +- mmgen/main_txdo.py | 2 +- mmgen/main_txsign.py | 4 ++-- mmgen/mn_entry.py | 6 +++--- mmgen/opts.py | 2 +- mmgen/passwdlist.py | 4 ++-- mmgen/proto/btc/tw/bal.py | 1 - mmgen/proto/btc/tx/info.py | 2 +- mmgen/proto/eth/contract.py | 20 ++++++-------------- mmgen/proto/eth/tx/base.py | 2 +- mmgen/proto/eth/tx/info.py | 4 ++-- mmgen/proto/eth/tx/online.py | 2 +- mmgen/proto/eth/tx/unsigned.py | 6 +++--- mmgen/share/Opts.py | 2 +- mmgen/test.py | 2 +- mmgen/tool/coin.py | 2 +- mmgen/tool/fileutil.py | 4 ++-- mmgen/tool/help.py | 12 ++++++------ mmgen/tool/rpc.py | 2 +- mmgen/tw/txhistory.py | 2 +- mmgen/tw/view.py | 2 +- mmgen/tx/base.py | 3 --- mmgen/tx/info.py | 2 +- mmgen/tx/sign.py | 4 ++-- mmgen/ui.py | 2 +- mmgen/wallet/dieroll.py | 1 - mmgen/wallet/mmgen.py | 6 ++---- mmgen/xmrwallet.py | 10 +++++----- 32 files changed, 53 insertions(+), 69 deletions(-) diff --git a/mmgen/addrfile.py b/mmgen/addrfile.py index 5d27c668..ff969b41 100755 --- a/mmgen/addrfile.py +++ b/mmgen/addrfile.py @@ -63,7 +63,7 @@ class AddrFile(MMGenObject): ('.' + self.parent.proto.network) if self.parent.proto.testnet else '', self.ext ) - def write(self,fn=None,ask_tty=True,binary=False,desc=None,ask_overwrite=True): + def write(self,fn=None,binary=False,desc=None,ask_overwrite=True): from .fileutil import write_data_to_file write_data_to_file( self.cfg, diff --git a/mmgen/altcoin.py b/mmgen/altcoin.py index 58913030..e6bad08f 100755 --- a/mmgen/altcoin.py +++ b/mmgen/altcoin.py @@ -711,7 +711,6 @@ def init_genonly_altcoins(usr_coin=None,testnet=False): if usr_coin is None: for network in networks: data[network] = CoinInfo.get_supported_coins(network) - trust_level = 0 else: if usr_coin.lower() in gc.core_coins: # core coin, so return immediately from .protocol import CoinProtocol diff --git a/mmgen/crypto.py b/mmgen/crypto.py index 49a2d191..5acdd877 100755 --- a/mmgen/crypto.py +++ b/mmgen/crypto.py @@ -86,7 +86,7 @@ class Crypto: def sha256_rounds(self,s): from hashlib import sha256 - for i in range(self.scramble_hash_rounds): + for _ in range(self.scramble_hash_rounds): s = sha256(s).digest() return s @@ -373,7 +373,7 @@ class Crypto: if self.cfg.echo_passphrase: pw = ' '.join(get_words_from_user( self.cfg, f'Enter {pw_desc} for {data_desc}: ' )) else: - for i in range(gc.passwd_max_tries): + for _ in range(gc.passwd_max_tries): pw = ' '.join(get_words_from_user( self.cfg, f'Enter {pw_desc} for {data_desc}: ' )) pw_chk = ' '.join(get_words_from_user( self.cfg, f'Repeat {pw_desc}: ' )) self.util.dmsg(f'Passphrases: [{pw}] [{pw_chk}]') diff --git a/mmgen/daemon.py b/mmgen/daemon.py index 7e25c0f8..5ac6bddb 100755 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -233,7 +233,7 @@ class Daemon(Lockable): return True def wait_for_state(self,req_state): - for i in range(300): + for _ in range(300): if self.state == req_state: return True time.sleep(0.2) diff --git a/mmgen/main_txbump.py b/mmgen/main_txbump.py index f67919b3..68c13bef 100755 --- a/mmgen/main_txbump.py +++ b/mmgen/main_txbump.py @@ -127,7 +127,7 @@ async def main(): msg(orig_tx.info.format(terse=True)) kal = get_keyaddrlist(cfg,orig_tx.proto) - kl = get_keylist(cfg,orig_tx.proto) + kl = get_keylist(cfg) sign_and_send = bool(seed_files or kl or kal) from .tw.ctl import TwCtl diff --git a/mmgen/main_txdo.py b/mmgen/main_txdo.py index ed82baa4..9665e02a 100755 --- a/mmgen/main_txdo.py +++ b/mmgen/main_txdo.py @@ -142,7 +142,7 @@ async def main(): caller = 'txdo' ) kal = get_keyaddrlist(cfg,cfg._proto) - kl = get_keylist(cfg,cfg._proto) + kl = get_keylist(cfg) tx3 = await txsign(cfg,tx2,seed_files,kl,kal) diff --git a/mmgen/main_txsign.py b/mmgen/main_txsign.py index d9a95899..706910bb 100755 --- a/mmgen/main_txsign.py +++ b/mmgen/main_txsign.py @@ -114,7 +114,7 @@ if not cfg.info and not cfg.terse_info: from .tx.sign import txsign,get_tx_files,get_seed_files,get_keylist,get_keyaddrlist -tx_files = get_tx_files(cfg,infiles) +tx_files = get_tx_files(infiles) seed_files = get_seed_files(cfg,infiles) async def main(): @@ -149,7 +149,7 @@ async def main(): tx1.info.view_with_prompt(f'View data for transaction{tx_num_disp}?') kal = get_keyaddrlist(cfg,tx1.proto) - kl = get_keylist(cfg,tx1.proto) + kl = get_keylist(cfg) tx2 = await txsign(cfg,tx1,seed_files,kl,kal,tx_num_disp) if tx2: diff --git a/mmgen/mn_entry.py b/mmgen/mn_entry.py index 93db9c38..edb76d7b 100755 --- a/mmgen/mn_entry.py +++ b/mmgen/mn_entry.py @@ -76,7 +76,7 @@ class MnEntryModeFull(MnEntryMode): def get_word(self,mne): s,pad = ('', 0) while True: - ch,s,foo = self.get_char(s) + ch,s,_ = self.get_char(s) if ch in _return_chars: if s: break @@ -116,7 +116,7 @@ class MnEntryModeShort(MnEntryMode): def get_word(self,mne): s,pad = ('', 0) while True: - ch,s,foo = self.get_char(s) + ch,s,_ = self.get_char(s) if ch in _return_chars: if s: break @@ -159,7 +159,7 @@ class MnEntryModeFixed(MnEntryMode): def get_word(self,mne): s,pad = ('', 0) while True: - ch,s,foo = self.get_char(s) + ch,s,_ = self.get_char(s) if ch in _return_chars: if s: break diff --git a/mmgen/opts.py b/mmgen/opts.py index f36c2419..c6401e00 100755 --- a/mmgen/opts.py +++ b/mmgen/opts.py @@ -105,7 +105,7 @@ class UserOpts: self.usage_data = od['text'].get('usage2') or od['text']['usage'] # po: (user_opts,cmd_args,opts,filtered_opts) - po = parsed_opts or Opts.parse_opts(od,opt_filter=opt_filter,parse_only=parse_only) + po = parsed_opts or Opts.parse_opts(od,opt_filter=opt_filter) cfg._args = po.cmd_args cfg._uopts = uopts = po.user_opts diff --git a/mmgen/passwdlist.py b/mmgen/passwdlist.py index 9fac2a92..f18d6129 100755 --- a/mmgen/passwdlist.py +++ b/mmgen/passwdlist.py @@ -99,7 +99,7 @@ class PasswordList(AddrList): return if self.hex2bip39: ymsg(self.feature_warn_fs.format(pw_fmt)) - self.set_pw_len_vs_seed_len(pw_len,seed) # sets self.bip39, self.xmrseed, self.xmrproto self.baseconv + self.set_pw_len_vs_seed_len(seed) # sets self.bip39, self.xmrseed, self.xmrproto self.baseconv self.al_id = AddrListID( sid=seed.sid, mmtype=MMGenPasswordType(self.proto,'P') ) self.data = self.generate(seed,pw_idxs) @@ -154,7 +154,7 @@ class PasswordList(AddrList): self.pw_len = int(pw_len) self.chk_pw_len() - def set_pw_len_vs_seed_len(self,pw_len,seed): + def set_pw_len_vs_seed_len(self,seed): pf = self.pw_fmt if pf == 'hex': pw_bytes = self.pw_len // 2 diff --git a/mmgen/proto/btc/tw/bal.py b/mmgen/proto/btc/tw/bal.py index 513a58e6..001b0758 100755 --- a/mmgen/proto/btc/tw/bal.py +++ b/mmgen/proto/btc/tw/bal.py @@ -26,7 +26,6 @@ class BitcoinTwGetBalance(TwGetBalance): async def create_data(self): lbl_id = ('account','label')['label_api' in self.rpc.caps] - amt0 = self.proto.coin_amt('0') for d in await self.rpc.call('listunspent',0): tw_lbl = get_tw_label(self.proto,d[lbl_id]) if tw_lbl: diff --git a/mmgen/proto/btc/tx/info.py b/mmgen/proto/btc/tx/info.py index 80758683..3804d4f2 100755 --- a/mmgen/proto/btc/tx/info.py +++ b/mmgen/proto/btc/tx/info.py @@ -28,7 +28,7 @@ class TxInfo(TxInfo): Fee: {a} {c}{r} """) - def format_rel_fee(self,terse): + def format_rel_fee(self): tx = self.tx return ' ({} {}, {} of spend amount)'.format( pink(str(tx.fee_abs2rel(tx.fee))), diff --git a/mmgen/proto/eth/contract.py b/mmgen/proto/eth/contract.py index d32367e8..255d058e 100755 --- a/mmgen/proto/eth/contract.py +++ b/mmgen/proto/eth/contract.py @@ -95,28 +95,24 @@ class TokenCommon(MMGenObject): self, to_addr, amt, - method_sig = 'transfer(address,uint256)', - from_addr = None): - from_arg = from_addr.rjust(64,'0') if from_addr else '' + method_sig = 'transfer(address,uint256)'): + from_arg = '' to_arg = to_addr.rjust(64,'0') amt_arg = '{:064x}'.format( int(amt / self.base_unit) ) return self.create_method_id(method_sig) + from_arg + to_arg + amt_arg def make_tx_in( self, - from_addr, to_addr, amt, start_gas, gasPrice, nonce, - method_sig = 'transfer(address,uint256)', - from_addr2 = None): + method_sig = 'transfer(address,uint256)'): data = self.create_data( to_addr, amt, - method_sig = method_sig, - from_addr = from_addr2) + method_sig = method_sig) return { 'to': bytes.fromhex(self.addr), 'startgas': start_gas.toWei(), @@ -162,18 +158,14 @@ class TokenCommon(MMGenObject): key, start_gas, gasPrice, - method_sig = 'transfer(address,uint256)', - from_addr2=None, - return_data=False): + method_sig = 'transfer(address,uint256)'): tx_in = self.make_tx_in( - from_addr, to_addr, amt, start_gas, gasPrice, nonce = int(await self.rpc.call('eth_getTransactionCount','0x'+from_addr,'pending'),16), - method_sig = method_sig, - from_addr2 = from_addr2 ) + method_sig = method_sig) txhex,_ = await self.txsign(tx_in,key,from_addr) return await self.txsend(txhex) diff --git a/mmgen/proto/eth/tx/base.py b/mmgen/proto/eth/tx/base.py index b0b81200..f6d66a56 100755 --- a/mmgen/proto/eth/tx/base.py +++ b/mmgen/proto/eth/tx/base.py @@ -43,7 +43,7 @@ class Base(TxBase.Base): def is_replaceable(self): return True - async def get_receipt(self,txid,silent=False): + async def get_receipt(self,txid): rx = await self.rpc.call('eth_getTransactionReceipt','0x'+txid) # -> null if pending if not rx: return None diff --git a/mmgen/proto/eth/tx/info.py b/mmgen/proto/eth/tx/info.py index 844edeb3..0b2c9e73 100755 --- a/mmgen/proto/eth/tx/info.py +++ b/mmgen/proto/eth/tx/info.py @@ -58,7 +58,7 @@ class TxInfo(TxInfo): def format_abs_fee(self,color,iwidth): return self.tx.fee.fmt(color=color,iwidth=iwidth) + (' (max)' if self.tx.txobj['data'] else '') - def format_rel_fee(self,terse): + def format_rel_fee(self): return ' ({} of spend amount)'.format( pink('{:0.6f}%'.format( self.tx.fee / self.tx.send_amt * 100 )) ) @@ -73,7 +73,7 @@ class TxInfo(TxInfo): class TokenTxInfo(TxInfo): fmt_keys = ('from','token_to','amt','nonce') - def format_rel_fee(self,terse): + def format_rel_fee(self): return '' def format_body(self,*args,**kwargs): diff --git a/mmgen/proto/eth/tx/online.py b/mmgen/proto/eth/tx/online.py index f0875371..e7876bc1 100755 --- a/mmgen/proto/eth/tx/online.py +++ b/mmgen/proto/eth/tx/online.py @@ -72,7 +72,7 @@ class TokenOnlineSigned(TokenSigned,OnlineSigned): def parse_txfile_serialized_data(self): from ....addr import TokenAddr from ..contract import Token - d = OnlineSigned.parse_txfile_serialized_data(self) + OnlineSigned.parse_txfile_serialized_data(self) o = self.txobj assert self.twctl.token == o['to'] o['token_addr'] = TokenAddr(self.proto,o['to']) diff --git a/mmgen/proto/eth/tx/unsigned.py b/mmgen/proto/eth/tx/unsigned.py index afb071a1..72c02df7 100755 --- a/mmgen/proto/eth/tx/unsigned.py +++ b/mmgen/proto/eth/tx/unsigned.py @@ -41,7 +41,7 @@ class Unsigned(Completed,TxBase.Unsigned): self.txobj = o return d # 'token_addr','decimals' required by Token subclass - async def do_sign(self,wif,tx_num_str): + async def do_sign(self,wif): o = self.txobj o_conv = { 'to': bytes.fromhex(o['to']), @@ -77,7 +77,7 @@ class Unsigned(Completed,TxBase.Unsigned): msg_r(f'Signing transaction{tx_num_str}...') try: - await self.do_sign(keys[0].sec.wif,tx_num_str) + await self.do_sign(keys[0].sec.wif) msg('OK') from ....tx import SignedTX return await SignedTX(cfg=self.cfg,data=self.__dict__) @@ -97,7 +97,7 @@ class TokenUnsigned(TokenCompleted,Unsigned): o['data'] = t.create_data(o['to'],o['amt']) o['token_to'] = t.transferdata2sendaddr(o['data']) - async def do_sign(self,wif,tx_num_str): + async def do_sign(self,wif): o = self.txobj t = Token(self.cfg,self.proto,o['token_addr'],o['decimals']) tx_in = t.make_tx_in( diff --git a/mmgen/share/Opts.py b/mmgen/share/Opts.py index 3bc040a0..bdf41271 100755 --- a/mmgen/share/Opts.py +++ b/mmgen/share/Opts.py @@ -155,7 +155,7 @@ def process_uopts(opts_data,short_opts,long_opts): return uopts,uargs -def parse_opts(opts_data,opt_filter=None,parse_only=False): +def parse_opts(opts_data,opt_filter=None): short_opts,long_opts,filtered_opts = [],[],[] def parse_lines(opts_type): diff --git a/mmgen/test.py b/mmgen/test.py index 8c1816f5..886b0150 100755 --- a/mmgen/test.py +++ b/mmgen/test.py @@ -19,7 +19,7 @@ rand_h = sha256('.'.join(sys.argv).encode()) def fake_urandom(n): def gen(rounds): - for i in range(rounds): + for _ in range(rounds): rand_h.update(b'foo') yield rand_h.digest() diff --git a/mmgen/tool/coin.py b/mmgen/tool/coin.py index f917365b..56cb2ff3 100755 --- a/mmgen/tool/coin.py +++ b/mmgen/tool/coin.py @@ -43,7 +43,7 @@ class tool_cmd(tool_cmd_base): need_proto = True need_addrtype = True - def _init_generators(self,arg=None): + def _init_generators(self): return generator_data( kg = KeyGenerator( self.cfg, self.proto, self.mmtype.pubkey_type ), ag = AddrGenerator( self.cfg, self.proto, self.mmtype ), diff --git a/mmgen/tool/fileutil.py b/mmgen/tool/fileutil.py index e0b9e4f9..57818ef6 100755 --- a/mmgen/tool/fileutil.py +++ b/mmgen/tool/fileutil.py @@ -96,7 +96,7 @@ class tool_cmd(tool_cmd_base): from ..util2 import parse_bytespec - def encrypt_worker(wid): + def encrypt_worker(): ctr_init_val = os.urandom( Crypto.aesctr_iv_len ) c = Cipher( algorithms.AES(key), modes.CTR(ctr_init_val), backend=default_backend() ) encryptor = c.encryptor() @@ -118,7 +118,7 @@ class tool_cmd(tool_cmd_base): q1,q2 = ( Queue(), Queue() ) for i in range(max(1,threads-2)): - t = Thread( target=encrypt_worker, args=[i] ) + t = Thread(target=encrypt_worker) t.daemon = True t.start() diff --git a/mmgen/tool/help.py b/mmgen/tool/help.py index d5768374..5154f2fb 100755 --- a/mmgen/tool/help.py +++ b/mmgen/tool/help.py @@ -132,14 +132,14 @@ def gen_tool_usage(): for line in m2.rstrip().split('\n'): yield line.lstrip('\t') -def gen_tool_cmd_usage(cfg,mod,cmdname): +def gen_tool_cmd_usage(mod,cmdname): from ..cfg import gc from ..util import capfirst cls = main_tool.get_mod_cls(mod) docstr = getattr(cls,cmdname).__doc__.strip() - args,kwargs,kwargs_types,flag,ann = main_tool.create_call_sig(cmdname,cls) + args,kwargs,kwargs_types,_,ann = main_tool.create_call_sig(cmdname,cls) ARGS = 'ARG' if len(args) == 1 else 'ARGS' if args else '' KWARGS = 'KEYWORD ARG' if len(kwargs) == 1 else 'KEYWORD ARGS' if kwargs else '' @@ -183,14 +183,14 @@ def gen_tool_cmd_usage(cfg,mod,cmdname): for line in docstr.split('\n')[1:]: yield line.lstrip('\t') -def usage(cfg,cmdname=None,exit_val=1): +def usage(cmdname=None,exit_val=1): from ..util import Msg,die if cmdname: for mod,cmdlist in main_tool.mods.items(): if cmdname in cmdlist: - Msg('\n'.join(gen_tool_cmd_usage(cfg,mod,cmdname))) + Msg('\n'.join(gen_tool_cmd_usage(mod,cmdname))) break else: die(1,f'{cmdname!r}: no such tool command') @@ -206,8 +206,8 @@ class tool_cmd(tool_cmd_base): def help(self,command_name=''): "display usage information for a single command or all commands" - usage(self.cfg,command_name,exit_val=0) + usage(command_name,exit_val=0) def usage(self,command_name=''): "display usage information for a single command or all commands" - usage(self.cfg,command_name,exit_val=0) + usage(command_name,exit_val=0) diff --git a/mmgen/tool/rpc.py b/mmgen/tool/rpc.py index 6ef5fa09..f160d6de 100755 --- a/mmgen/tool/rpc.py +++ b/mmgen/tool/rpc.py @@ -201,7 +201,7 @@ class tool_cmd(tool_cmd_base): parameter. """ from ..tw.ctl import TwCtl - ret = await (await TwCtl(self.cfg,self.proto,mode='w')).rescan_blockchain(start_block,stop_block) + await (await TwCtl(self.cfg,self.proto,mode='w')).rescan_blockchain(start_block,stop_block) return True async def twexport(self,include_amts=True,pretty=False,prune=False,warn_used=False,force=False): diff --git a/mmgen/tw/txhistory.py b/mmgen/tw/txhistory.py index 80e4a2cf..d369772f 100755 --- a/mmgen/tw/txhistory.py +++ b/mmgen/tw/txhistory.py @@ -174,7 +174,7 @@ class TwTxHistory(TwView): 'txid': lambda i: i.txid, } - async def set_dates(self,foo): + async def set_dates(self,_): pass @property diff --git a/mmgen/tw/view.py b/mmgen/tw/view.py index 768810bc..98d33d4c 100755 --- a/mmgen/tw/view.py +++ b/mmgen/tw/view.py @@ -636,7 +636,7 @@ class TwView(MMGenObject,metaclass=AsyncInit): line_processing = 'print', color = False ), desc = f'{parent.desc} listing' ) - except UserNonConfirmation as e: + except UserNonConfirmation: parent.oneshot_msg = yellow(f'File {outfile!r} not overwritten by user request') else: parent.oneshot_msg = green(f'Data written to {outfile!r}') diff --git a/mmgen/tx/base.py b/mmgen/tx/base.py index fc4bef73..186c123a 100755 --- a/mmgen/tx/base.py +++ b/mmgen/tx/base.py @@ -66,7 +66,6 @@ class MMGenTxIOList(list,MMGenObject): self.parent = parent if data: assert isinstance(data,list), 'MMGenTxIOList_check1' - data = data else: data = list() list.__init__(self,data) @@ -78,8 +77,6 @@ class Base(MMGenObject): coin_txid = None timestamp = None blockcount = None - coin = None - dcoin = None locktime = None chain = None signed = False diff --git a/mmgen/tx/info.py b/mmgen/tx/info.py index 436f1b98..50ea5ef3 100755 --- a/mmgen/tx/info.py +++ b/mmgen/tx/info.py @@ -78,7 +78,7 @@ class TxInfo: C = tx.change.fmt(color=True,iwidth=iwidth), s = tx.send_amt.fmt(color=True,iwidth=iwidth), a = self.format_abs_fee(color=True,iwidth=iwidth), - r = self.format_rel_fee(terse), + r = self.format_rel_fee(), d = tx.dcoin, c = tx.coin ) diff --git a/mmgen/tx/sign.py b/mmgen/tx/sign.py index 4d7d959e..0d78826c 100755 --- a/mmgen/tx/sign.py +++ b/mmgen/tx/sign.py @@ -111,7 +111,7 @@ def add_keys(tx,src,infiles=None,saved_seeds=None,keyaddr_list=None): def _pop_matching_fns(args,cmplist): # strips found args return list(reversed([args.pop(args.index(a)) for a in reversed(args) if get_extension(a) in cmplist])) -def get_tx_files(cfg,args): +def get_tx_files(args): from .unsigned import Unsigned ret = _pop_matching_fns(args,[Unsigned.ext]) if not ret: @@ -135,7 +135,7 @@ def get_keyaddrlist(cfg,proto): return KeyAddrList( cfg, proto, cfg.mmgen_keys_from_file ) return None -def get_keylist(cfg,proto): +def get_keylist(cfg): if cfg.keys_from_file: from ..fileutil import get_lines_from_file return get_lines_from_file( cfg, cfg.keys_from_file, 'key-address data', trim_comments=True ) diff --git a/mmgen/ui.py b/mmgen/ui.py index 95defaa5..5be28496 100755 --- a/mmgen/ui.py +++ b/mmgen/ui.py @@ -123,7 +123,7 @@ def do_pager(text): for pager in pagers: try: m = text + ('' if pager == 'less' else end_msg) - p = run([pager],input=m.encode(),check=True) + run([pager],input=m.encode(),check=True) msg_r('\r') except: pass diff --git a/mmgen/wallet/dieroll.py b/mmgen/wallet/dieroll.py index 8b0a3e86..e91aa82f 100755 --- a/mmgen/wallet/dieroll.py +++ b/mmgen/wallet/dieroll.py @@ -102,7 +102,6 @@ class wallet(wallet): return ch else: msg_r(invalid_msg) - sleep = self.cfg.err_disp_timeout p = clear_line + prompt_fs dierolls,n = [],1 diff --git a/mmgen/wallet/mmgen.py b/mmgen/wallet/mmgen.py index 44b5db2c..e34d484b 100755 --- a/mmgen/wallet/mmgen.py +++ b/mmgen/wallet/mmgen.py @@ -27,9 +27,7 @@ class wallet(wallet): def __init__(self,*args,**kwargs): if self.cfg.label: - self.label = MMGenWalletLabel( - self.cfg.label, - msg = "Error in option '--label'" ) + self.label = MMGenWalletLabel(self.cfg.label) else: self.label = None super().__init__(*args,**kwargs) @@ -140,7 +138,7 @@ class wallet(wallet): msg(f'Hash parameters {" ".join(hash_params)!r} don’t match hash preset {d.hash_preset!r}') return False - lmin,foo,lmax = sorted(baseconv('b58').seedlen_map_rev) # 22,33,44 + lmin,_,lmax = sorted(baseconv('b58').seedlen_map_rev) # 22,33,44 for i,key in (4,'salt'),(5,'enc_seed'): l = lines[i].split(' ') chk = l.pop(0) diff --git a/mmgen/xmrwallet.py b/mmgen/xmrwallet.py index a234d25a..b28de6cb 100755 --- a/mmgen/xmrwallet.py +++ b/mmgen/xmrwallet.py @@ -1216,7 +1216,7 @@ class MoneroWalletOps: for acct_idx,acct_data in enumerate(data): for addr_idx,addr_data in enumerate(acct_data['addresses'][1:],1): msg(fs.format(acct_idx, addr_idx, addr_data['address'])) - ret = self.c.call( 'create_address', account_index=acct_idx ) + self.c.call( 'create_address', account_index=acct_idx ) def restore_labels(): bmsg(' Restoring labels:') @@ -1246,7 +1246,7 @@ class MoneroWalletOps: data = {'wallet_metadata': restored_data} ).write(add_suf='.bad') die(3,'Fatal error') - res = await super().process_wallet(d,fn,last) + await super().process_wallet(d,fn,last) h = self.rpc(self,d) h.open_wallet('newly created') @@ -1559,10 +1559,10 @@ class MoneroWalletOps: a = self.label or f"xmrwallet new {'account' if self.account is None else 'address'}", b = make_timestr() ) if self.account is None: - acct,addr = h.create_acct(label=label) + h.create_acct(label=label) else: msg_r(f'\n Account index: {pink(str(self.account))}') - addr = h.create_new_addr(self.account,label=label) + h.create_new_addr(self.account,label=label) accts_data = h.get_accts()[0] @@ -1781,7 +1781,7 @@ class MoneroWalletOps: async def process_wallet(self,d,fn,last): h = self.rpc(self,d) h.open_wallet('source') - acct_data,addr_data = h.get_accts(print=False) + _,addr_data = h.get_accts(print=False) msg('') MoneroWalletDumpFile.New( parent = self,