Browse Source
0.16048e0c3e2
[rpc] [tests] Add deprecated RPC test (Cristian Mircea Messel)d4cdbd6fb
[rpc] Deprecate estimatefee RPC (John Newbery) Pull request description: Deprecates estimatefee in v0.16, for final removal in v0.17. This commit introduces a phased removal of RPC methods. RPC method is disabled by default in version x, but can be enabled by using the `-deprecatedrpc=<methodname>` argument. RPC method is removed entirely in version (x+1). This gives users fair warning that an RPC is to be removed, and time to change client software if necessary. Deprecation warnings in RPC return values or release notes are easily ignored. This is a more generic version of the approach I tried to use in #10841, which too late to make it into v0.15. Tree-SHA512: 9695a600e84b812974387333e4a6805d18972da30befb754e9e4da77cd9815d00c5cc2ee0b0350bdbbdb5fdc6ba47789f8b2c6f5b15c8cd5a1deefcc4832da30
MarcoFalke
7 years ago
8 changed files with 42 additions and 1 deletions
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3 |
||||
# Copyright (c) 2017 The Bitcoin Core developers |
||||
# Distributed under the MIT software license, see the accompanying |
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
||||
"""Test deprecation of RPC calls.""" |
||||
from test_framework.test_framework import BitcoinTestFramework |
||||
from test_framework.util import assert_raises_jsonrpc |
||||
|
||||
class DeprecatedRpcTest(BitcoinTestFramework): |
||||
def set_test_params(self): |
||||
self.num_nodes = 2 |
||||
self.setup_clean_chain = True |
||||
self.extra_args = [[], ["-deprecatedrpc=estimatefee"]] |
||||
|
||||
def run_test(self): |
||||
self.log.info("estimatefee: Shows deprecated message") |
||||
assert_raises_jsonrpc(-32, 'estimatefee is deprecated', self.nodes[0].estimatefee, 1) |
||||
|
||||
self.log.info("Using -deprecatedrpc=estimatefee bypasses the error") |
||||
self.nodes[1].estimatefee(1) |
||||
|
||||
if __name__ == '__main__': |
||||
DeprecatedRpcTest().main() |
Loading…
Reference in new issue