|
|
@ -237,7 +237,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban) |
|
|
|
UniValue o1 = ar[0].get_obj(); |
|
|
|
UniValue o1 = ar[0].get_obj(); |
|
|
|
UniValue adr = find_value(o1, "address"); |
|
|
|
UniValue adr = find_value(o1, "address"); |
|
|
|
BOOST_CHECK_EQUAL(adr.get_str(), "127.0.0.0/32"); |
|
|
|
BOOST_CHECK_EQUAL(adr.get_str(), "127.0.0.0/32"); |
|
|
|
BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0 remove")));; |
|
|
|
BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0 remove"))); |
|
|
|
BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); |
|
|
|
BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); |
|
|
|
ar = r.get_array(); |
|
|
|
ar = r.get_array(); |
|
|
|
BOOST_CHECK_EQUAL(ar.size(), 0); |
|
|
|
BOOST_CHECK_EQUAL(ar.size(), 0); |
|
|
@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban) |
|
|
|
// must throw an exception because 127.0.0.1 is in already banned suubnet range
|
|
|
|
// must throw an exception because 127.0.0.1 is in already banned suubnet range
|
|
|
|
BOOST_CHECK_THROW(r = CallRPC(string("setban 127.0.0.1 add")), runtime_error); |
|
|
|
BOOST_CHECK_THROW(r = CallRPC(string("setban 127.0.0.1 add")), runtime_error); |
|
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0/24 remove")));; |
|
|
|
BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0/24 remove"))); |
|
|
|
BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); |
|
|
|
BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); |
|
|
|
ar = r.get_array(); |
|
|
|
ar = r.get_array(); |
|
|
|
BOOST_CHECK_EQUAL(ar.size(), 0); |
|
|
|
BOOST_CHECK_EQUAL(ar.size(), 0); |
|
|
|