mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
test: Remove wallet option from non-wallet tests
Review note: The changes are complete, because self.options.descriptors is set to None in parse_args (test_framework.py). A value of None implies -disablewallet, see the previous commit. So if a call to add_wallet_options is missing, it will lead to a test failure when the wallet is compiled in.
This commit is contained in:
parent
fac8d59d31
commit
555519d082
80 changed files with 244 additions and 8 deletions
|
@ -79,6 +79,9 @@ class ExampleTest(BitcoinTestFramework):
|
||||||
# Override the set_test_params(), skip_test_if_missing_module(), add_options(), setup_chain(), setup_network()
|
# Override the set_test_params(), skip_test_if_missing_module(), add_options(), setup_chain(), setup_network()
|
||||||
# and setup_nodes() methods to customize the test setup as required.
|
# and setup_nodes() methods to customize the test setup as required.
|
||||||
|
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
"""Override test parameters for your individual test.
|
"""Override test parameters for your individual test.
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class BackwardsCompatibilityTest(BitcoinTestFramework):
|
class BackwardsCompatibilityTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 10
|
self.num_nodes = 10
|
||||||
|
|
|
@ -44,6 +44,9 @@ SEQUENCE_LOCKTIME_MASK = 0x0000ffff
|
||||||
NOT_FINAL_ERROR = "non-BIP68-final"
|
NOT_FINAL_ERROR = "non-BIP68-final"
|
||||||
|
|
||||||
class BIP68Test(BitcoinTestFramework):
|
class BIP68Test(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
|
|
|
@ -12,6 +12,9 @@ from test_framework import util
|
||||||
|
|
||||||
|
|
||||||
class ConfArgsTest(BitcoinTestFramework):
|
class ConfArgsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -11,6 +11,9 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.test_node import ErrorMatch
|
from test_framework.test_node import ErrorMatch
|
||||||
|
|
||||||
class FilelockTest(BitcoinTestFramework):
|
class FilelockTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -17,6 +17,9 @@ class InitStressTest(BitcoinTestFramework):
|
||||||
subsequent starts.
|
subsequent starts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = False
|
self.setup_clean_chain = False
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -24,6 +24,9 @@ def notify_outputname(walletname, txid):
|
||||||
|
|
||||||
|
|
||||||
class NotificationsTest(BitcoinTestFramework):
|
class NotificationsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -76,6 +76,9 @@ def calc_usage(blockdir):
|
||||||
return sum(os.path.getsize(blockdir + f) for f in os.listdir(blockdir) if os.path.isfile(os.path.join(blockdir, f))) / (1024. * 1024.)
|
return sum(os.path.getsize(blockdir + f) for f in os.listdir(blockdir) if os.path.isfile(os.path.join(blockdir, f))) / (1024. * 1024.)
|
||||||
|
|
||||||
class PruneTest(BitcoinTestFramework):
|
class PruneTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 6
|
self.num_nodes = 6
|
||||||
|
|
|
@ -21,6 +21,9 @@ from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
||||||
|
|
||||||
MAX_REPLACEMENT_LIMIT = 100
|
MAX_REPLACEMENT_LIMIT = 100
|
||||||
class ReplaceByFeeTest(BitcoinTestFramework):
|
class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
|
|
|
@ -78,6 +78,9 @@ txs_mined = {} # txindex from txid to blockhash
|
||||||
|
|
||||||
|
|
||||||
class SegWitTest(BitcoinTestFramework):
|
class SegWitTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
|
|
|
@ -1229,6 +1229,7 @@ UTXOData = namedtuple('UTXOData', 'outpoint,output,spender')
|
||||||
|
|
||||||
class TaprootTest(BitcoinTestFramework):
|
class TaprootTest(BitcoinTestFramework):
|
||||||
def add_options(self, parser):
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
parser.add_argument("--dumptests", dest="dump_tests", default=False, action="store_true",
|
parser.add_argument("--dumptests", dest="dump_tests", default=False, action="store_true",
|
||||||
help="Dump generated test cases to directory set by TEST_DUMP_DIR environment variable")
|
help="Dump generated test cases to directory set by TEST_DUMP_DIR environment variable")
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,9 @@ def cli_get_info_string_to_dict(cli_get_info_string):
|
||||||
|
|
||||||
|
|
||||||
class TestBitcoinCli(BitcoinTestFramework):
|
class TestBitcoinCli(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -97,6 +97,9 @@ int trace_aps_create_tx(struct pt_regs *ctx) {
|
||||||
|
|
||||||
|
|
||||||
class CoinSelectionTracepointTest(BitcoinTestFramework):
|
class CoinSelectionTracepointTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -21,6 +21,9 @@ from test_framework.wallet import (
|
||||||
|
|
||||||
|
|
||||||
class MempoolCompatibilityTest(BitcoinTestFramework):
|
class MempoolCompatibilityTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.wallet_names = [None]
|
self.wallet_names = [None]
|
||||||
|
|
|
@ -28,6 +28,9 @@ assert CUSTOM_DESCENDANT_LIMIT >= CUSTOM_ANCESTOR_LIMIT
|
||||||
|
|
||||||
|
|
||||||
class MempoolPackagesTest(BitcoinTestFramework):
|
class MempoolPackagesTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
|
|
|
@ -50,6 +50,9 @@ from test_framework.wallet import MiniWallet
|
||||||
|
|
||||||
|
|
||||||
class MempoolPersistTest(BitcoinTestFramework):
|
class MempoolPersistTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
self.extra_args = [[], ["-persistmempool=0"], []]
|
self.extra_args = [[], ["-persistmempool=0"], []]
|
||||||
|
|
|
@ -15,6 +15,9 @@ from test_framework.wallet import MiniWallet
|
||||||
MAX_INITIAL_BROADCAST_DELAY = 15 * 60 # 15 minutes in seconds
|
MAX_INITIAL_BROADCAST_DELAY = 15 * 60 # 15 minutes in seconds
|
||||||
|
|
||||||
class MempoolUnbroadcastTest(BitcoinTestFramework):
|
class MempoolUnbroadcastTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,9 @@ from test_framework.wallet import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class RpcCreateMultiSigTest(BitcoinTestFramework):
|
class RpcCreateMultiSigTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
|
|
|
@ -35,6 +35,9 @@ def get_unspent(listunspent, amount):
|
||||||
raise AssertionError('Could not find unspent with amount={}'.format(amount))
|
raise AssertionError('Could not find unspent with amount={}'.format(amount))
|
||||||
|
|
||||||
class RawTransactionsTest(BitcoinTestFramework):
|
class RawTransactionsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 4
|
self.num_nodes = 4
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -43,6 +43,9 @@ def process_mapping(fname):
|
||||||
|
|
||||||
|
|
||||||
class HelpRpcTest(BitcoinTestFramework):
|
class HelpRpcTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
|
@ -39,6 +39,9 @@ INVALID_ADDRESS = 'asfah14i8fajz0123f'
|
||||||
INVALID_ADDRESS_2 = '1q049ldschfnwystcqnsvyfpj23mpsg3jcedq9xv'
|
INVALID_ADDRESS_2 = '1q049ldschfnwystcqnsvyfpj23mpsg3jcedq9xv'
|
||||||
|
|
||||||
class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -47,8 +47,9 @@ import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
# Create one-input, one-output, no-fee transaction:
|
|
||||||
class PSBTTest(BitcoinTestFramework):
|
class PSBTTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
|
|
|
@ -54,6 +54,9 @@ class multidict(dict):
|
||||||
|
|
||||||
|
|
||||||
class RawTransactionsTest(BitcoinTestFramework):
|
class RawTransactionsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
|
|
|
@ -194,12 +194,6 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||||
help="set a random seed for deterministically reproducing a previous test run")
|
help="set a random seed for deterministically reproducing a previous test run")
|
||||||
parser.add_argument('--timeout-factor', dest="timeout_factor", type=float, default=1.0, help='adjust test timeouts by a factor. Setting it to 0 disables all timeouts')
|
parser.add_argument('--timeout-factor', dest="timeout_factor", type=float, default=1.0, help='adjust test timeouts by a factor. Setting it to 0 disables all timeouts')
|
||||||
|
|
||||||
group = parser.add_mutually_exclusive_group()
|
|
||||||
group.add_argument("--descriptors", action='store_const', const=True,
|
|
||||||
help="Run test using a descriptor wallet", dest='descriptors')
|
|
||||||
group.add_argument("--legacy-wallet", action='store_const', const=False,
|
|
||||||
help="Run test using legacy wallets", dest='descriptors')
|
|
||||||
|
|
||||||
self.add_options(parser)
|
self.add_options(parser)
|
||||||
# Running TestShell in a Jupyter notebook causes an additional -f argument
|
# Running TestShell in a Jupyter notebook causes an additional -f argument
|
||||||
# To keep TestShell from failing with an "unrecognized argument" error, we add a dummy "-f" argument
|
# To keep TestShell from failing with an "unrecognized argument" error, we add a dummy "-f" argument
|
||||||
|
@ -212,7 +206,13 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||||
config.read_file(open(self.options.configfile))
|
config.read_file(open(self.options.configfile))
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
if self.options.descriptors is None:
|
if "descriptors" not in self.options:
|
||||||
|
# Wallet is not required by the test at all and the value of self.options.descriptors won't matter.
|
||||||
|
# It still needs to exist and be None in order for tests to work however.
|
||||||
|
# So set it to None to force -disablewallet, because the wallet is not needed.
|
||||||
|
self.options.descriptors = None
|
||||||
|
elif self.options.descriptors is None:
|
||||||
|
# Some wallet is either required or optionally used by the test.
|
||||||
# Prefer BDB unless it isn't available
|
# Prefer BDB unless it isn't available
|
||||||
if self.is_bdb_compiled():
|
if self.is_bdb_compiled():
|
||||||
self.options.descriptors = False
|
self.options.descriptors = False
|
||||||
|
@ -221,6 +221,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||||
else:
|
else:
|
||||||
# If neither are compiled, tests requiring a wallet will be skipped and the value of self.options.descriptors won't matter
|
# If neither are compiled, tests requiring a wallet will be skipped and the value of self.options.descriptors won't matter
|
||||||
# It still needs to exist and be None in order for tests to work however.
|
# It still needs to exist and be None in order for tests to work however.
|
||||||
|
# So set it to None, which will also set -disablewallet.
|
||||||
self.options.descriptors = None
|
self.options.descriptors = None
|
||||||
|
|
||||||
PortSeed.n = self.options.port_seed
|
PortSeed.n = self.options.port_seed
|
||||||
|
@ -446,6 +447,15 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||||
|
|
||||||
# Public helper methods. These can be accessed by the subclass test scripts.
|
# 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()
|
||||||
|
if descriptors:
|
||||||
|
group.add_argument("--descriptors", action='store_const', const=True,
|
||||||
|
help="Run test using a descriptor wallet", dest='descriptors')
|
||||||
|
if legacy:
|
||||||
|
group.add_argument("--legacy-wallet", action='store_const', const=False,
|
||||||
|
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):
|
def add_nodes(self, num_nodes: int, extra_args=None, *, rpchost=None, binary=None, binary_cli=None, versions=None):
|
||||||
"""Instantiate TestNode objects.
|
"""Instantiate TestNode objects.
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@ CHALLENGE_PRIVATE_KEY = (42).to_bytes(32, 'big')
|
||||||
|
|
||||||
|
|
||||||
class SignetMinerTest(BitcoinTestFramework):
|
class SignetMinerTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.chain = "signet"
|
self.chain = "signet"
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -19,6 +19,9 @@ BUFFER_SIZE = 16 * 1024
|
||||||
|
|
||||||
|
|
||||||
class ToolWalletTest(BitcoinTestFramework):
|
class ToolWalletTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -21,6 +21,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class AbandonConflictTest(BitcoinTestFramework):
|
class AbandonConflictTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [["-minrelaytxfee=0.00001"], []]
|
self.extra_args = [["-minrelaytxfee=0.00001"], []]
|
||||||
|
|
|
@ -66,6 +66,9 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class AddressTypeTest(BitcoinTestFramework):
|
class AddressTypeTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 6
|
self.num_nodes = 6
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
|
|
|
@ -106,6 +106,9 @@ def generate_payment_values(n, m):
|
||||||
|
|
||||||
|
|
||||||
class AddressInputTypeGrouping(BitcoinTestFramework):
|
class AddressInputTypeGrouping(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -63,6 +63,8 @@ def assert_balances(node, mine, margin=0.001):
|
||||||
assert_approx(got[k], v, margin)
|
assert_approx(got[k], v, margin)
|
||||||
|
|
||||||
class AvoidReuseTest(BitcoinTestFramework):
|
class AvoidReuseTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -44,6 +44,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletBackupTest(BitcoinTestFramework):
|
class WalletBackupTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 4
|
self.num_nodes = 4
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -46,6 +46,9 @@ def create_transactions(node, address, amt, fees):
|
||||||
return txs
|
return txs
|
||||||
|
|
||||||
class WalletTest(BitcoinTestFramework):
|
class WalletTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -23,6 +23,9 @@ OUT_OF_RANGE = "Amount out of range"
|
||||||
|
|
||||||
|
|
||||||
class WalletTest(BitcoinTestFramework):
|
class WalletTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 4
|
self.num_nodes = 4
|
||||||
self.extra_args = [[
|
self.extra_args = [[
|
||||||
|
|
|
@ -46,6 +46,9 @@ TOO_HIGH = 100000
|
||||||
|
|
||||||
|
|
||||||
class BumpFeeTest(BitcoinTestFramework):
|
class BumpFeeTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -13,6 +13,9 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class CoinbaseCategoryTest(BitcoinTestFramework):
|
class CoinbaseCategoryTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -14,6 +14,9 @@ from test_framework.blocktools import (
|
||||||
|
|
||||||
|
|
||||||
class CreateTxWalletTest(BitcoinTestFramework):
|
class CreateTxWalletTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -16,6 +16,9 @@ from test_framework.util import (
|
||||||
from test_framework.wallet_util import bytes_to_wif, generate_wif_key
|
from test_framework.wallet_util import bytes_to_wif, generate_wif_key
|
||||||
|
|
||||||
class CreateWalletTest(BitcoinTestFramework):
|
class CreateWalletTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import assert_raises_rpc_error
|
from test_framework.util import assert_raises_rpc_error
|
||||||
|
|
||||||
class WalletCrossChain(BitcoinTestFramework):
|
class WalletCrossChain(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -13,6 +13,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletDescriptorTest(BitcoinTestFramework):
|
class WalletDescriptorTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -93,6 +93,9 @@ def read_dump(file_name, addrs, script_addrs, hd_master_addr_old):
|
||||||
|
|
||||||
|
|
||||||
class WalletDumpTest(BitcoinTestFramework):
|
class WalletDumpTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.extra_args = [["-keypool=90", "-addresstype=legacy"]]
|
self.extra_args = [["-keypool=90", "-addresstype=legacy"]]
|
||||||
|
|
|
@ -14,6 +14,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletEncryptionTest(BitcoinTestFramework):
|
class WalletEncryptionTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -9,6 +9,9 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import assert_raises_rpc_error
|
from test_framework.util import assert_raises_rpc_error
|
||||||
|
|
||||||
class WalletRBFTest(BitcoinTestFramework):
|
class WalletRBFTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -21,6 +21,9 @@ NUM_BLOCKS = 6 # number of blocks to mine
|
||||||
|
|
||||||
|
|
||||||
class WalletFastRescanTest(BitcoinTestFramework):
|
class WalletFastRescanTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.extra_args = [[f'-keypool={KEYPOOL_SIZE}', '-blockfilterindex=1']]
|
self.extra_args = [[f'-keypool={KEYPOOL_SIZE}', '-blockfilterindex=1']]
|
||||||
|
|
|
@ -16,6 +16,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletGroupTest(BitcoinTestFramework):
|
class WalletGroupTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 5
|
self.num_nodes = 5
|
||||||
|
|
|
@ -16,6 +16,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletHDTest(BitcoinTestFramework):
|
class WalletHDTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -39,6 +39,9 @@ def check_implicit_transactions(implicit_keys, implicit_node):
|
||||||
assert(('receive', b_address) in tuple((tx['category'], tx['address']) for tx in txs))
|
assert(('receive', b_address) in tuple((tx['category'], tx['address']) for tx in txs))
|
||||||
|
|
||||||
class ImplicitSegwitTest(BitcoinTestFramework):
|
class ImplicitSegwitTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
|
@ -147,6 +147,9 @@ def get_rand_amount():
|
||||||
|
|
||||||
|
|
||||||
class ImportRescanTest(BitcoinTestFramework):
|
class ImportRescanTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2 + len(IMPORT_NODES)
|
self.num_nodes = 2 + len(IMPORT_NODES)
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
|
@ -15,6 +15,9 @@ from test_framework.wallet_util import test_address
|
||||||
|
|
||||||
|
|
||||||
class ImportWithLabel(BitcoinTestFramework):
|
class ImportWithLabel(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -30,6 +30,9 @@ from test_framework.wallet_util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class ImportDescriptorsTest(BitcoinTestFramework):
|
class ImportDescriptorsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [["-addresstype=legacy"],
|
self.extra_args = [["-addresstype=legacy"],
|
||||||
|
|
|
@ -35,6 +35,9 @@ from test_framework.wallet_util import (
|
||||||
|
|
||||||
|
|
||||||
class ImportMultiTest(BitcoinTestFramework):
|
class ImportMultiTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [["-addresstype=legacy"], ["-addresstype=legacy"]]
|
self.extra_args = [["-addresstype=legacy"], ["-addresstype=legacy"]]
|
||||||
|
|
|
@ -21,6 +21,9 @@ from test_framework.wallet_util import bytes_to_wif
|
||||||
|
|
||||||
|
|
||||||
class ImportPrunedFundsTest(BitcoinTestFramework):
|
class ImportPrunedFundsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -17,6 +17,9 @@ from test_framework.wallet_util import (
|
||||||
|
|
||||||
|
|
||||||
class InactiveHDChainsTest(BitcoinTestFramework):
|
class InactiveHDChainsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -11,6 +11,9 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import assert_equal, assert_raises_rpc_error
|
from test_framework.util import assert_equal, assert_raises_rpc_error
|
||||||
|
|
||||||
class KeyPoolTest(BitcoinTestFramework):
|
class KeyPoolTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class KeypoolRestoreTest(BitcoinTestFramework):
|
class KeypoolRestoreTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 4
|
self.num_nodes = 4
|
||||||
|
|
|
@ -18,6 +18,9 @@ from test_framework.wallet_util import test_address
|
||||||
|
|
||||||
|
|
||||||
class WalletLabelsTest(BitcoinTestFramework):
|
class WalletLabelsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -15,6 +15,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class ListDescriptorsTest(BitcoinTestFramework):
|
class ListDescriptorsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,9 @@ from test_framework.wallet_util import test_address
|
||||||
|
|
||||||
|
|
||||||
class ReceivedByTest(BitcoinTestFramework):
|
class ReceivedByTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
# whitelist peers to speed up tx relay / mempool sync
|
# whitelist peers to speed up tx relay / mempool sync
|
||||||
|
|
|
@ -20,6 +20,9 @@ from test_framework.wallet_util import bytes_to_wif
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
class ListSinceBlockTest(BitcoinTestFramework):
|
class ListSinceBlockTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 4
|
self.num_nodes = 4
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -21,6 +21,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class ListTransactionsTest(BitcoinTestFramework):
|
class ListTransactionsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
# This test isn't testing txn relay/timing, so set whitelist on the
|
# This test isn't testing txn relay/timing, so set whitelist on the
|
||||||
|
|
|
@ -19,6 +19,9 @@ from test_framework.wallet_util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletMigrationTest(BitcoinTestFramework):
|
class WalletMigrationTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -22,6 +22,9 @@ MINISCRIPTS = [
|
||||||
|
|
||||||
|
|
||||||
class WalletMiniscriptTest(BitcoinTestFramework):
|
class WalletMiniscriptTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletMultisigDescriptorPSBTTest(BitcoinTestFramework):
|
class WalletMultisigDescriptorPSBTTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -52,6 +52,7 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
||||||
def add_options(self, parser):
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--data_wallets_dir',
|
'--data_wallets_dir',
|
||||||
default=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data/wallets/'),
|
default=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data/wallets/'),
|
||||||
|
|
|
@ -8,6 +8,9 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import assert_equal
|
from test_framework.util import assert_equal
|
||||||
|
|
||||||
class OrphanedBlockRewardTest(BitcoinTestFramework):
|
class OrphanedBlockRewardTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -23,6 +23,9 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class ReorgsRestoreTest(BitcoinTestFramework):
|
class ReorgsRestoreTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class ResendWalletTransactionsTest(BitcoinTestFramework):
|
class ResendWalletTransactionsTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,9 @@ from test_framework.util import (
|
||||||
from test_framework.wallet_util import bytes_to_wif
|
from test_framework.wallet_util import bytes_to_wif
|
||||||
|
|
||||||
class WalletSendTest(BitcoinTestFramework):
|
class WalletSendTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
# whitelist all peers to speed up tx relay / mempool sync
|
# whitelist all peers to speed up tx relay / mempool sync
|
||||||
|
|
|
@ -26,6 +26,9 @@ def cleanup(func):
|
||||||
|
|
||||||
class SendallTest(BitcoinTestFramework):
|
class SendallTest(BitcoinTestFramework):
|
||||||
# Setup and helpers
|
# Setup and helpers
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletSignerTest(BitcoinTestFramework):
|
class WalletSignerTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def mock_signer_path(self):
|
def mock_signer_path(self):
|
||||||
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'signer.py')
|
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'signer.py')
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
|
|
|
@ -10,6 +10,9 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class SignMessagesWithAddressTest(BitcoinTestFramework):
|
class SignMessagesWithAddressTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -34,6 +34,9 @@ from decimal import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class SignRawTransactionWithWalletTest(BitcoinTestFramework):
|
class SignRawTransactionWithWalletTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
|
|
@ -15,6 +15,9 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
|
|
||||||
class SimulateTxTest(BitcoinTestFramework):
|
class SimulateTxTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -13,6 +13,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class WalletStartupTest(BitcoinTestFramework):
|
class WalletStartupTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -187,6 +187,9 @@ def compute_raw_taproot_address(pubkey):
|
||||||
class WalletTaprootTest(BitcoinTestFramework):
|
class WalletTaprootTest(BitcoinTestFramework):
|
||||||
"""Test generation and spending of P2TR address outputs."""
|
"""Test generation and spending of P2TR address outputs."""
|
||||||
|
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, legacy=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
|
|
|
@ -8,6 +8,9 @@ from test_framework.util import assert_equal
|
||||||
|
|
||||||
|
|
||||||
class WalletLocktimeTest(BitcoinTestFramework):
|
class WalletLocktimeTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class TransactionTimeRescanTest(BitcoinTestFramework):
|
class TransactionTimeRescanTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = False
|
self.setup_clean_chain = False
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
|
|
|
@ -24,6 +24,7 @@ class TxnMallTest(BitcoinTestFramework):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
||||||
def add_options(self, parser):
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
parser.add_argument("--mineblock", dest="mine_block", default=False, action="store_true",
|
parser.add_argument("--mineblock", dest="mine_block", default=False, action="store_true",
|
||||||
help="Test double-spend of 1-confirmed transaction")
|
help="Test double-spend of 1-confirmed transaction")
|
||||||
parser.add_argument("--segwit", dest="segwit", default=False, action="store_true",
|
parser.add_argument("--segwit", dest="segwit", default=False, action="store_true",
|
||||||
|
|
|
@ -22,6 +22,7 @@ class TxnMallTest(BitcoinTestFramework):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
||||||
def add_options(self, parser):
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
parser.add_argument("--mineblock", dest="mine_block", default=False, action="store_true",
|
parser.add_argument("--mineblock", dest="mine_block", default=False, action="store_true",
|
||||||
help="Test double-spend of 1-confirmed transaction")
|
help="Test double-spend of 1-confirmed transaction")
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,9 @@ def deser_keymeta(f):
|
||||||
return ver, create_time, kp_str, seed_id, fpr, path_len, path, has_key_orig
|
return ver, create_time, kp_str, seed_id, fpr, path_len, path, has_key_orig
|
||||||
|
|
||||||
class UpgradeWalletTest(BitcoinTestFramework):
|
class UpgradeWalletTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser, descriptors=False)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
|
|
|
@ -14,6 +14,9 @@ from test_framework.util import (
|
||||||
|
|
||||||
|
|
||||||
class CreateWalletWatchonlyTest(BitcoinTestFramework):
|
class CreateWalletWatchonlyTest(BitcoinTestFramework):
|
||||||
|
def add_options(self, parser):
|
||||||
|
self.add_wallet_options(parser)
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue