Skip to content

Commit 3db1ba0

Browse files
committed
[tests] Set -deprecatedrpc=accounts in tests
Future commits will deprecate the accounts RPC methods, arguments and return objects. Set the -deprecatedrpc=accounts switch now so tests don't break in intermediate commits.
1 parent 4e671f0 commit 3db1ba0

10 files changed

+15
-8
lines changed

test/functional/wallet_basic.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ class WalletTest(BitcoinTestFramework):
1010
def set_test_params(self):
1111
self.num_nodes = 4
1212
self.setup_clean_chain = True
13+
self.extra_args = [['-deprecatedrpc=accounts']] * 4
1314

1415
def setup_network(self):
15-
self.add_nodes(4)
16+
self.add_nodes(4, self.extra_args)
1617
self.start_node(0)
1718
self.start_node(1)
1819
self.start_node(2)
@@ -376,9 +377,9 @@ def run_test(self):
376377
self.log.info("check " + m)
377378
self.stop_nodes()
378379
# set lower ancestor limit for later
379-
self.start_node(0, [m, "-limitancestorcount="+str(chainlimit)])
380-
self.start_node(1, [m, "-limitancestorcount="+str(chainlimit)])
381-
self.start_node(2, [m, "-limitancestorcount="+str(chainlimit)])
380+
self.start_node(0, [m, "-deprecatedrpc=accounts", "-limitancestorcount="+str(chainlimit)])
381+
self.start_node(1, [m, "-deprecatedrpc=accounts", "-limitancestorcount="+str(chainlimit)])
382+
self.start_node(2, [m, "-deprecatedrpc=accounts", "-limitancestorcount="+str(chainlimit)])
382383
if m == '-reindex':
383384
# reindex will leave rpc warm up "early"; Wait for it to finish
384385
wait_until(lambda: [block_count] * 3 == [self.nodes[i].getblockcount() for i in range(3)])
@@ -426,7 +427,7 @@ def run_test(self):
426427
# Try with walletrejectlongchains
427428
# Double chain limit but require combining inputs, so we pass SelectCoinsMinConf
428429
self.stop_node(0)
429-
self.start_node(0, extra_args=["-walletrejectlongchains", "-limitancestorcount="+str(2*chainlimit)])
430+
self.start_node(0, extra_args=["-deprecatedrpc=accounts", "-walletrejectlongchains", "-limitancestorcount="+str(2*chainlimit)])
430431

431432
# wait for loadmempool
432433
timeout = 10

test/functional/wallet_import_rescan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def set_test_params(self):
119119
self.num_nodes = 2 + len(IMPORT_NODES)
120120

121121
def setup_network(self):
122-
extra_args = [["-addresstype=legacy"] for _ in range(self.num_nodes)]
122+
extra_args = [["-addresstype=legacy", '-deprecatedrpc=accounts'] for _ in range(self.num_nodes)]
123123
for i, import_node in enumerate(IMPORT_NODES, 2):
124124
if import_node.prune:
125125
extra_args[i] += ["-prune=1"]

test/functional/wallet_importprunedfunds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
1010
def set_test_params(self):
1111
self.setup_clean_chain = True
1212
self.num_nodes = 2
13+
self.extra_args = [['-deprecatedrpc=accounts']] * 2
1314

1415
def run_test(self):
1516
self.log.info("Mining blocks...")

test/functional/wallet_keypool_topup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class KeypoolRestoreTest(BitcoinTestFramework):
2525
def set_test_params(self):
2626
self.setup_clean_chain = True
2727
self.num_nodes = 2
28-
self.extra_args = [[], ['-keypool=100', '-keypoolmin=20']]
28+
self.extra_args = [['-deprecatedrpc=accounts'], ['-deprecatedrpc=accounts', '-keypool=100', '-keypoolmin=20']]
2929

3030
def run_test(self):
3131
wallet_path = os.path.join(self.nodes[1].datadir, "regtest", "wallets", "wallet.dat")

test/functional/wallet_labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class WalletLabelsTest(BitcoinTestFramework):
2121
def set_test_params(self):
2222
self.setup_clean_chain = True
2323
self.num_nodes = 1
24-
self.extra_args = [[]]
24+
self.extra_args = [['-deprecatedrpc=accounts']]
2525

2626
def run_test(self):
2727
node = self.nodes[0]

test/functional/wallet_listreceivedby.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
class ReceivedByTest(BitcoinTestFramework):
1515
def set_test_params(self):
1616
self.num_nodes = 2
17+
self.extra_args = [['-deprecatedrpc=accounts']] * 2
1718

1819
def run_test(self):
1920
# Generate block to get out of IBD

test/functional/wallet_listsinceblock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class ListSinceBlockTest (BitcoinTestFramework):
1111
def set_test_params(self):
1212
self.num_nodes = 4
1313
self.setup_clean_chain = True
14+
self.extra_args = [['-deprecatedrpc=accounts']] * 4
1415

1516
def run_test(self):
1617
self.nodes[2].generate(101)

test/functional/wallet_listtransactions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def txFromHex(hexstring):
1818
class ListTransactionsTest(BitcoinTestFramework):
1919
def set_test_params(self):
2020
self.num_nodes = 2
21+
self.extra_args = [['-deprecatedrpc=accounts']] * 2
2122
self.enable_mocktime()
2223

2324
def run_test(self):

test/functional/wallet_txn_clone.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
class TxnMallTest(BitcoinTestFramework):
1111
def set_test_params(self):
1212
self.num_nodes = 4
13+
self.extra_args = [['-deprecatedrpc=accounts']] * 4
1314

1415
def add_options(self, parser):
1516
parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true",

test/functional/wallet_txn_doublespend.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
class TxnMallTest(BitcoinTestFramework):
1111
def set_test_params(self):
1212
self.num_nodes = 4
13+
self.extra_args = [['-deprecatedrpc=accounts']] * 4
1314

1415
def add_options(self, parser):
1516
parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true",

0 commit comments

Comments
 (0)