aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2016-09-21 21:01:42 +0200
committerMarcoFalke <falke.marco@gmail.com>2016-09-21 21:19:20 +0200
commitddddaafa4aca2725a18606a38c3341a8637b0c3b (patch)
tree82e2ab4b32c6e1ca1d059cacf64ebb975f623e7d
parentcf5ebaa921a939cc3a81948a559c1f1ab53d68b6 (diff)
downloadbitcoin-ddddaafa4aca2725a18606a38c3341a8637b0c3b.tar.xz
[rpc] Deprecate getinfo
This was replaced by getmininginfo, getnetworkinfo and getwalletinfo
-rwxr-xr-xqa/rpc-tests/p2p-versionbits-warning.py13
-rwxr-xr-xqa/rpc-tests/rpcbind_test.py4
-rw-r--r--src/rpc/misc.cpp2
3 files changed, 11 insertions, 8 deletions
diff --git a/qa/rpc-tests/p2p-versionbits-warning.py b/qa/rpc-tests/p2p-versionbits-warning.py
index 962cafef0b..c17bacfc79 100755
--- a/qa/rpc-tests/p2p-versionbits-warning.py
+++ b/qa/rpc-tests/p2p-versionbits-warning.py
@@ -122,8 +122,9 @@ class VersionBitsWarningTest(BitcoinTestFramework):
# Fill rest of period with regular version blocks
self.nodes[0].generate(VB_PERIOD - VB_THRESHOLD + 1)
# Check that we're not getting any versionbit-related errors in
- # getinfo()
- assert(not self.vb_pattern.match(self.nodes[0].getinfo()["errors"]))
+ # get*info()
+ assert(not self.vb_pattern.match(self.nodes[0].getmininginfo()["errors"]))
+ assert(not self.vb_pattern.match(self.nodes[0].getnetworkinfo()["warnings"]))
# 3. Now build one period of blocks with >= VB_THRESHOLD blocks signaling
# some unknown bit
@@ -132,8 +133,9 @@ class VersionBitsWarningTest(BitcoinTestFramework):
# Might not get a versionbits-related alert yet, as we should
# have gotten a different alert due to more than 51/100 blocks
# being of unexpected version.
- # Check that getinfo() shows some kind of error.
- assert(len(self.nodes[0].getinfo()["errors"]) != 0)
+ # Check that get*info() shows some kind of error.
+ assert("Unknown block versions" in self.nodes[0].getmininginfo()["errors"])
+ assert("Unknown block versions" in self.nodes[0].getnetworkinfo()["warnings"])
# Mine a period worth of expected blocks so the generic block-version warning
# is cleared, and restart the node. This should move the versionbit state
@@ -148,7 +150,8 @@ class VersionBitsWarningTest(BitcoinTestFramework):
# Connecting one block should be enough to generate an error.
self.nodes[0].generate(1)
- assert(len(self.nodes[0].getinfo()["errors"]) != 0)
+ assert("unknown new rules" in self.nodes[0].getmininginfo()["errors"])
+ assert("unknown new rules" in self.nodes[0].getnetworkinfo()["warnings"])
stop_node(self.nodes[0], 0)
wait_bitcoinds()
self.test_versionbits_in_alert_file()
diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py
index 3ac32140ba..144c2f4cd4 100755
--- a/qa/rpc-tests/rpcbind_test.py
+++ b/qa/rpc-tests/rpcbind_test.py
@@ -44,7 +44,7 @@ class RPCBindTest(BitcoinTestFramework):
def run_allowip_test(self, allow_ips, rpchost, rpcport):
'''
- Start a node with rpcwallow IP, and request getinfo
+ Start a node with rpcwallow IP, and request getnetworkinfo
at a non-localhost IP.
'''
base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips]
@@ -52,7 +52,7 @@ class RPCBindTest(BitcoinTestFramework):
try:
# connect to node through non-loopback interface
node = get_rpc_proxy(rpc_url(0, "%s:%d" % (rpchost, rpcport)), 0)
- node.getinfo()
+ node.getnetworkinfo()
finally:
node = None # make sure connection will be garbage collected and closed
stop_nodes(self.nodes)
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
index 5afcf6353c..f0b7e0a07c 100644
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -44,7 +44,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 0)
throw runtime_error(
"getinfo\n"
- "Returns an object containing various state info.\n"
+ "\nDEPRECATED. Returns an object containing various state info.\n"
"\nResult:\n"
"{\n"
" \"version\": xxxxx, (numeric) the server version\n"