From df7167d093d0cc6bcfb82a321d64886fda39c090 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 18 Apr 2023 18:35:54 +0000 Subject: [PATCH] xmrwallet: a few minor cleanups --- mmgen/xmrwallet.py | 23 ++++++++++++++++------- test/test_py_d/ts_xmrwallet.py | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/mmgen/xmrwallet.py b/mmgen/xmrwallet.py index 0dd1a853..44689013 100755 --- a/mmgen/xmrwallet.py +++ b/mmgen/xmrwallet.py @@ -322,7 +322,7 @@ class MoneroWalletOps: def check_pat_opt(name): val = getattr(uopt,name) - if not re.fullmatch(uarg_info[name].pat,val,re.ASCII): + if not re.fullmatch( uarg_info[name].pat, val, re.ASCII ): die(1,'{!r}: invalid value for --{}: it must have format {!r}'.format( val, name.replace('_','-'), @@ -341,7 +341,10 @@ class MoneroWalletOps: check_pat_opt(opt) def display_tx_relay_info(self,indent=''): - m = re.fullmatch(uarg_info['tx_relay_daemon'].pat,uopt.tx_relay_daemon,re.ASCII) + m = re.fullmatch( + uarg_info['tx_relay_daemon'].pat, + uopt.tx_relay_daemon, + re.ASCII ) msg(fmt(f""" TX relay info: Host: {blue(m[1])} @@ -384,9 +387,9 @@ class MoneroWalletOps: super().__init__(cfg,uarg_tuple,uopt_tuple) self.kal = KeyAddrList( - cfg, - self.proto, - uarg.infile, + cfg = cfg, + proto = self.proto, + addrfile = uarg.infile, key_address_validity_check = True ) self.create_addr_data() @@ -848,7 +851,10 @@ class MoneroWalletOps: def init_tx_relay_daemon(self): - m = re.fullmatch(uarg_info['tx_relay_daemon'].pat,uopt.tx_relay_daemon,re.ASCII) + m = re.fullmatch( + uarg_info['tx_relay_daemon'].pat, + uopt.tx_relay_daemon, + re.ASCII ) wd2 = MoneroWalletDaemon( cfg = self.cfg, @@ -1051,7 +1057,10 @@ class MoneroWalletOps: super().__init__(cfg,uarg_tuple,uopt_tuple) if uopt.tx_relay_daemon: - m = re.fullmatch(uarg_info['tx_relay_daemon'].pat,uopt.tx_relay_daemon,re.ASCII) + m = re.fullmatch( + uarg_info['tx_relay_daemon'].pat, + self.cfg.tx_relay_daemon, + re.ASCII ) host,port = m[1].split(':') proxy = m[2] md = None diff --git a/test/test_py_d/ts_xmrwallet.py b/test/test_py_d/ts_xmrwallet.py index 4aaad25c..dc73fba3 100755 --- a/test/test_py_d/ts_xmrwallet.py +++ b/test/test_py_d/ts_xmrwallet.py @@ -218,7 +218,7 @@ class TestSuiteXMRWallet(TestSuiteBase): ('bob', '1378FC64', 140, None, ['--restricted-rpc']), ('alice', 'FE3C6545', 150, '1-4', []), ): - udir = os.path.join('test',f'tmp{n}',user) + udir = os.path.join('test','tmp',str(n),user) datadir = os.path.join(self.datadir_base,user) md = CoinDaemon( cfg = cfg,