diff options
| author | Jonas Schnelli <[email protected]> | 2016-11-11 11:16:34 +0100 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2016-11-11 11:16:40 +0100 |
| commit | ab914a65301bd48f2b6c7a64bf57295ae74f2902 (patch) | |
| tree | 4d5cc61cffd8d24d7c09f1d9cf9a6c5317cf2e5a /src/test/rpc_tests.cpp | |
| parent | Merge #9058: Fixes for p2p-compactblocks.py test timeouts on travis (#8842) (diff) | |
| parent | Qt: New network_disabled icon (diff) | |
| download | discoin-ab914a65301bd48f2b6c7a64bf57295ae74f2902.tar.xz discoin-ab914a65301bd48f2b6c7a64bf57295ae74f2902.zip | |
Merge #8996: Network activity toggle
19f46f1 Qt: New network_disabled icon (Luke Dashjr)
54cf997 RPC/Net: Use boolean consistently for networkactive, and remove from getinfo (Luke Dashjr)
b2b33d9 Overhaul network activity toggle (Jonas Schnelli)
32efa79 Qt: Add GUI feedback and control of network activity state. (Jon Lund Steffensen)
e38993b RPC: Add "togglenetwork" method to toggle network activity temporarily (Jon Lund Steffensen)
7c9a98a Allow network activity to be temporarily suspended. (Jon Lund Steffensen)
Diffstat (limited to 'src/test/rpc_tests.cpp')
| -rw-r--r-- | src/test/rpc_tests.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index a3d1a2558..a359598dd 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -84,6 +84,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"); + 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_bool(); + BOOST_CHECK_EQUAL(netState, false); + + BOOST_CHECK_NO_THROW(CallRPC("setnetworkactive true")); + r = CallRPC("getnetworkinfo"); + netState = find_value(r.get_obj(), "networkactive").get_bool(); + BOOST_CHECK_EQUAL(netState, true); +} + BOOST_AUTO_TEST_CASE(rpc_rawsign) { UniValue r; |