RPC/Net: Use boolean consistently for networkactive, and remove from getinfo

This commit is contained in:
Luke Dashjr
2016-10-23 05:35:52 +00:00
parent b2b33d9017
commit 54cf99745f
3 changed files with 11 additions and 13 deletions

View File

@@ -86,21 +86,21 @@ BOOST_AUTO_TEST_CASE(rpc_togglenetwork)
UniValue r;
r = CallRPC("getnetworkinfo");
int netState = find_value(r.get_obj(), "networkactive").get_int();
BOOST_CHECK_EQUAL(netState, 1);
bool netState = find_value(r.get_obj(), "networkactive").get_bool();
BOOST_CHECK_EQUAL(netState, true);
BOOST_CHECK_NO_THROW(CallRPC("setnetworkactive false"));
r = CallRPC("getnetworkinfo");
int numConnection = find_value(r.get_obj(), "connections").get_int();
BOOST_CHECK_EQUAL(numConnection, 0);
netState = find_value(r.get_obj(), "networkactive").get_int();
BOOST_CHECK_EQUAL(netState, 0);
netState = find_value(r.get_obj(), "networkactive").get_bool();
BOOST_CHECK_EQUAL(netState, false);
BOOST_CHECK_NO_THROW(CallRPC("setnetworkactive true"));
r = CallRPC("getnetworkinfo");
netState = find_value(r.get_obj(), "networkactive").get_int();
BOOST_CHECK_EQUAL(netState, 1);
netState = find_value(r.get_obj(), "networkactive").get_bool();
BOOST_CHECK_EQUAL(netState, true);
}
BOOST_AUTO_TEST_CASE(rpc_rawsign)