[rpc] Deprecate getinfo

This was replaced by getmininginfo, getnetworkinfo and getwalletinfo
This commit is contained in:
MarcoFalke 2016-09-21 21:01:42 +02:00
parent cf5ebaa921
commit ddddaafa4a
3 changed files with 11 additions and 8 deletions

View file

@ -122,8 +122,9 @@ class VersionBitsWarningTest(BitcoinTestFramework):
# Fill rest of period with regular version blocks # Fill rest of period with regular version blocks
self.nodes[0].generate(VB_PERIOD - VB_THRESHOLD + 1) self.nodes[0].generate(VB_PERIOD - VB_THRESHOLD + 1)
# Check that we're not getting any versionbit-related errors in # Check that we're not getting any versionbit-related errors in
# getinfo() # get*info()
assert(not self.vb_pattern.match(self.nodes[0].getinfo()["errors"])) 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 # 3. Now build one period of blocks with >= VB_THRESHOLD blocks signaling
# some unknown bit # some unknown bit
@ -132,8 +133,9 @@ class VersionBitsWarningTest(BitcoinTestFramework):
# Might not get a versionbits-related alert yet, as we should # Might not get a versionbits-related alert yet, as we should
# have gotten a different alert due to more than 51/100 blocks # have gotten a different alert due to more than 51/100 blocks
# being of unexpected version. # being of unexpected version.
# Check that getinfo() shows some kind of error. # Check that get*info() shows some kind of error.
assert(len(self.nodes[0].getinfo()["errors"]) != 0) 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 # 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 # 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. # Connecting one block should be enough to generate an error.
self.nodes[0].generate(1) 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) stop_node(self.nodes[0], 0)
wait_bitcoinds() wait_bitcoinds()
self.test_versionbits_in_alert_file() self.test_versionbits_in_alert_file()

View file

@ -44,7 +44,7 @@ class RPCBindTest(BitcoinTestFramework):
def run_allowip_test(self, allow_ips, rpchost, rpcport): 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. at a non-localhost IP.
''' '''
base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips] base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips]
@ -52,7 +52,7 @@ class RPCBindTest(BitcoinTestFramework):
try: try:
# connect to node through non-loopback interface # connect to node through non-loopback interface
node = get_rpc_proxy(rpc_url(0, "%s:%d" % (rpchost, rpcport)), 0) node = get_rpc_proxy(rpc_url(0, "%s:%d" % (rpchost, rpcport)), 0)
node.getinfo() node.getnetworkinfo()
finally: finally:
node = None # make sure connection will be garbage collected and closed node = None # make sure connection will be garbage collected and closed
stop_nodes(self.nodes) stop_nodes(self.nodes)

View file

@ -44,7 +44,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 0) if (fHelp || params.size() != 0)
throw runtime_error( throw runtime_error(
"getinfo\n" "getinfo\n"
"Returns an object containing various state info.\n" "\nDEPRECATED. Returns an object containing various state info.\n"
"\nResult:\n" "\nResult:\n"
"{\n" "{\n"
" \"version\": xxxxx, (numeric) the server version\n" " \"version\": xxxxx, (numeric) the server version\n"