diff options
| author | tobtoht <tob@featherwallet.org> | 2026-04-02 20:04:02 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2026-04-02 20:04:02 +0000 |
| commit | 2953f74a84f534d10fe45d2d4c7002f350e0adbd (patch) | |
| tree | 8ef5f0c25ee7f0e58af6b159ea596adce6d8fec5 /tests | |
| parent | ee1bbe766317b2197510d038753be62f09c13c00 (diff) | |
| parent | 7f2cfe9294ec1fa7bece2a8069114c1b6985650f (diff) | |
| download | monzero-core-2953f74a84f534d10fe45d2d4c7002f350e0adbd.tar.gz monzero-core-2953f74a84f534d10fe45d2d4c7002f350e0adbd.tar.xz monzero-core-2953f74a84f534d10fe45d2d4c7002f350e0adbd.zip | |
Merge pull request #10389
7f2cfe9 zmq: add restricted rpc mode (selsta)
dd0fb6c daemon: warn user on specifiying ZMQ args with --no-zmq (jeffro256)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit_tests/zmq_rpc.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit_tests/zmq_rpc.cpp b/tests/unit_tests/zmq_rpc.cpp index c98f0011b..38b5f083f 100644 --- a/tests/unit_tests/zmq_rpc.cpp +++ b/tests/unit_tests/zmq_rpc.cpp @@ -39,6 +39,7 @@ #include "net/zmq.h" #include "rpc/message.h" #include "rpc/zmq_pub.h" +#include "rpc/zmq_restricted_methods.h" #include "rpc/zmq_server.h" #include "serialization/json_object.h" @@ -69,6 +70,23 @@ TEST(ZmqFullMessage, Request) EXPECT_STREQ("foo", parsed.getRequestType().c_str()); } +TEST(ZmqRestrictedMethods, BasicCoverage) +{ + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("flush_txpool")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("get_peer_list")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("mining_status")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("relay_tx")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("save_bc")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("set_log_categories")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("set_log_level")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("start_mining")); + EXPECT_TRUE(cryptonote::rpc::is_blocked_in_restricted_mode("stop_mining")); + + EXPECT_FALSE(cryptonote::rpc::is_blocked_in_restricted_mode("get_height")); + EXPECT_FALSE(cryptonote::rpc::is_blocked_in_restricted_mode("get_info")); + EXPECT_FALSE(cryptonote::rpc::is_blocked_in_restricted_mode("send_raw_tx")); +} + namespace { using published_json = std::pair<std::string, rapidjson::Document>; |
