mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
test: Set default in add_wallet_options if only one type can be chosen
This commit is contained in:
parent
555519d082
commit
fa10f193b5
1 changed files with 6 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue