Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1#!/usr/bin/env python32# Copyright (c) 2017-present The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or http://www.opensource.org/licenses/mit-license.php.5"""Test deprecation of RPC calls."""6from test_framework.test_framework import BitcoinTestFramework7from test_framework.util import assert_raises_rpc_error10class DeprecatedRpcTest(BitcoinTestFramework):11def set_test_params(self):12self.num_nodes = 113self.setup_clean_chain = True14self.extra_args = [[]]15self.uses_wallet = None17def run_test(self):18# This test should be used to verify the errors of the currently19# deprecated RPC methods (without the -deprecatedrpc flag) until20# such RPCs are fully removed. For example:21#22# self.log.info("Test generate RPC")23# assert_raises_rpc_error(-32, 'The wallet generate rpc method is deprecated', self.nodes[0].generate, 1)24#25# Please ensure that for all the RPC methods tested here, there is26# at least one other functional test that still tests the RPCs27# functionality using the respective -deprecatedrpc flag.29# Please don't delete nor modify this comment30self.log.info("Tests for deprecated RPC methods (if any)")31if self.is_wallet_compiled():32self.log.info("Tests for deprecated wallet-related RPC methods (if any)")33self.nodes[0].createwallet("ancient_wallet")34wallet = self.nodes[0].get_wallet_rpc("ancient_wallet")36self.log.info("Test removeprunedfunds deprecation")37assert_raises_rpc_error(38-32, "Start bitcoind with the `-deprecatedrpc=removeprunedfunds`",39wallet.removeprunedfunds,40"fakeargument"41)44if __name__ == '__main__':45DeprecatedRpcTest(__file__).main()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.