Skip to content

Commit c847dee

Browse files
committed
test: remove legacy wallet functional tests
Removes all legacy wallet specific functional tests. Also removes the --descriptor and --legacy-wallet options as these are no longer necessary with the legacy wallet removed.
1 parent 20a9173 commit c847dee

File tree

96 files changed

+394
-4674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+394
-4674
lines changed

test/functional/example_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ class ExampleTest(BitcoinTestFramework):
7979
# Override the set_test_params(), skip_test_if_missing_module(), add_options(), setup_chain(), setup_network()
8080
# and setup_nodes() methods to customize the test setup as required.
8181

82-
def add_options(self, parser):
83-
self.add_wallet_options(parser)
84-
8582
def set_test_params(self):
8683
"""Override test parameters for your individual test.
8784

test/functional/feature_bip68_sequence.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
NOT_FINAL_ERROR = "non-BIP68-final"
4646

4747
class BIP68Test(BitcoinTestFramework):
48-
def add_options(self, parser):
49-
self.add_wallet_options(parser)
50-
5148
def set_test_params(self):
5249
self.num_nodes = 2
5350
self.extra_args = [
@@ -58,6 +55,7 @@ def set_test_params(self):
5855
'-testactivationheight=csv@432',
5956
],
6057
]
58+
self.uses_wallet = None
6159

6260
def run_test(self):
6361
self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"]

test/functional/feature_config_args.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919

2020
class ConfArgsTest(BitcoinTestFramework):
21-
def add_options(self, parser):
22-
self.add_wallet_options(parser)
23-
2421
def set_test_params(self):
2522
self.setup_clean_chain = True
2623
self.num_nodes = 1
@@ -30,6 +27,7 @@ def set_test_params(self):
3027
self.supports_cli = False
3128
self.wallet_names = []
3229
self.disable_autoconnect = False
30+
self.uses_wallet = None
3331

3432
# Overridden to avoid attempt to sync not yet started nodes.
3533
def setup_network(self):

test/functional/feature_filelock.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
)
1414

1515
class FilelockTest(BitcoinTestFramework):
16-
def add_options(self, parser):
17-
self.add_wallet_options(parser)
18-
1916
def set_test_params(self):
2017
self.setup_clean_chain = True
2118
self.num_nodes = 2
19+
self.uses_wallet = None
2220

2321
def setup_network(self):
2422
self.add_nodes(self.num_nodes, extra_args=None)
@@ -46,20 +44,12 @@ def run_test(self):
4644
assert pid_file.exists()
4745

4846
if self.is_wallet_compiled():
49-
def check_wallet_filelock(descriptors):
50-
wallet_name = ''.join([random.choice(string.ascii_lowercase) for _ in range(6)])
51-
self.nodes[0].createwallet(wallet_name=wallet_name, descriptors=descriptors)
52-
wallet_dir = self.nodes[0].wallets_path
53-
self.log.info("Check that we can't start a second bitcoind instance using the same wallet")
54-
if descriptors:
55-
expected_msg = f"Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of {self.config['environment']['CLIENT_NAME']}?"
56-
else:
57-
expected_msg = "Error: Error initializing wallet database environment"
58-
self.nodes[1].assert_start_raises_init_error(extra_args=[f'-walletdir={wallet_dir}', f'-wallet={wallet_name}', '-noserver'], expected_msg=expected_msg, match=ErrorMatch.PARTIAL_REGEX)
59-
60-
if self.is_bdb_compiled():
61-
check_wallet_filelock(False)
62-
check_wallet_filelock(True)
47+
wallet_name = ''.join([random.choice(string.ascii_lowercase) for _ in range(6)])
48+
self.nodes[0].createwallet(wallet_name=wallet_name)
49+
wallet_dir = self.nodes[0].wallets_path
50+
self.log.info("Check that we can't start a second bitcoind instance using the same wallet")
51+
expected_msg = f"Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of {self.config['environment']['CLIENT_NAME']}?"
52+
self.nodes[1].assert_start_raises_init_error(extra_args=[f'-walletdir={wallet_dir}', f'-wallet={wallet_name}', '-noserver'], expected_msg=expected_msg, match=ErrorMatch.PARTIAL_REGEX)
6353

6454
if __name__ == '__main__':
6555
FilelockTest(__file__).main()

test/functional/feature_init.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ class InitTest(BitcoinTestFramework):
2424
subsequent starts.
2525
"""
2626

27-
def add_options(self, parser):
28-
self.add_wallet_options(parser)
29-
3027
def set_test_params(self):
3128
self.setup_clean_chain = False
3229
self.num_nodes = 1
30+
self.uses_wallet = None
3331

3432
def init_stress_test(self):
3533
"""

test/functional/feature_notifications.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ def notify_outputname(walletname, txid):
2525

2626

2727
class NotificationsTest(BitcoinTestFramework):
28-
def add_options(self, parser):
29-
self.add_wallet_options(parser)
30-
3128
def set_test_params(self):
3229
self.num_nodes = 2
3330
self.setup_clean_chain = True
31+
self.uses_wallet = None
3432

3533
def setup_network(self):
3634
self.wallet = ''.join(chr(i) for i in range(FILE_CHAR_START, FILE_CHAR_END) if chr(i) not in FILE_CHARS_DISALLOWED)
@@ -58,7 +56,6 @@ def setup_network(self):
5856
def run_test(self):
5957
if self.is_wallet_compiled():
6058
# Setup the descriptors to be imported to the wallet
61-
seed = "cTdGmKFWpbvpKQ7ejrdzqYT2hhjyb3GPHnLAK7wdi5Em67YLwSm9"
6259
xpriv = "tprv8ZgxMBicQKsPfHCsTwkiM1KT56RXbGGTqvc2hgqzycpwbHqqpcajQeMRZoBD35kW4RtyCemu6j34Ku5DEspmgjKdt2qe4SvRch5Kk8B8A2v"
6360
desc_imports = [{
6461
"desc": descsum_create(f"wpkh({xpriv}/0/*)"),
@@ -75,11 +72,8 @@ def run_test(self):
7572
# Make the wallets and import the descriptors
7673
# Ensures that node 0 and node 1 share the same wallet for the conflicting transaction tests below.
7774
for i, name in enumerate(self.wallet_names):
78-
self.nodes[i].createwallet(wallet_name=name, descriptors=self.options.descriptors, blank=True, load_on_startup=True)
79-
if self.options.descriptors:
80-
self.nodes[i].importdescriptors(desc_imports)
81-
else:
82-
self.nodes[i].sethdseed(True, seed)
75+
self.nodes[i].createwallet(wallet_name=name, blank=True, load_on_startup=True)
76+
self.nodes[i].importdescriptors(desc_imports)
8377

8478
self.log.info("test -blocknotify")
8579
block_count = 10

test/functional/feature_pruning.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,11 @@ def calc_usage(blockdir):
6666
return sum(os.path.getsize(blockdir + f) for f in os.listdir(blockdir) if os.path.isfile(os.path.join(blockdir, f))) / (1024. * 1024.)
6767

6868
class PruneTest(BitcoinTestFramework):
69-
def add_options(self, parser):
70-
self.add_wallet_options(parser)
71-
7269
def set_test_params(self):
7370
self.setup_clean_chain = True
7471
self.num_nodes = 6
7572
self.supports_cli = False
73+
self.uses_wallet = None
7674

7775
# Create nodes 0 and 1 to mine.
7876
# Create node 2 to test pruning.

test/functional/feature_rbf.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020

2121
MAX_REPLACEMENT_LIMIT = 100
2222
class ReplaceByFeeTest(BitcoinTestFramework):
23-
def add_options(self, parser):
24-
self.add_wallet_options(parser)
25-
2623
def set_test_params(self):
2724
self.num_nodes = 2
2825
self.extra_args = [
@@ -37,6 +34,7 @@ def set_test_params(self):
3734
],
3835
]
3936
self.supports_cli = False
37+
self.uses_wallet = None
4038

4139
def run_test(self):
4240
self.wallet = MiniWallet(self.nodes[0])
@@ -567,7 +565,7 @@ def test_rpc(self):
567565
assert_equal(json0["vin"][0]["sequence"], 4294967293)
568566
assert_equal(json1["vin"][0]["sequence"], 4294967295)
569567

570-
if self.is_specified_wallet_compiled():
568+
if self.is_wallet_compiled():
571569
self.init_wallet(node=0)
572570
rawtx2 = self.nodes[0].createrawtransaction([], outs)
573571
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})

0 commit comments

Comments
 (0)