scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc error
[bitcoinplatinum.git] / test / functional / deprecated_rpc.py
blob19fd24edb925d313bd3213dbd8ba4c3ca5aceb5a
1 #!/usr/bin/env python3
2 # Copyright (c) 2017 The Bitcoin Core developers
3 # Distributed under the MIT software license, see the accompanying
4 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 """Test deprecation of RPC calls."""
6 from test_framework.test_framework import BitcoinTestFramework
7 from test_framework.util import assert_raises_rpc_error
9 class DeprecatedRpcTest(BitcoinTestFramework):
10 def set_test_params(self):
11 self.num_nodes = 2
12 self.setup_clean_chain = True
13 self.extra_args = [[], ["-deprecatedrpc=estimatefee"]]
15 def run_test(self):
16 self.log.info("estimatefee: Shows deprecated message")
17 assert_raises_rpc_error(-32, 'estimatefee is deprecated', self.nodes[0].estimatefee, 1)
19 self.log.info("Using -deprecatedrpc=estimatefee bypasses the error")
20 self.nodes[1].estimatefee(1)
22 if __name__ == '__main__':
23 DeprecatedRpcTest().main()