diff options
author | MacroFake <falke.marco@gmail.com> | 2022-11-15 10:05:02 +0100 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-11-15 10:03:56 +0100 |
commit | fa10f193b54650b3071bc7ee2d90fcfe40a16dc9 (patch) | |
tree | 7cd06fcf81b483fd6a8acf981080bf70dde1bb26 | |
parent | 555519d082fbe5e047595f06d7f301e441bb7149 (diff) |
test: Set default in add_wallet_options if only one type can be chosen
-rwxr-xr-x | test/functional/test_framework/test_framework.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index d88cccecd9..1140d26f4f 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -449,11 +449,15 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): def add_wallet_options(self, parser, *, descriptors=True, legacy=True): group = parser.add_mutually_exclusive_group() + kwargs = {} + if descriptors + legacy == 1: + # If only one type can be chosen, set it as default + kwargs["default"] = descriptors if descriptors: - group.add_argument("--descriptors", action='store_const', const=True, + group.add_argument("--descriptors", action='store_const', const=True, **kwargs, help="Run test using a descriptor wallet", dest='descriptors') if legacy: - group.add_argument("--legacy-wallet", action='store_const', const=False, + group.add_argument("--legacy-wallet", action='store_const', const=False, **kwargs, help="Run test using legacy wallets", dest='descriptors') def add_nodes(self, num_nodes: int, extra_args=None, *, rpchost=None, binary=None, binary_cli=None, versions=None): |