Skip to content

Commit 51a20e5

Browse files
committed
Merge bitcoin/bitcoin#31977: test: Use rpc_deprecated only for testing deprecation
2819c51 test: Use rpc_deprecated only for testing deprecation (Fabian Jahr) Pull request description: The comment in `functional/rpc_deprecated.py` says "This test should be used to verify correct behaviour of deprecated RPC methods with and without the -deprecatedrpc flags." I think we can get rid of the "with" part since we can assume that every deprecated RPC is already tested in at least one other functional test. (I didn't look but I could verify in our coverage if someone has doubts about that.) In order for this test to continue working, the flag will need to be used there. Otherwise this seems to prescribe copy+pasting a basic test from another file and I don't see a good reason for that. ACKs for top commit: maflcko: lgtm ACK 2819c51 janb84: re ACK [2819c51](bitcoin/bitcoin@2819c51) polespinasa: reACK 2819c51 Tree-SHA512: 96edfd07be863ad19f99feb27afbc2c3ad53560c93c93eac8de8d766ad8c46e5aa02fd013fec99af794cbe9adca8e459d5b80b454caea7e67b2388003e010bb6
2 parents 698f869 + 2819c51 commit 51a20e5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/functional/rpc_deprecated.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2017-2021 The Bitcoin Core developers
2+
# Copyright (c) 2017-2025 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test deprecation of RPC calls."""
66
from test_framework.test_framework import BitcoinTestFramework
77

88
class DeprecatedRpcTest(BitcoinTestFramework):
99
def set_test_params(self):
10-
self.num_nodes = 2
10+
self.num_nodes = 1
1111
self.setup_clean_chain = True
12-
self.extra_args = [[], ['-deprecatedrpc=bumpfee']]
12+
self.extra_args = [[]]
1313

1414
def run_test(self):
15-
# This test should be used to verify correct behaviour of deprecated
16-
# RPC methods with and without the -deprecatedrpc flags. For example:
15+
# This test should be used to verify the errors of the currently
16+
# deprecated RPC methods (without the -deprecatedrpc flag) until
17+
# such RPCs are fully removed. For example:
1718
#
18-
# In set_test_params:
19-
# self.extra_args = [[], ["-deprecatedrpc=generate"]]
20-
#
21-
# In run_test:
2219
# self.log.info("Test generate RPC")
2320
# assert_raises_rpc_error(-32, 'The wallet generate rpc method is deprecated', self.nodes[0].rpc.generate, 1)
24-
# self.generate(self.nodes[1], 1)
21+
#
22+
# Please ensure that for all the RPC methods tested here, there is
23+
# at least one other functional test that still tests the RPCs
24+
# functionality using the respective -deprecatedrpc flag.
2525

26-
self.log.info("No tested deprecated RPC methods")
26+
self.log.info("Currently no tests for deprecated RPC methods")
2727

2828
if __name__ == '__main__':
2929
DeprecatedRpcTest(__file__).main()

0 commit comments

Comments
 (0)