0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

Merge bitcoin/bitcoin#26600: test: Set wallet type in test_runner when only one type is allowed

fadb8696dd test: Set wallet type in test_runner when only one type is allowed (MarcoFalke)

Pull request description:

  Currently devs are free to set or not set the wallet type in the test_runner when only one type is allowed to be set.

  This is inconsistent and causes review comments such as:

  * https://github.com/bitcoin/bitcoin/pull/24865#discussion_r1009752111

ACKs for top commit:
  achow101:
    ACK fadb8696dd

Tree-SHA512: 1ca0946df07b5bf6778fea957d74393757781c324d554fec2f7d03bf1915033e644d9a4c3d77e0b24090ab593d7ed3cb3c9169666bc39fff423706fceaa1af80
This commit is contained in:
MarcoFalke 2022-11-30 10:22:48 +01:00
commit 3be21060d6
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
2 changed files with 10 additions and 6 deletions

View file

@ -448,11 +448,13 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
# Public helper methods. These can be accessed by the subclass test scripts.
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
group = parser.add_mutually_exclusive_group(
# If only one type is allowed, require it to be set in test_runner.py
required=os.getenv("REQUIRE_WALLET_TYPE_SET") == "1" and "default" in kwargs)
if descriptors:
group.add_argument("--descriptors", action='store_const', const=True, **kwargs,
help="Run test using a descriptor wallet", dest='descriptors')

View file

@ -27,6 +27,8 @@ import re
import logging
import unittest
os.environ["REQUIRE_WALLET_TYPE_SET"] = "1"
# Formatting. Default colors to empty strings.
DEFAULT, BOLD, GREEN, RED = ("", ""), ("", ""), ("", ""), ("", "")
try:
@ -159,7 +161,7 @@ BASE_SCRIPTS = [
'wallet_avoidreuse.py --descriptors',
'wallet_avoid_mixing_output_types.py --descriptors',
'mempool_reorg.py',
'mempool_persist.py',
'mempool_persist.py --descriptors',
'p2p_block_sync.py',
'wallet_multiwallet.py --legacy-wallet',
'wallet_multiwallet.py --descriptors',
@ -208,7 +210,7 @@ BASE_SCRIPTS = [
'wallet_keypool.py --legacy-wallet',
'wallet_keypool.py --descriptors',
'wallet_descriptor.py --descriptors',
'wallet_miniscript.py',
'wallet_miniscript.py --descriptors',
'feature_maxtipage.py',
'p2p_nobloomfilter_messages.py',
'p2p_filter.py',
@ -222,7 +224,7 @@ BASE_SCRIPTS = [
'feature_assumevalid.py',
'example_test.py',
'wallet_txn_doublespend.py --legacy-wallet',
'wallet_multisig_descriptor_psbt.py',
'wallet_multisig_descriptor_psbt.py --descriptors',
'wallet_txn_doublespend.py --descriptors',
'feature_backwards_compatibility.py --legacy-wallet',
'feature_backwards_compatibility.py --descriptors',
@ -294,8 +296,8 @@ BASE_SCRIPTS = [
'wallet_sendall.py --legacy-wallet',
'wallet_sendall.py --descriptors',
'wallet_create_tx.py --descriptors',
'wallet_taproot.py',
'wallet_inactive_hdchains.py',
'wallet_taproot.py --descriptors',
'wallet_inactive_hdchains.py --legacy-wallet',
'p2p_fingerprint.py',
'feature_uacomment.py',
'feature_init.py',