diff options
author | Lee Clagett <code@leeclagett.com> | 2023-11-28 18:05:15 -0500 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2023-11-28 18:05:15 -0500 |
commit | 47d8899c9013a3b7fa384abaadf2e4bf9b6f274a (patch) | |
tree | 179c0a2230566ec2750c26ba32f282dc31578a44 /tests | |
parent | Merge pull request #8957 (diff) | |
download | monero-47d8899c9013a3b7fa384abaadf2e4bf9b6f274a.tar.xz |
Fix missing checks for IsObject in ZMQ jsonrpc reading
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit_tests/json_serialization.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit_tests/json_serialization.cpp b/tests/unit_tests/json_serialization.cpp index 9fa589139..aa46b68dc 100644 --- a/tests/unit_tests/json_serialization.cpp +++ b/tests/unit_tests/json_serialization.cpp @@ -13,6 +13,7 @@ #include "cryptonote_basic/cryptonote_format_utils.h" #include "cryptonote_core/cryptonote_tx_utils.h" #include "serialization/json_object.h" +#include "rpc/daemon_messages.h" namespace test @@ -240,3 +241,9 @@ TEST(JsonSerialization, BulletproofTransaction) EXPECT_EQ(tx_bytes, tx_copy_bytes); } +TEST(JsonRpcSerialization, HandlerFromJson) +{ + cryptonote::rpc::FullMessage req_full("{\"jsonrpc\":\"2.0\",\"method\":\"get_hashes_fast\",\"params\":[1]}", true); + cryptonote::rpc::GetHashesFast::Request request{}; + EXPECT_THROW(request.fromJson(req_full.getMessage()), cryptonote::json::WRONG_TYPE); +} |