From 6b2da4b7e465a76397ed605cdcb36572b86aabf5 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 29 Sep 2026 09:23:30 +0000 Subject: [PATCH] whitespace, minor cleanups --- mmgen/main_tool.py | 2 +- mmgen/tool/help.py | 10 +++++----- pyproject.toml | 2 +- test/cmdtest_d/xmrwallet.py | 6 +++--- test/include/unit_test.py | 2 +- test/tooltest2.py | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mmgen/main_tool.py b/mmgen/main_tool.py index 5cdee1c7..70a5f506 100755 --- a/mmgen/main_tool.py +++ b/mmgen/main_tool.py @@ -272,7 +272,7 @@ if gc.prog_name.endswith('-tool'): cmd, *args = cfg._args if cmd in ('help', 'usage') and args: - args[0] = 'command_name=' + args[0] + args[0] = 'cmdname=' + args[0] args, kwargs = process_args(cmd, args, cls) diff --git a/mmgen/tool/help.py b/mmgen/tool/help.py index 02708b0b..c6b30e55 100755 --- a/mmgen/tool/help.py +++ b/mmgen/tool/help.py @@ -183,7 +183,7 @@ def gen_tool_cmd_usage(mod, cmdname): for line in docstr.split('\n')[1:]: yield line.lstrip('\t') -def usage(cmdname=None, *, exit_val=1): +def usage(cmdname, *, exit_val=1): from ..util import Msg, die @@ -204,10 +204,10 @@ def usage(cmdname=None, *, exit_val=1): class tool_cmd(tool_cmd_base): "help/usage commands" - def help(self, command_name=''): + def help(self, cmdname=''): "display usage information for a single command or all commands" - usage(command_name, exit_val=0) + usage(cmdname, exit_val=0) - def usage(self, command_name=''): + def usage(self, cmdname=''): "display usage information for a single command or all commands" - usage(command_name, exit_val=0) + usage(cmdname, exit_val=0) diff --git a/pyproject.toml b/pyproject.toml index d6ab18b2..26e2c3b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ ignore = [ [tool.ruff.lint.per-file-ignores] "protobuf.py" = [ "UP045" ] # Use `X | None` for type annotations "mmgen/rpc/backends/curl.py" = [ "ASYNC221" ] # blocking method in async function -"create-bip-hd-chain-params.py" = [ "F401" ] +"create-bip-hd-chain-params.py" = [ "F401" ] # imported but unused "examples/*" = [ "ASYNC230" ] # open() in async function diff --git a/test/cmdtest_d/xmrwallet.py b/test/cmdtest_d/xmrwallet.py index 805f1be7..964cd04c 100755 --- a/test/cmdtest_d/xmrwallet.py +++ b/test/cmdtest_d/xmrwallet.py @@ -677,7 +677,7 @@ class CmdTestXMRWallet(CmdTestBase): async def mine(self, nblks): start_height = height = await self._get_height() - imsg(f'Height: {height}') + imsg(f'Chain height: {height}') imsg_r(f'Mining {nblks} block{suf(nblks)}...') await self.start_mining() while height < start_height + nblks: @@ -686,7 +686,7 @@ class CmdTestXMRWallet(CmdTestBase): imsg_r('.') ret = await self.stop_mining() imsg('done') - imsg(f'Height: {height}') + imsg(f'Chain height: {height}') return 'ok' if ret == 'OK' else False async def start_mining(self): @@ -815,7 +815,7 @@ class CmdTestXMRWallet(CmdTestBase): if count > 12: # something might have gone wrong, so be more verbose if not verbose: imsg('') - imsg_r(f'Height: {h}, ') + imsg_r(f'Chain height: {h}, ') print_balance(dest, bal_info) verbose = True else: diff --git a/test/include/unit_test.py b/test/include/unit_test.py index b9168118..00a20cb4 100755 --- a/test/include/unit_test.py +++ b/test/include/unit_test.py @@ -65,7 +65,7 @@ If no test is specified, all available tests are run sys.argv.insert(1, '--skip-cfg-file') -cfg = Config(opts_data=opts_data) +cfg = Config(opts_data=opts_data, init_opts={'allow_legacy_tx_files': True}) type(cfg)._reset_ok += ('use_internal_keccak_module', 'debug_addrlist') diff --git a/test/tooltest2.py b/test/tooltest2.py index 92b88b82..4ed77479 100755 --- a/test/tooltest2.py +++ b/test/tooltest2.py @@ -78,7 +78,7 @@ cfg = Config( 'usr_randchars': 0, 'hash_preset': '1', 'passwd_file': 'test/ref/keyaddrfile_password', - }) + 'allow_legacy_tx_files': True}) set_globals(cfg)