From c6a207c13d59b21262d7914f76405f2bb850eacf Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 21 Sep 2026 10:30:52 +0000 Subject: [PATCH] whitespace, minor cleanups --- mmgen/proto/xmr/daemon.py | 9 ++++----- test/cmdtest_d/swap.py | 11 +++++------ test/cmdtest_d/xmr_autosign.py | 2 +- test/cmdtest_d/xmrwallet.py | 10 +++++----- test/daemontest_d/rpc.py | 3 +-- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/mmgen/proto/xmr/daemon.py b/mmgen/proto/xmr/daemon.py index 9d3983d2..37201c05 100755 --- a/mmgen/proto/xmr/daemon.py +++ b/mmgen/proto/xmr/daemon.py @@ -30,6 +30,7 @@ class monero_daemon(CoinDaemon): 'linux': [gc.home_dir, '.bitmonero'], 'darwin': [gc.home_dir, '.bitmonero'], 'win32': ['/', 'c', 'ProgramData', 'bitmonero']} + use_pidfile = gc.platform == 'linux' def get_p2p_port(self): return self.rpc_port - 1 @@ -47,8 +48,6 @@ class monero_daemon(CoinDaemon): test_connection = False, daemon = self) - self.use_pidfile = gc.platform == 'linux' - self.shared_args = list_gen( ['--no-zmq'], [f'--p2p-bind-port={self.p2p_port}', self.p2p_port], @@ -81,6 +80,7 @@ class MoneroWalletDaemon(RPCDaemon): new_console_mswin = True networks = ('mainnet', 'testnet') rpc_ports = _nw(13131, 13141, None) # testnet is non-standard + use_pidfile = gc.platform == 'linux' _reset_ok = ('debug', 'wait', 'pids', 'force_kill') test_user_port_shifts = { 'bob': 10, @@ -124,11 +124,10 @@ class MoneroWalletDaemon(RPCDaemon): self.wallet_dir = MoneroTwCtl.get_tw_dir(self.proto) fn_stem = f'{self.exec_fn}-{self.bind_port}' - self.pidfile = self.proto.network_datadir / (fn_stem + '.pid') + if self.use_pidfile: + self.pidfile = self.proto.network_datadir / (fn_stem + '.pid') self.logfile = self.proto.network_datadir / (fn_stem + '.log') - self.use_pidfile = gc.platform == 'linux' - self.proxy = proxy self.monerod_addr = monerod_addr self.monerod_port = ( diff --git a/test/cmdtest_d/swap.py b/test/cmdtest_d/swap.py index 4de2700e..ccec19f6 100755 --- a/test/cmdtest_d/swap.py +++ b/test/cmdtest_d/swap.py @@ -145,12 +145,11 @@ class CmdTestSwapMethods: def _swaptxsend1(self, *, add_opts=[], spawn_only=False): return self._swaptxsend( add_opts = add_opts + [ - # test overriding host:port with coin-specific options: - '--rpc-host=unreachable', # unreachable host - '--ltc-rpc-host=localhost', - '--rpc-port=46381', # bad port - '--ltc-rpc-port=20680', - ], + # test overriding host:port with coin-specific options: + '--rpc-host=unreachable', # unreachable host + '--ltc-rpc-host=localhost', + '--rpc-port=46381', # bad port + '--ltc-rpc-port=20680'], spawn_only = spawn_only) def _swaptxsend(self, *, add_opts=[], spawn_only=False, status=False, dump_hex=False): diff --git a/test/cmdtest_d/xmr_autosign.py b/test/cmdtest_d/xmr_autosign.py index 9e4dcfdb..cd4e4bf8 100755 --- a/test/cmdtest_d/xmr_autosign.py +++ b/test/cmdtest_d/xmr_autosign.py @@ -45,8 +45,8 @@ class CmdTestXMRAutosign(CmdTestXMRWallet, CmdTestAutosignThreaded): # xmrwallet attrs: tx_relay_user = 'miner' - # user sid autosign port_shift kal_range add_coind_args user_data = ( + # user sid autosign port_shift kal_range add_coind_args ('miner', '98831F3A', False, 130, '1', []), ('alice', 'FE3C6545', True, 150, '1-2', [])) diff --git a/test/cmdtest_d/xmrwallet.py b/test/cmdtest_d/xmrwallet.py index 5f12b514..5b12b5c7 100755 --- a/test/cmdtest_d/xmrwallet.py +++ b/test/cmdtest_d/xmrwallet.py @@ -20,7 +20,8 @@ test.cmdtest_d.xmrwallet: xmrwallet tests for the cmdtest.py test suite """ -import os, time, re, atexit, asyncio, shutil +import os +import time, re, atexit, asyncio, shutil from subprocess import run from collections import namedtuple @@ -67,12 +68,11 @@ class CmdTestXMRWallet(CmdTestBase): tmpdir_nums = [29] dfl_random_txs = 3 color = True - # Bob’s daemon is stopped via process kill, not RPC, so put Bob last in list: - # user sid autosign port_shift kal_range add_coind_args user_data = ( + # user sid autosign port_shift kal_range add_coind_args ('miner', '98831F3A', False, 130, '1-2', []), - ('alice', 'FE3C6545', False, 150, '1-4', []), - ('bob', '1378FC64', False, 140, None, ['--restricted-rpc'])) + ('bob', '1378FC64', False, 140, None, ['--restricted-rpc']), + ('alice', 'FE3C6545', False, 150, '1-4', [])) tx_relay_user = 'bob' daemon_datadir_base = os.path.join('test', 'daemons', 'xmrtest') compat = False diff --git a/test/daemontest_d/rpc.py b/test/daemontest_d/rpc.py index b69dbe3e..2b2f6356 100755 --- a/test/daemontest_d/rpc.py +++ b/test/daemontest_d/rpc.py @@ -204,8 +204,7 @@ class unit_tests: 'rpc_port': 32323, # ignored 'btc_tw_name': 'ignored', 'tw_name': 'also-ignored', - 'eth_testnet_chain_names': ['goerli', 'holesky', 'foo', 'bar', 'baz'], - }) + 'eth_testnet_chain_names': ['goerli', 'holesky', 'foo', 'bar', 'baz']}) def reth(self, name, ut): return run_test(['eth', 'eth_rt'], daemon_ids=['reth']) # TODO: eth_tn