aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/test_framework.py
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-11-15 10:05:02 +0100
committerMacroFake <falke.marco@gmail.com>2022-11-15 10:03:56 +0100
commitfa10f193b54650b3071bc7ee2d90fcfe40a16dc9 (patch)
tree7cd06fcf81b483fd6a8acf981080bf70dde1bb26 /test/functional/test_framework/test_framework.py
parent555519d082fbe5e047595f06d7f301e441bb7149 (diff)
downloadbitcoin-fa10f193b54650b3071bc7ee2d90fcfe40a16dc9.tar.xz
test: Set default in add_wallet_options if only one type can be chosen
Diffstat (limited to 'test/functional/test_framework/test_framework.py')
-rwxr-xr-xtest/functional/test_framework/test_framework.py8
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):