[rpc] Deprecate getinfo

This commit is contained in:
MarcoFalke
2016-09-21 21:01:42 +02:00
committed by lateminer
parent 2ddde6bf92
commit 5c6c445cf4
3 changed files with 11 additions and 8 deletions

View File

@@ -121,8 +121,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
@@ -131,8 +132,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
@@ -147,7 +149,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()

View File

@@ -34,7 +34,7 @@ def run_bind_test(tmpdir, allow_ips, connect_to, addresses, expected):
def run_allowip_test(tmpdir, 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]
@@ -43,7 +43,7 @@ def run_allowip_test(tmpdir, allow_ips, rpchost, rpcport):
# connect to node through non-loopback interface
url = "http://rt:rt@%s:%d" % (rpchost, rpcport,)
node = get_rpc_proxy(url, 1)
node.getinfo()
node.getnetworkinfo()
finally:
node = None # make sure connection will be garbage collected and closed
stop_nodes(nodes)

View File

@@ -45,7 +45,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"