mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Overhaul network activity toggle
- Rename RPC command "togglenetwork" to "setnetworkactive (true|false)" - Add simple test case - GUI toggle added to connections icon in statusbar
This commit is contained in:
committed by
Luke Dashjr
parent
32efa79e0e
commit
b2b33d9017
@@ -81,6 +81,28 @@ BOOST_AUTO_TEST_CASE(rpc_rawparams)
|
||||
BOOST_CHECK_THROW(CallRPC(string("sendrawtransaction ")+rawtx+" extra"), runtime_error);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
BOOST_CHECK_NO_THROW(CallRPC("setnetworkactive true"));
|
||||
r = CallRPC("getnetworkinfo");
|
||||
netState = find_value(r.get_obj(), "networkactive").get_int();
|
||||
BOOST_CHECK_EQUAL(netState, 1);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(rpc_rawsign)
|
||||
{
|
||||
UniValue r;
|
||||
|
||||
Reference in New Issue
Block a user