Skip to content

Commit 048e0c3

Browse files
mess110jnewbery
authored andcommitted
[rpc] [tests] Add deprecated RPC test
1 parent d4cdbd6 commit 048e0c3

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

test/functional/deprecated_rpc.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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_jsonrpc
8+
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"]]
14+
15+
def run_test(self):
16+
self.log.info("estimatefee: Shows deprecated message")
17+
assert_raises_jsonrpc(-32, 'estimatefee is deprecated', self.nodes[0].estimatefee, 1)
18+
19+
self.log.info("Using -deprecatedrpc=estimatefee bypasses the error")
20+
self.nodes[1].estimatefee(1)
21+
22+
if __name__ == '__main__':
23+
DeprecatedRpcTest().main()

test/functional/test_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
'disconnect_ban.py',
9999
'decodescript.py',
100100
'blockchain.py',
101+
'deprecated_rpc.py',
101102
'disablewallet.py',
102103
'net.py',
103104
'keypool.py',

0 commit comments

Comments
 (0)